Panzer
Version of the Day
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
adapters-stk
src
Panzer_STK_TransformBCNameForIOSS.cpp
Go to the documentation of this file.
1
#include "
Panzer_STK_TransformBCNameForIOSS.hpp
"
2
#include "
Panzer_String_Utilities.hpp
"
3
#include <algorithm>
4
#include <cctype>
5
6
std::string
panzer_stk::transformBCNameForIOSS
(std::string& name)
7
{
8
// strip off leading and trailing whitespace just in case this comes
9
// in from input file.
10
panzer::trim
(name);
11
12
// replace internal whitespace with underscores and upper case with lower case.
13
std::transform(name.begin(), name.end(), name.begin(),
14
[](
const
char
c)
15
{
16
if
(c ==
' '
)
17
return
'_'
;
18
else
19
return
char(std::tolower(c));
20
});
21
return
name;
22
}
panzer::trim
void trim(std::string &str)
Removes whitespace at beginning and end of string.
Definition:
Panzer_String_Utilities.cpp:48
panzer_stk::transformBCNameForIOSS
std::string transformBCNameForIOSS(std::string &bc_name)
Definition:
Panzer_STK_TransformBCNameForIOSS.cpp:6
Panzer_String_Utilities.hpp
Panzer_STK_TransformBCNameForIOSS.hpp
Generated by
1.8.5