![]() |
libcyberradio
22.01.24
|
Configuration value string class. More...
#include <ConfigString.h>
Inherits string.
Public Member Functions | |
| ConfigString () | |
| Constructs an empty ConfigString object. | |
| ConfigString (const std::string &str) | |
| Constructs a ConfigString object from a string. More... | |
| ConfigString (const std::string &str, size_t pos, size_t len=npos) | |
| Constructs a ConfigString object from a substring. More... | |
| ConfigString (const char *s) | |
| Constructs a ConfigString object from a string literal. More... | |
| ConfigString (const char *s, size_t n) | |
| Constructs a ConfigString object from a buffer. More... | |
| ConfigString (size_t n, char c) | |
| Constructs a ConfigString object from a fill character. | |
| template<class InputIterator > | |
| ConfigString (InputIterator first, InputIterator last) | |
| Constructs a ConfigString object from a range. More... | |
| ConfigString (std::initializer_list< char > il) | |
| Constructs a ConfigString object from an initializer list. More... | |
| ConfigString (std::string &&str) noexcept | |
| Move constructor. More... | |
| ConfigString (int i) | |
| Constructs a ConfigString object. More... | |
| ConfigString (unsigned int i) | |
| Constructs a ConfigString object. More... | |
| ConfigString (long l) | |
| Constructs a ConfigString object. More... | |
| ConfigString (bool b) | |
| Constructs a ConfigString object. More... | |
| ConfigString (float f) | |
| Constructs a ConfigString object. More... | |
| ConfigString (double f) | |
| Constructs a ConfigString object. More... | |
| virtual | ~ConfigString () |
| Destroys a ConfigString object. | |
| ConfigString & | operator= (const std::string &s) |
| Assigns a value to this object. More... | |
| ConfigString & | operator= (const char *s) |
| Assigns a value to this object. More... | |
| ConfigString & | operator= (int i) |
| Assigns a value to this object. More... | |
| ConfigString & | operator= (unsigned int i) |
| Assigns a value to this object. More... | |
| ConfigString & | operator= (long l) |
| Assigns a value to this object. More... | |
| ConfigString & | operator= (bool b) |
| Assigns a value to this object. More... | |
| ConfigString & | operator= (float f) |
| Assigns a value to this object. More... | |
| ConfigString & | operator= (double f) |
| Assigns a value to this object. More... | |
| int | asInt () const |
| Retrieves a value from this object. More... | |
| unsigned int | asUInt () const |
| Retrieves a value from this object. More... | |
| long | asLong () const |
| Retrieves a value from this object. More... | |
| bool | asBool () const |
| Retrieves a value from this object. More... | |
| float | asFloat () const |
| Retrieves a value from this object. More... | |
| double | asDouble () const |
| Retrieves a value from this object. More... | |
Configuration value string class.
This class supports all standard std::string semantics for manipulating the string form of the value.
This class overloads the assignment (=) operator for setting values using non-string data values, and defines several methods for converting the stored value back to non-string data types.
Definition at line 39 of file ConfigString.h.
|
inline |
Constructs a ConfigString object from a string.
| str | String to copy. |
Definition at line 50 of file ConfigString.h.
|
inline |
Constructs a ConfigString object from a substring.
| str | String to extract from |
| pos | Start position (0 = beginning) |
| len | Length of substring. If this is npos, copy to end. |
Definition at line 57 of file ConfigString.h.
|
inline |
Constructs a ConfigString object from a string literal.
| s | String to copy. |
Definition at line 63 of file ConfigString.h.
|
inline |
Constructs a ConfigString object from a buffer.
| s | String buffer |
| n | Number of characters to copy |
Definition at line 69 of file ConfigString.h.
|
inline |
Constructs a ConfigString object from a range.
| first | Iterator to first character in the range |
| last | Iterator to last character in the range |
Definition at line 80 of file ConfigString.h.
|
inline |
Constructs a ConfigString object from an initializer list.
| il | Initializer list |
Definition at line 86 of file ConfigString.h.
|
inlinenoexcept |
|
inline |
Constructs a ConfigString object.
| i | String value, as an integer. |
Definition at line 96 of file ConfigString.h.
|
inline |
Constructs a ConfigString object.
| i | String value, as an unsigned integer. |
Definition at line 101 of file ConfigString.h.
|
inline |
Constructs a ConfigString object.
| l | String value, as a long integer. |
Definition at line 106 of file ConfigString.h.
|
inline |
Constructs a ConfigString object.
| b | String value, as a Boolean value. |
Definition at line 111 of file ConfigString.h.
|
inline |
Constructs a ConfigString object.
| f | String value, as a floating-point value. |
Definition at line 116 of file ConfigString.h.
|
inline |
Constructs a ConfigString object.
| f | String value, as a double floating-point value. |
Definition at line 121 of file ConfigString.h.
| bool asBool | ( | ) | const |
Retrieves a value from this object.
Definition at line 100 of file ConfigString.cpp.
| double asDouble | ( | ) | const |
Retrieves a value from this object.
Definition at line 111 of file ConfigString.cpp.
| float asFloat | ( | ) | const |
Retrieves a value from this object.
Definition at line 106 of file ConfigString.cpp.
| int asInt | ( | ) | const |
Retrieves a value from this object.
Definition at line 85 of file ConfigString.cpp.
| long asLong | ( | ) | const |
Retrieves a value from this object.
Definition at line 95 of file ConfigString.cpp.
| unsigned int asUInt | ( | ) | const |
Retrieves a value from this object.
Definition at line 90 of file ConfigString.cpp.
| ConfigString & operator= | ( | const std::string & | s | ) |
Assigns a value to this object.
| s | String value. |
Definition at line 21 of file ConfigString.cpp.
| ConfigString & operator= | ( | const char * | s | ) |
Assigns a value to this object.
| s | String literal value. |
Definition at line 29 of file ConfigString.cpp.
| ConfigString & operator= | ( | int | i | ) |
Assigns a value to this object.
| i | String value, as an integer. |
Definition at line 37 of file ConfigString.cpp.
| ConfigString & operator= | ( | unsigned int | i | ) |
Assigns a value to this object.
| i | String value, as an unsigned integer. |
Definition at line 45 of file ConfigString.cpp.
| ConfigString & operator= | ( | long | l | ) |
Assigns a value to this object.
| l | String value, as a long integer. |
Definition at line 53 of file ConfigString.cpp.
| ConfigString & operator= | ( | bool | b | ) |
Assigns a value to this object.
| b | String value, as a Boolean value. |
Definition at line 61 of file ConfigString.cpp.
| ConfigString & operator= | ( | float | f | ) |
Assigns a value to this object.
| f | String value, as a floating-point value. |
Definition at line 69 of file ConfigString.cpp.
| ConfigString & operator= | ( | double | f | ) |
Assigns a value to this object.
| f | String value, as a double floating-point value. |
Definition at line 77 of file ConfigString.cpp.