#include <ChainString.h>
|
static std::string | chop (std::string &s1, const std::string &s2) |
|
Definition at line 23 of file ChainString.h.
◆ ChainString() [1/2]
ChainString::ChainString |
( |
const std::string & |
s | ) |
|
Definition at line 16 of file ChainString.cxx.
20 if (
s.find(
":post")!=std::string::npos )
m_post =
s.substr(
s.find(
":post")+6,
s.size() );
◆ ChainString() [2/2]
◆ chomp()
static std::string ChainString::chomp |
( |
std::string & |
s1, |
|
|
const std::string & |
s2 |
|
) |
| |
|
inlinestaticprotected |
Definition at line 100 of file ChainString.h.
102 std::string::size_type
pos =
s1.find_first_of(
s2);
104 if (
pos == std::string::npos )
return "";
◆ chop()
static std::string ChainString::chop |
( |
std::string & |
s1, |
|
|
const std::string & |
s2 |
|
) |
| |
|
inlinestatic |
Definition at line 83 of file ChainString.h.
84 std::string::size_type
pos =
s1.find_first_of(
s2);
86 if (
pos == std::string::npos ) {
88 s1.erase(0,
s1.size());
◆ element()
std::string ChainString::element |
( |
| ) |
const |
|
inline |
◆ extra()
std::string ChainString::extra |
( |
| ) |
const |
|
inline |
◆ findkey()
int ChainString::findkey |
( |
const std::string & |
key | ) |
const |
|
inlineprotected |
◆ head()
std::string ChainString::head |
( |
| ) |
const |
|
inline |
◆ keys()
const std::vector<std::string>& ChainString::keys |
( |
| ) |
const |
|
inline |
◆ operator=()
◆ parse()
void ChainString::parse |
( |
std::string |
s | ) |
|
|
protected |
parse the full specification string
replace the string by a parsed basic string
overwrite with the parsed string
Definition at line 38 of file ChainString.cxx.
40 std::vector<std::string>
fields;
44 bool postkeys =
false;
50 for (
size_t i=1 ;
i<
fields.size() ;
i++ ) {
52 if ( !postkeys && dte==
"DTE" )
m_passed =
false;
54 else if (
fields[
i]==
"post" ) postkeys =
true;
69 std::string
tags[5] = {
"key",
"roi",
"vtx",
"te",
"extra" };
70 bool tagged[5] = {
false,
false,
false,
false,
false };
74 for (
size_t i=0 ;
i<keycount &&
i<5 ;
i++ ) {
76 if ( tagged[
i] ) std::cerr <<
"tag already allocated : " <<
tags[
i] <<
" with value " << *
values[
i] << std::endl;
81 for (
int j=0 ; j<5 ; j++ ) {
83 if ( tagged[j] ) std::cerr <<
"tag already allocated : " <<
tags[j] <<
" with value " << *
values[j] << std::endl;
91 if ( unset ) std::cerr <<
"no such tag: " <<
m_keys[
i] << std::endl;
96 std::cout <<
"head: " <<
m_head << std::endl;
97 std::cout <<
"key: " <<
m_tail << std::endl;
98 std::cout <<
"roi: " <<
m_roi << std::endl;
99 std::cout <<
"vtx: " <<
m_vtx << std::endl;
100 std::cout <<
"te: " <<
m_element << std::endl;
101 std::cout <<
"ind: " <<
m_extra << std::endl;
102 std::cout <<
"pass: " <<
m_passed << std::endl;
112 *(std::string*)(
this) =
raw;
◆ passed()
bool ChainString::passed |
( |
| ) |
const |
|
inline |
◆ post()
const std::string& ChainString::post |
( |
| ) |
const |
|
inline |
◆ postcount()
size_t ChainString::postcount |
( |
| ) |
const |
|
inline |
◆ postvalue()
std::string ChainString::postvalue |
( |
const std::string & |
key | ) |
const |
|
inline |
same here regarding returning a reference
Definition at line 65 of file ChainString.h.
◆ pre()
std::string ChainString::pre |
( |
| ) |
const |
|
inline |
◆ raw()
std::string ChainString::raw |
( |
| ) |
const |
|
inline |
◆ roi()
std::string ChainString::roi |
( |
| ) |
const |
|
inline |
◆ subs()
std::string ChainString::subs |
( |
std::string |
s | ) |
const |
Definition at line 127 of file ChainString.cxx.
129 std::string
tags[5] = {
"key=",
"roi=",
"vtx=",
"te=",
"extra=" };
◆ tail()
std::string ChainString::tail |
( |
| ) |
const |
|
inline |
◆ tolower() [1/2]
static char ChainString::tolower |
( |
char |
c | ) |
|
|
inlinestaticprotected |
convert to lower case
Definition at line 125 of file ChainString.h.
125 {
return (
c>=
'A' &&
c<=
'Z' ?
c-
'A'+
'a' :
c ); }
◆ tolower() [2/2]
static std::string ChainString::tolower |
( |
const std::string & |
s | ) |
|
|
inlinestaticprotected |
convert to lower case
Definition at line 128 of file ChainString.h.
129 const char*
c =
s.c_str();
◆ toupper() [1/2]
static char ChainString::toupper |
( |
char |
c | ) |
|
|
inlinestaticprotected |
convert to upper case
Definition at line 113 of file ChainString.h.
113 {
return (
c>=
'a' &&
c<=
'z' ?
c+
'A'-
'a' :
c ); }
◆ toupper() [2/2]
static std::string ChainString::toupper |
( |
const std::string & |
s | ) |
|
|
inlinestaticprotected |
convert to upper case
Definition at line 116 of file ChainString.h.
117 const char*
c =
s.c_str();
◆ value()
std::string ChainString::value |
( |
const std::string & |
key | ) |
const |
|
inline |
can't make this return a reference in case there is no such key - could throw an exception then it would work, but that is far too excessive
Definition at line 58 of file ChainString.h.
◆ values()
const std::vector<std::string>& ChainString::values |
( |
| ) |
const |
|
inline |
◆ vtx()
std::string ChainString::vtx |
( |
| ) |
const |
|
inline |
◆ m_element
std::string ChainString::m_element |
|
private |
◆ m_extra
std::string ChainString::m_extra |
|
private |
◆ m_head
std::string ChainString::m_head |
|
private |
◆ m_keys
std::vector<std::string> ChainString::m_keys |
|
private |
◆ m_passed
bool ChainString::m_passed |
|
private |
◆ m_post
std::string ChainString::m_post |
|
private |
◆ m_postcount
size_t ChainString::m_postcount |
|
private |
◆ m_raw
std::string ChainString::m_raw |
|
private |
◆ m_roi
std::string ChainString::m_roi |
|
private |
◆ m_tail
std::string ChainString::m_tail |
|
private |
◆ m_values
std::vector<std::string> ChainString::m_values |
|
private |
◆ m_vtx
std::string ChainString::m_vtx |
|
private |
The documentation for this class was generated from the following files: