mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add dynamicCode::libraryBaseName() service function
- return the library basename without leading 'lib' or trailing '.so'
This commit is contained in:
@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user