add SharedLibrary::getOSName() to improve portability of shared library

real filename over different OS like Linux/Unix/Cygwin & Windows.

Signed-off-by: FrancisANDRE <zosrothko@orange.fr>
This commit is contained in:
FrancisANDRE
2015-09-19 08:28:26 +02:00
parent b2ef29528d
commit a4479552b6
4 changed files with 12 additions and 3 deletions

View File

@@ -121,7 +121,7 @@ public:
static std::string prefix();
/// Returns the platform-specific filename prefix
/// for shared libraries.
/// Most platforms would return an empty string, but
/// Most platforms would return "lib" as prefix, while
/// on Cygwin, the "cyg" prefix will be returned.
static std::string suffix();
@@ -130,6 +130,11 @@ public:
/// In debug mode, the suffix also includes a
/// "d" to specify the debug version of a library.
static std::string getOSName(const std::string& name);
/// Returns the platform-specific filename
/// for shared libraries by prefixing and suffixing name
/// with prefix() and suffix()
private:
SharedLibrary(const SharedLibrary&);
SharedLibrary& operator = (const SharedLibrary&);