Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
33c1b274
Commit
33c1b274
authored
Apr 03, 2013
by
andy
Browse files
ENH: Added caseName option to fileName
parent
ce7b8dc2
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/primitives/strings/fileName/fileName.C
View file @
33c1b274
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -204,6 +204,25 @@ Foam::word Foam::fileName::name() const
}
Foam
::
string
Foam
::
fileName
::
caseName
()
const
{
string
cName
=
*
this
;
const
string
caseStr
(
getEnv
(
"FOAM_CASE"
));
const
size_type
i
=
find
(
caseStr
);
if
(
i
==
npos
)
{
return
cName
;
}
else
{
return
cName
.
replace
(
i
,
caseStr
.
size
(),
string
(
"$FOAM_CASE"
));
}
}
Foam
::
word
Foam
::
fileName
::
name
(
const
bool
noExt
)
const
{
if
(
noExt
)
...
...
src/OpenFOAM/primitives/strings/fileName/fileName.H
View file @
33c1b274
...
...
@@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011
-2013
OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
...
...
@@ -153,6 +153,9 @@ public:
//- Return file name (part beyond last /)
word
name
()
const
;
//- Return file name (part beyond last /), subsitute for FOAM_CASE
string
caseName
()
const
;
//- Return file name, optionally without extension
word
name
(
const
bool
noExt
)
const
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment