ENH: add dynamicCode::libraryBaseName() service function

- return the library basename without leading 'lib' or trailing '.so'
This commit is contained in:
Mark Olesen
2011-03-03 13:58:07 +01:00
parent 97da787c69
commit 0f8b423a68
2 changed files with 12 additions and 0 deletions

View File

@ -77,6 +77,15 @@ void Foam::dynamicCode::checkSecurity
}
Foam::word Foam::dynamicCode::libraryBaseName(const fileName& libPath)
{
word libName(libPath.name(true));
libName.erase(0, 3); // remove leading 'lib' from name
return libName;
}
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::dynamicCode::copyAndFilter

View File

@ -169,6 +169,9 @@ public:
//- Check security for creating dynamic code
static void checkSecurity(const char* title, const dictionary&);
//- Return the library basename without leading 'lib' or trailing '.so'
static word libraryBaseName(const fileName& libPath);
// Constructors