36 #ifndef __CU_STRINGS_H_
37 #define __CU_STRINGS_H_
46 #pragma mark NUMBER TO STRING FUNCTIONS
56 std::string to_string(Uint8 value);
65 std::string to_string(Sint16 value);
74 std::string to_string(Uint16 value);
83 std::string to_string(Sint32 value);
92 std::string to_string(Uint32 value );
101 std::string to_string(Sint64 value );
110 std::string to_string(Uint64 value );
124 std::string to_string(
float value,
int precision=-1);
138 std::string to_string(
double value,
int precision=-1);
142 #pragma mark ARRAY TO STRING FUNCTIONS
154 std::string to_string(Uint8* array,
size_t length,
size_t offset=0);
167 std::string to_string(Sint16* array,
size_t length,
size_t offset=0);
180 std::string to_string(Uint16* array,
size_t length,
size_t offset=0);
193 std::string to_string(Sint32* array,
size_t length,
size_t offset=0);
206 std::string to_string(Uint32* array,
size_t length,
size_t offset=0);
219 std::string to_string(Sint64* array,
size_t length,
size_t offset=0);
232 std::string to_string(Uint64* array,
size_t length,
size_t offset=0);
249 std::string to_string(
float* array,
size_t length,
size_t offset=0,
int precision=-1);
266 std::string to_string(
double* array,
size_t length,
size_t offset=0,
int precision=-1);
270 #pragma mark STRING TO NUMBER FUNCTIONS
285 Uint8 stou8(
const std::string& str, std::size_t* pos = 0,
int base = 10);
301 Sint16 stos16(
const std::string& str, std::size_t* pos = 0,
int base = 10);
317 Uint16 stou16(
const std::string& str, std::size_t* pos = 0,
int base = 10);
333 Sint32 stos32(
const std::string& str, std::size_t* pos = 0,
int base = 10);
349 Uint32 stou32(
const std::string& str, std::size_t* pos = 0,
int base = 10);
365 Sint64 stos64(
const std::string& str, std::size_t* pos = 0,
int base = 10);
381 Uint64 stou64(
const std::string& str, std::size_t* pos = 0,
int base = 10);
396 float stof(
const std::string& str, std::size_t* pos = 0);
411 double stod(
const std::string& str, std::size_t* pos = 0);
415 #pragma mark UTILITY FUNCTIONS
425 std::string to_lower(
const std::string& str);
436 std::string to_upper(
const std::string& str);
447 std::string trim(
const std::string& str);
461 std::vector<std::string> split(
const std::string& str,
const std::string& sep);
475 std::vector<std::string> split(
const std::string& str,
const char* sep);
486 bool isalpha(
const std::string& str);
497 bool isalphanum(
const std::string& str);
508 bool isnumeric(
const std::string& str);
519 bool isnumber(
const std::string& str);