Skip to content
Snippets Groups Projects
Commit 0f8b423a authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: add dynamicCode::libraryBaseName() service function

- return the library basename without leading 'lib' or trailing '.so'
parent 97da787c
No related merge requests found
......@@ -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
......
......@@ -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
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment