Rapicorn - Experimental UI Toolkit - Source Code  13.07.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Classes | Namespaces | Defines | Functions
strings.hh File Reference
#include <rcore/formatter.hh>
#include <string>
#include <cstring>

Go to the source code of this file.

Classes

class  Rapicorn::Strings
 Convenience Constructor for StringSeq or std::vector<std::string> More...

Namespaces

namespace  Rapicorn
 

The Rapicorn namespace encompasses core utilities and toolkit functionality.


Defines

#define CQUOTE(str)
 Produce a const char* string, wrapping str into C-style double quotes.
#define STRING_VECTOR_FROM_ARRAY(ConstCharArray)
 Create a Rapicorn::StringVector, from a const char* C-style array.
#define RAPICORN_STRING_VECTOR_FROM_ARRAY(ConstCharArray)
#define RAPICORN_CQUOTE(str)

Functions

const charRapicorn::rapicorn_gettext (const char *text)
bool Rapicorn::cstring_to_bool (const char *string, bool fallback)
template<class... Args>
String Rapicorn::string_format (const char *format, const Args &...args)
 Formatted printing ala printf() into a String, using the POSIX/C locale.
template<class... Args>
String Rapicorn::string_locale_format (const char *format, const Args &...args)
 Formatted printing ala printf() into a String, using the current locale.
String Rapicorn::string_vprintf (const char *format, va_list vargs)
 Formatted printing ala vprintf() into a String, using the POSIX/C locale.
String Rapicorn::string_locale_vprintf (const char *format, va_list vargs)
 Formatted printing like string_vprintf using the current locale.
String Rapicorn::string_multiply (const String &s, uint64 count)
 Reproduce a string s for count times.
String Rapicorn::string_canonify (const String &string, const String &valid_chars, const String &substitute)
 Enforce a canonical charset for a string.
String Rapicorn::string_set_a2z ()
 Returns a string containing all of a-z.
String Rapicorn::string_set_A2Z ()
 Returns a string containing all of A-Z.
String Rapicorn::string_set_ascii_alnum ()
 Returns a string containing all of 0-9, A-Z and a-z.
String Rapicorn::string_tolower (const String &str)
 Convert all string characters into Unicode lower case characters.
String Rapicorn::string_toupper (const String &str)
 Convert all string characters into Unicode upper case characters.
String Rapicorn::string_totitle (const String &str)
 Convert all string characters into Unicode title characters.
StringVector Rapicorn::string_split (const String &string, const String &splitter)
 Split a string, using splitter as delimiter.
String Rapicorn::string_join (const String &junctor, const StringVector &strvec)
 Join a number of strings.
bool Rapicorn::string_to_bool (const String &string, bool fallback)
 Interpret a string as boolean value.
String Rapicorn::string_from_bool (bool value)
 Convert a boolean value into a string.
uint64 Rapicorn::string_to_uint (const String &string, uint base)
 Parse a string into a 64bit unsigned integer, optionally specifying the expected number base.
String Rapicorn::string_from_uint (uint64 value)
 Convert a 64bit unsigned integer into a string.
bool Rapicorn::string_has_int (const String &string)
 Checks if a string contains a digit, optionally preceeded by whitespaces.
int64 Rapicorn::string_to_int (const String &string, uint base)
 Parse a string into a 64bit integer, optionally specifying the expected number base.
String Rapicorn::string_from_int (int64 value)
 Convert a 64bit signed integer into a string.
String Rapicorn::string_from_float (float value)
 Convert a float into a string, using the POSIX/C locale.
double Rapicorn::string_to_double (const String &string)
 Parse a double from a string, trying locale specific characters and POSIX/C formatting.
double Rapicorn::string_to_double (const char *dblstring, const char **endptr)
 Similar to string_to_double(const String&), but returns the first failing character position in endptr.
String Rapicorn::string_from_double (double value)
 Convert a double into a string, using the POSIX/C locale.
