mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
STYLE: update fileName docs and minor code cleanup
This commit is contained in:
@ -46,21 +46,30 @@ Foam::word Foam::string::ext() const
|
||||
return word::null;
|
||||
}
|
||||
|
||||
return substr(i+1, npos);
|
||||
return substr(i+1);
|
||||
}
|
||||
|
||||
|
||||
bool Foam::string::ext(const Foam::word& ending)
|
||||
bool Foam::string::ext(const word& ending)
|
||||
{
|
||||
if (!ending.empty() && !empty() && operator[](size()-1) != '/')
|
||||
if (ending.empty() || empty() || back() == '/')
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (ending[0] == '.')
|
||||
{
|
||||
if (ending.size() == 1)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
append(1u, '.');
|
||||
append(ending);
|
||||
|
||||
return true;
|
||||
}
|
||||
append(ending);
|
||||
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -90,7 +99,7 @@ bool Foam::string::hasExt(const wordRe& ending) const
|
||||
return false;
|
||||
}
|
||||
|
||||
const std::string end = substr(i+1, npos); // Compare *after* the dot
|
||||
const std::string end = substr(i+1); // Compare *after* the dot
|
||||
return ending.match(end);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user