Commit a6134d25 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Added dictName() functions to return last cmpt of scoped name

parent 9de20a66
......@@ -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();
......
Markdown is supported
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