#include <StringParse.h>
◆ StringParse() [1/4]
StringParse::StringParse |
( |
std::string |
input | ) |
|
Definition at line 17 of file StringParse.cxx.
17 {
18 m_past_end="?!?";
19 m_lstring=input;
20 m_nword=0;
21 std::string::size_type pos=0;
22 std::string::size_type prev_pos=0;
23 while((pos=input.find_first_of(' ',pos)) != std::string::npos){
24 m_lsubstring.push_back(input.substr(prev_pos,pos-prev_pos));
25 prev_pos=++pos;
26 }
27
28 m_lsubstring.push_back(input.substr(prev_pos,pos-prev_pos));
29 m_nword=m_lsubstring.size();
30}
◆ StringParse() [2/4]
StringParse::StringParse |
( |
| ) |
|
◆ ~StringParse() [1/2]
StringParse::~StringParse |
( |
| ) |
|
◆ StringParse() [3/4]
StringParse::StringParse |
( |
std::string |
input | ) |
|
◆ StringParse() [4/4]
StringParse::StringParse |
( |
| ) |
|
◆ ~StringParse() [2/2]
StringParse::~StringParse |
( |
| ) |
|
◆ intpiece() [1/2]
int StringParse::intpiece |
( |
const int & |
num | ) |
|
Definition at line 39 of file StringParse.cxx.
39 {
41 int i= atoi(m_lsubstring[
num-1].
c_str());
42 return i;
43 }
44 else {
45 return -1;
46 }
47}
◆ intpiece() [2/2]
int StringParse::intpiece |
( |
const int & |
num | ) |
|
◆ longpiece() [1/2]
long StringParse::longpiece |
( |
const int & |
num | ) |
|
Definition at line 48 of file StringParse.cxx.
48 {
50 int i= atol(m_lsubstring[
num-1].
c_str());
51 return i;
52 }
53 else {
54 return -1;
55 }
56}
◆ longpiece() [2/2]
long StringParse::longpiece |
( |
const int & |
num | ) |
|
◆ numpiece() [1/2]
float StringParse::numpiece |
( |
const int & |
num | ) |
|
Definition at line 57 of file StringParse.cxx.
57 {
59 float x= atof(m_lsubstring[
num-1].
c_str());
61 }
62 else {
63 return -1.1;
64 }
65}
◆ numpiece() [2/2]
float StringParse::numpiece |
( |
const int & |
num | ) |
|
◆ piece() [1/2]
std::string StringParse::piece |
( |
const int & |
num | ) |
|
Definition at line 31 of file StringParse.cxx.
31 {
33 return m_lsubstring[
num-1];
34 }
35 else {
36 return m_past_end;
37 }
38}
◆ piece() [2/2]
std::string StringParse::piece |
( |
const int & |
num | ) |
|
◆ string_size() [1/2]
unsigned StringParse::string_size |
( |
void |
| ) |
const |
|
inline |
◆ string_size() [2/2]
unsigned StringParse::string_size |
( |
void |
| ) |
const |
The documentation for this class was generated from the following files: