OpenStructure
|
#include <string_ref.hh>
Inherited by LPadded, and RPadded.
Public Types | |
typedef char * | iterator |
typedef const char * | const_iterator |
typedef char | value_type |
Public Member Functions | |
StringRef (const char *begin, size_t len) | |
StringRef () | |
const char * | begin () const |
const char * | end () const |
const char * | data () const |
size_t | size () const |
size_t | length () const |
char | front () const |
const_iterator | find (char p) const |
StringRef | substr (size_t pos, size_t n=std::string::npos) const |
std::string | str () const |
char | back () const |
const char & | operator[] (int index) const |
bool | operator== (const StringRef &rhs) const |
bool | operator!= (const StringRef &rhs) const |
StringRef | rtrim () const |
StringRef | ltrim () const |
StringRef | trim () const |
std::pair< bool, int > | to_int () const |
std::pair< bool, float > | to_float () const |
bool | empty () const |
std::vector< StringRef > | split (char p) const |
convenient datatype for referencing character data
Definition at line 39 of file string_ref.hh.
typedef const char* const_iterator |
Definition at line 43 of file string_ref.hh.
typedef char* iterator |
Definition at line 42 of file string_ref.hh.
typedef char value_type |
Definition at line 44 of file string_ref.hh.
|
inline |
Definition at line 46 of file string_ref.hh.
|
inline |
Definition at line 47 of file string_ref.hh.
|
inline |
Definition at line 87 of file string_ref.hh.
|
inline |
Definition at line 50 of file string_ref.hh.
|
inline |
Definition at line 52 of file string_ref.hh.
|
inline |
Definition at line 135 of file string_ref.hh.
|
inline |
Definition at line 51 of file string_ref.hh.
|
inline |
Definition at line 63 of file string_ref.hh.
|
inline |
Definition at line 57 of file string_ref.hh.
|
inline |
Definition at line 55 of file string_ref.hh.
|
inline |
strip space characters on the left
Definition at line 111 of file string_ref.hh.
|
inline |
Definition at line 100 of file string_ref.hh.
|
inline |
Definition at line 95 of file string_ref.hh.
|
inline |
Definition at line 93 of file string_ref.hh.
|
inline |
strip space characters on the right
Definition at line 104 of file string_ref.hh.
|
inline |
Definition at line 54 of file string_ref.hh.
std::vector<StringRef> split | ( | char | p | ) | const |
split string into chunks delimited by p
|
inline |
Definition at line 83 of file string_ref.hh.
|
inline |
Definition at line 73 of file string_ref.hh.
std::pair<bool, float> to_float | ( | ) | const |
convert to float
first
set to true and second
set to the float if the conversion succeeds. If the conversion fails, first
is set to false. std::pair<bool, int> to_int | ( | ) | const |
convert to integer
first
set to true and second
set to the int if the conversion succeeds. If the conversion fails, first
is set to false.
|
inline |
strip space characters on the left and the right
Definition at line 119 of file string_ref.hh.