String Rapicorn::string_from_float (double value)
double Rapicorn::string_to_float (const String &string)
template<typename Type >
Type Rapicorn::string_to_type (const String &string)
template<typename Type >
String Rapicorn::string_from_type (Type value)
template<>
double Rapicorn::string_to_type< double > (const String &string)
template<>
String Rapicorn::string_from_type< double > (double value)
template<>
float Rapicorn::string_to_type< float > (const String &string)
template<>
String Rapicorn::string_from_type< float > (float value)
template<>
bool Rapicorn::string_to_type< bool > (const String &string)
template<>
String Rapicorn::string_from_type< bool > (bool value)
template<>
int16 Rapicorn::string_to_type< int16 > (const String &string)
template<>
String Rapicorn::string_from_type< int16 > (int16 value)
template<>
uint16 Rapicorn::string_to_type< uint16 > (const String &string)
template<>
String Rapicorn::string_from_type< uint16 > (uint16 value)
template<>
int Rapicorn::string_to_type< int > (const String &string)
template<>
String Rapicorn::string_from_type< int > (int value)
template<>
uint Rapicorn::string_to_type< uint > (const String &string)
template<>
String Rapicorn::string_from_type< uint > (uint value)
template<>
int64 Rapicorn::string_to_type< int64 > (const String &string)
template<>
String Rapicorn::string_from_type< int64 > (int64 value)
template<>
uint64 Rapicorn::string_to_type< uint64 > (const String &string)
template<>
String Rapicorn::string_from_type< uint64 > (uint64 value)
template<>
String Rapicorn::string_to_type< String > (const String &string)
template<>
String Rapicorn::string_from_type< String > (String value)
vector< doubleRapicorn::string_to_double_vector (const String &string)
 Parse a string into a list of doubles, expects ';' as delimiter.
String Rapicorn::string_from_double_vector (const vector< double > &dvec, const String &delim)
 Construct a string out of all double values passed in dvec, separated by delim.
String Rapicorn::string_from_errno (int errno_val)
 Returns a String describing the passed in errno value, similar to strerror().
bool Rapicorn::string_is_uuid (const String &uuid_string)
 Returns whether uuid_string contains a properly formatted UUID string.
int Rapicorn::string_cmp_uuid (const String &uuid_string1, const String &uuid_string2)
 Returns whether uuid_string1 compares smaller (-1), equal (0) or greater (+1) to uuid_string2.
bool Rapicorn::string_startswith (const String &string, const String &fragment)
 Returns whether string starts with fragment.
bool Rapicorn::string_endswith (const String &string, const String &fragment)
 Returns whether string ends with fragment.
bool Rapicorn::string_match_identifier (const String &ident1, const String &ident2)
 Check equality of strings canonicalized to "[0-9a-z_]+".
bool Rapicorn::string_match_identifier_tail (const String &ident, const String &tail)
 Variant of string_match_identifier() that matches tail against ident at word boundary.
String Rapicorn::string_from_pretty_function_name (const char *gnuc_pretty_function)
 Extract the full function name from __PRETTY_FUNCTION__.
String Rapicorn::string_to_cescape (const String &str)
 Escape text like a C string.
String Rapicorn::string_to_cquote (const String &str)
 Returns a string as C string including double quotes.
String Rapicorn::string_from_cquote (const String &input)
 Parse a possibly quoted C string into regular string.
String Rapicorn::string_hexdump (const void *addr, size_t length, size_t initial_offset)
 Produce hexdump of a memory region.
String Rapicorn::string_lstrip (const String &input)
 Strip whitespaces from the left of a string.
String Rapicorn::string_rstrip (const String &input)
 Strip whitespaces from the right of a string.
String Rapicorn::string_strip (const String &input)
 Strip whitespaces from the left and right of a string.
String Rapicorn::string_substitute_char (const String &input, const char match, const char subst)
 Replace all occouranes of match in input with subst.
String Rapicorn::string_vector_find (const StringVector &svector, const String &key, const String &fallback)
 Search for key in svector and return reminder of the matching string.
StringVector Rapicorn::cstrings_to_vector (const char *s,...)
 Construct a StringVector from a NULL terminated list of string arguments.
void Rapicorn::memset4 (uint32 *mem, uint32 filler, uint length)
 Fill a memory area with a 32-bit quantitiy.
long double Rapicorn::posix_locale_strtold (const char *nptr, char **endptr)
 Parse a double from a string ala strtod(), trying locale specific characters and POSIX/C formatting.
long double Rapicorn::current_locale_strtold (const char *nptr, char **endptr)
 Parse a double from a string ala strtod(), trying locale specific characters and POSIX/C formatting.
bool Rapicorn::string_option_check (const String &option_string, const String &option)
 Check if an option is set/unset in an options list string.
String Rapicorn::string_option_get (const String &option_string, const String &option)
 Retrieve the option value from an options list separated by ':' or ';'.
void Rapicorn::string_options_split (const String &option_string, vector< String > &option_names, vector< String > &option_values, const String &empty_default)
 Split an option list string into name/value pairs.
bool Rapicorn::text_convert (const String &to_charset, String &output_string, const String &from_charset, const String &input_string, const String &fallback_charset, const String &output_mark)
 Convert a string from one encoding to another.
const charRapicorn::strerror ()

Detailed Description

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines