A wrapper string class to make a various amount of things just easier to type. All strings used should be of this type, add methods to this class as you need them.
More...
#include <String.h>
A wrapper string class to make a various amount of things just easier to type. All strings used should be of this type, add methods to this class as you need them.
| trippingcyril::String::String |
( |
bool |
b | ) |
|
|
inlineexplicit |
| trippingcyril::String::String |
( |
char |
c | ) |
|
|
explicit |
| trippingcyril::String::String |
( |
unsigned char |
c | ) |
|
|
explicit |
| trippingcyril::String::String |
( |
short |
i | ) |
|
|
explicit |
| trippingcyril::String::String |
( |
unsigned short |
i | ) |
|
|
explicit |
| trippingcyril::String::String |
( |
int |
i | ) |
|
|
explicit |
| trippingcyril::String::String |
( |
unsigned int |
i | ) |
|
|
explicit |
| trippingcyril::String::String |
( |
long |
i | ) |
|
|
explicit |
| trippingcyril::String::String |
( |
unsigned long |
i | ) |
|
|
explicit |
| trippingcyril::String::String |
( |
long long |
i | ) |
|
|
explicit |
| trippingcyril::String::String |
( |
unsigned long long |
i | ) |
|
|
explicit |
| trippingcyril::String::String |
( |
double |
i, |
|
|
unsigned int |
precision = 2 |
|
) |
| |
|
explicit |
| trippingcyril::String::String |
( |
float |
i, |
|
|
unsigned int |
precision = 2 |
|
) |
| |
|
explicit |
| trippingcyril::String::String |
( |
const std::stringstream & |
stream | ) |
|
| trippingcyril::String::String |
( |
| ) |
|
|
inline |
| trippingcyril::String::String |
( |
const char * |
c | ) |
|
|
inline |
| trippingcyril::String::String |
( |
const char * |
c, |
|
|
size_t |
l |
|
) |
| |
|
inline |
| trippingcyril::String::String |
( |
const string & |
s | ) |
|
|
inline |
| virtual trippingcyril::String::~String |
( |
| ) |
|
|
inlinevirtual |
| unsigned long trippingcyril::String::Base64Decode |
( |
String & |
sRet | ) |
const |
Treat this string as base64-encoded data and decode it.
- Parameters
-
| sRet | String to which the result of the decode is safed. |
- Returns
- The length of the resulting string.
| bool trippingcyril::String::Base64Encode |
( |
String & |
sRet | ) |
const |
Base64-encode the current string.
- Parameters
-
| sRet | String where the result is saved. |
- Returns
- True if succesfully coded
| String& trippingcyril::String::MakeLower |
( |
| ) |
|
Turn all characters in this string into their lower-case equivalent.
- Returns
- A reference to *this.
| String& trippingcyril::String::MakeUpper |
( |
| ) |
|
Turn all characters in this string into their upper-case equivalent.
- Returns
- A reference to *this.
| bool trippingcyril::String::OnlyContains |
( |
const String & |
characters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_-" | ) |
const |
Check if the string is formed with only the characters provided
- Returns
- False if a character not listed in the parameter is found
| trippingcyril::String::operator bool |
( |
| ) |
const |
|
inline |
- Returns
- True if this string is not "false".
| trippingcyril::String::operator double |
( |
| ) |
const |
|
inline |
- Returns
- The numerical value of this string similar to atoi().
| trippingcyril::String::operator float |
( |
| ) |
const |
|
inline |
- Returns
- The numerical value of this string similar to atoi().
| trippingcyril::String::operator int32_t |
( |
| ) |
const |
|
inline |
- Returns
- The numerical value of this string similar to atoi().
| trippingcyril::String::operator int64_t |
( |
| ) |
const |
|
inline |
- Returns
- The numerical value of this string similar to atoi().
| trippingcyril::String::operator short |
( |
| ) |
const |
|
inline |
- Returns
- The numerical value of this string similar to atoi().
| trippingcyril::String::operator uint32_t |
( |
| ) |
const |
|
inline |
- Returns
- The numerical value of this string similar to atoi().
| trippingcyril::String::operator uint64_t |
( |
| ) |
const |
|
inline |
- Returns
- The numerical value of this string similar to atoi().
| trippingcyril::String::operator unsigned short |
( |
| ) |
const |
|
inline |
- Returns
- The numerical value of this string similar to atoi().
| String trippingcyril::String::SHA1 |
( |
bool |
raw = false | ) |
const |
Returns a SHA1 hash of this string
- Parameters
-
| raw | If true it'll return the raw unencoded hash, probably not printable |
| String trippingcyril::String::SHA256 |
( |
bool |
raw = false | ) |
const |
Returns a SHA256 hash of this string
- Parameters
-
| raw | If true it'll return the raw unencoded hash, probably not printable |
| String trippingcyril::String::SHA512 |
( |
bool |
raw = false | ) |
const |
Returns a SHA512 hash of this string
- Parameters
-
| raw | If true it'll return the raw unencoded hash, probably not printable |
| bool trippingcyril::String::ToBool |
( |
| ) |
const |
- Returns
- True if this string is not "false".
| static String trippingcyril::String::ToByteStr |
( |
unsigned long long |
d | ) |
|
|
static |
Pretty-print a number of bytes.
- Parameters
-
- Returns
- A string describing the number of bytes.
| double trippingcyril::String::ToDouble |
( |
| ) |
const |
- Returns
- The numerical value of this string similar to atoi().
| float trippingcyril::String::ToFloat |
( |
| ) |
const |
- Returns
- The numerical value of this string similar to atoi().
| int trippingcyril::String::ToInt |
( |
unsigned int |
base = 10 | ) |
const |
- Returns
- The numerical value of this string similar to atoi().
| int32_t trippingcyril::String::ToInt32 |
( |
| ) |
const |
|
inline |
- Returns
- The numerical value of this string similar to atoi().
| int64_t trippingcyril::String::ToInt64 |
( |
| ) |
const |
|
inline |
- Returns
- The numerical value of this string similar to atoi().
| long trippingcyril::String::ToLong |
( |
unsigned int |
base = 10 | ) |
const |
- Returns
- The numerical value of this string similar to atoi().
| long long trippingcyril::String::ToLongLong |
( |
unsigned int |
base = 10 | ) |
const |
- Returns
- The numerical value of this string similar to atoi().
| static String trippingcyril::String::ToPercent |
( |
double |
d | ) |
|
|
static |
Pretty-print a percent value.
- Parameters
-
| d | The percent value. This should be in range 0-100. |
- Returns
- The "pretty" string.
| short trippingcyril::String::ToShort |
( |
unsigned int |
base = 10 | ) |
const |
- Returns
- The numerical value of this string similar to atoi().
| unsigned int trippingcyril::String::ToUInt |
( |
unsigned int |
base = 10 | ) |
const |
- Returns
- The numerical value of this string similar to atoi().
| uint32_t trippingcyril::String::ToUInt32 |
( |
| ) |
const |
|
inline |
- Returns
- The numerical value of this string similar to atoi().
| uint64_t trippingcyril::String::ToUInt64 |
( |
| ) |
const |
|
inline |
- Returns
- The numerical value of this string similar to atoi().
| unsigned long trippingcyril::String::ToULong |
( |
unsigned int |
base = 10 | ) |
const |
- Returns
- The numerical value of this string similar to atoi().
| unsigned long long trippingcyril::String::ToULongLong |
( |
unsigned int |
base = 10 | ) |
const |
- Returns
- The numerical value of this string similar to atoi().
| unsigned short trippingcyril::String::ToUShort |
( |
unsigned int |
base = 10 | ) |
const |
- Returns
- The numerical value of this string similar to atoi().
| bool trippingcyril::String::Trim |
( |
const String & |
to_trim = " \t\r\n" | ) |
|
Trim this string, all leading occurences of characters to_trim are removed.
- Parameters
-
| to_trim | A list of characters that should be trimmed. |
- Returns
- true if this string as modified.
| bool trippingcyril::String::TrimLeft |
( |
const String & |
to_trim = " \t\r\n" | ) |
|
Trim this string, all leading occurences of characters to_trim are removed.
- Parameters
-
| to_trim | A list of characters that should be trimmed. |
- Returns
- true if this string as modified.
| bool trippingcyril::String::TrimRight |
( |
const String & |
to_trim = " \t\r\n" | ) |
|
Trim this string, all leading occurences of characters to_trim are removed.
- Parameters
-
| to_trim | A list of characters that should be trimmed. |
- Returns
- true if this string as modified.
| bool trippingcyril::String::WildCmp |
( |
const String & |
wild | ) |
const |
Do a wildcard comparison on this string. Where "*" will match any number of characters and "?" will match a single character. For example String("I_am@~bar@foo").WildCmp("*!?bar@foo") would return true.
- Parameters
-
| wild | The wildcard to use for this comparison |
- Returns
- true if the wildcard matches
The documentation for this class was generated from the following file: