mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: Added dictName() functions to return last cmpt of scoped name
This commit is contained in:
@ -111,6 +111,23 @@ public:
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
|
||||
//- Return the local dictionary name (final part of scoped name)
|
||||
const word dictName() const
|
||||
{
|
||||
const word scopedName = name_.name();
|
||||
|
||||
string::size_type i = scopedName.rfind(':');
|
||||
|
||||
if (i == scopedName.npos)
|
||||
{
|
||||
return scopedName;
|
||||
}
|
||||
else
|
||||
{
|
||||
return scopedName.substr(i + 1, scopedName.npos);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -106,13 +106,19 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Return the dictionary name
|
||||
//- Return the local dictionary name (final part of scoped name)
|
||||
const word dictName() const
|
||||
{
|
||||
return dictionary::dictName();
|
||||
}
|
||||
|
||||
//- Return the dictionary name (scoped, e.g. dictA::dictB::dictC)
|
||||
const fileName& name() const
|
||||
{
|
||||
return dictionary::name();
|
||||
}
|
||||
|
||||
//- Return the dictionary name
|
||||
//- Return the dictionary name (scoped, e.g. dictA::dictB::dictC)
|
||||
fileName& name()
|
||||
{
|
||||
return dictionary::name();
|
||||
|
||||
Reference in New Issue
Block a user