Public Types | Public Member Functions | Static Public Member Functions | List of all members
String Class Reference
Inheritance diagram for String:
Vector< CharType >

Public Types

enum  { npos =-1 }
 

Public Member Functions

bool operator== (const String &p_str) const
 
bool operator!= (const String &p_str) const
 
String operator+ (const String &p_str) const
 
Stringoperator+= (const String &)
 
Stringoperator+= (CharType p_str)
 
Stringoperator+= (const char *p_str)
 
Stringoperator+= (const CharType *p_str)
 
void operator= (const char *p_str)
 
void operator= (const CharType *p_str)
 
bool operator== (const char *p_str) const
 
bool operator== (const CharType *p_str) const
 
bool operator== (const StrRange &p_str_range) const
 
bool operator!= (const char *p_str) const
 
bool operator!= (const CharType *p_str) const
 
bool operator< (const CharType *p_str) const
 
bool operator< (const char *p_str) const
 
bool operator< (String p_str) const
 
bool operator<= (String p_str) const
 
signed char casecmp_to (const String &p_str) const
 
signed char nocasecmp_to (const String &p_str) const
 
const CharType * c_str () const
 
int length () const
 
String substr (int p_from, int p_chars) const
 
int find (String p_str, int p_from=0) const
 return <0 if failed
 
int find_last (String p_str) const
 return <0 if failed
 
int findn (String p_str, int p_from=0) const
 return <0 if failed, case insensitive
 
int rfind (String p_str, int p_from=-1) const
 return <0 if failed
 
int rfindn (String p_str, int p_from=-1) const
 return <0 if failed, case insensitive
 
int findmk (const Vector< String > &p_keys, int p_from=0, int *r_key=NULL) const
 return <0 if failed
 
bool match (const String &p_wildcard) const
 
bool matchn (const String &p_wildcard) const
 
bool begins_with (const String &p_string) const
 
bool begins_with (const char *p_string) const
 
bool ends_with (const String &p_string) const
 
String replace_first (String p_key, String p_with) const
 
String replace (String p_key, String p_with) const
 
String replacen (String p_key, String p_with) const
 
String insert (int p_at_pos, String p_string) const
 
String pad_decimals (int p_digits) const
 
String pad_zeros (int p_digits) const
 
String lpad (int min_length, const String &character=" ") const
 
String rpad (int min_length, const String &character=" ") const
 
String sprintf (const Array &values, bool *error) const
 
bool is_numeric () const
 
double to_double () const
 
float to_float () const
 
int hex_to_int () const
 
int to_int () const
 
int64_t to_int64 () const
 
String capitalize () const
 
String camelcase_to_underscore (bool lowercase=true) const
 
int get_slice_count (String p_splitter) const
 
String get_slice (String p_splitter, int p_slice) const
 
String get_slicec (CharType splitter, int p_slice) const
 
Vector< Stringsplit (const String &p_splitter, bool p_allow_empty=true) const
 
Vector< Stringsplit_spaces () const
 
Vector< float > split_floats (const String &p_splitter, bool p_allow_empty=true) const
 
Vector< float > split_floats_mk (const Vector< String > &p_splitters, bool p_allow_empty=true) const
 
Vector< int > split_ints (const String &p_splitter, bool p_allow_empty=true) const
 
Vector< int > split_ints_mk (const Vector< String > &p_splitters, bool p_allow_empty=true) const
 
String to_upper () const
 
String to_lower () const
 
String left (int p_pos) const
 
String right (int p_pos) const
 
String strip_edges (bool left=true, bool right=true) const
 
String strip_escapes () const
 
String extension () const
 
String basename () const
 
String plus_file (const String &p_file) const
 
CharType ord_at (int p_idx) const
 
void erase (int p_pos, int p_chars)
 
CharString ascii (bool p_allow_extended=false) const
 
CharString utf8 () const
 
bool parse_utf8 (const char *p_utf8, int p_len=-1)
 
uint32_t hash () const
 
uint64_t hash64 () const
 
String md5_text () const
 
Vector< uint8_t > md5_buffer () const
 
bool empty () const
 
bool is_abs_path () const
 
bool is_rel_path () const
 
bool is_resource_file () const
 
String path_to (const String &p_path) const
 
String path_to_file (const String &p_path) const
 
String get_base_dir () const
 
String get_file () const
 
String simplify_path () const
 
String xml_escape (bool p_escape_quotes=false) const
 
String xml_unescape () const
 
String http_escape () const
 
String http_unescape () const
 
String c_escape () const
 
String c_unescape () const
 
String json_escape () const
 
String world_wrap (int p_chars_per_line) const
 
String percent_encode () const
 
String percent_decode () const
 
bool is_valid_identifier () const
 
bool is_valid_integer () const
 
bool is_valid_float () const
 
bool is_valid_html_color () const
 
bool is_valid_ip_address () const
 
 String ()
 
 String (const char *p_str)
 
 String (const CharType *p_str, int p_clip_to_len=-1)
 
 String (const StrRange &p_range)
 
- Public Member Functions inherited from Vector< CharType >
_FORCE_INLINE_ CharType * ptr ()
 
_FORCE_INLINE_ const CharType * ptr () const
 
_FORCE_INLINE_ void clear ()
 
_FORCE_INLINE_ int size () const
 
_FORCE_INLINE_ bool empty () const
 
Error resize (int p_size)
 
bool push_back (CharType p_elem)
 
void remove (int p_index)
 
void erase (const CharType &p_val)
 
void invert ()
 
int find (const T_val &p_val) const
 
void set (int p_index, CharType p_elem)
 
CharType get (int p_index) const
 
CharType & operator[] (int p_index)
 
const CharType & operator[] (int p_index) const
 
Error insert (int p_pos, const CharType &p_val)
 
void sort_custom ()
 
void sort ()
 
void ordered_insert (const CharType &p_val)
 
void operator= (const Vector &p_from)
 
 Vector (const Vector &p_from)
 

Static Public Member Functions

static String num (double p_num, int p_decimals=-1)
 
static String num_scientific (double p_num)
 
static String num_real (double p_num)
 
static String num_int64 (int64_t p_num, int base=10, bool capitalize_hex=false)
 
static String chr (CharType p_char)
 
static String md5 (const uint8_t *p_md5)
 
static int to_int (const char *p_str, int p_len=-1)
 
static double to_double (const char *p_str)
 
static double to_double (const CharType *p_str, const CharType **r_end=NULL)
 
static int64_t to_int (const CharType *p_str, int p_len=-1)
 
static CharType char_uppercase (CharType p_char)
 
static CharType char_lowercase (CharType p_char)
 
static String utf8 (const char *p_utf8, int p_len=-1)
 
static uint32_t hash (const CharType *p_str, int p_len)
 
static uint32_t hash (const CharType *p_str)
 
static uint32_t hash (const char *p_cstr, int p_len)
 
static uint32_t hash (const char *p_cstr)
 
static String humanize_size (size_t p_size)
 

Member Enumeration Documentation

anonymous enum
Enumerator
npos 

for "some" compatibility with std::string (npos is a huge value in std::string)

Constructor & Destructor Documentation

String::String ( )
inline

The constructors must not depend on other overloads

Member Function Documentation

int64_t String::to_int ( const CharType *  p_str,
int  p_len = -1 
)
static
Todo:
make more exact so saving and loading does not lose precision

The documentation for this class was generated from the following files: