Lolly 1.4.28
|
Classes | |
class | lolly_tree |
class | lolly_tree_rep |
class | string_u16 |
class | string_u16_rep |
class | string_view |
Typedefs | |
using | string_u16_view = lolly::data::string_view<char16_t> |
Functions | |
static string | encode_base64 (char c1, char c2, char c3) |
string | encode_base64 (string s) |
string | decode_base64 (array< int > ac) |
string | decode_base64 (string s) |
template<typename T > | |
int | N (lolly_tree< T > t) |
template<typename T > | |
int | arity (lolly_tree< T > t) |
template<typename T > | |
array< lolly_tree< T > > | A (lolly_tree< T > t) |
template<typename T > | |
array< lolly_tree< T > > & | AR (lolly_tree< T > t) |
template<typename T > | |
bool | is_atomic (lolly_tree< T > t) |
template<typename T > | |
bool | is_compound (lolly_tree< T > t) |
template<typename T > | |
bool | is_generic (lolly_tree< T > t) |
template<typename T > | |
bool | operator== (lolly_tree< T > t, int lab) |
template<typename T > | |
bool | operator!= (lolly_tree< T > t, int lab) |
template<typename T > | |
bool | operator== (lolly_tree< T > t, string s) |
template<typename T > | |
bool | operator!= (lolly_tree< T > t, string s) |
template<typename T > | |
bool | operator== (lolly_tree< T > t, const char *s) |
template<typename T > | |
bool | operator!= (lolly_tree< T > t, const char *s) |
template<typename T > | |
bool | operator== (lolly_tree< T > t, lolly_tree< T > u) |
template<typename T > | |
bool | operator!= (lolly_tree< T > t, lolly_tree< T > u) |
template<typename T > | |
bool | strong_equal (lolly_tree< T > t, lolly_tree< T > u) |
template<typename T > | |
bool | is_func (lolly_tree< T > t, int l) |
template<typename T > | |
bool | is_func (lolly_tree< T > t, int l, int i) |
template<typename T > | |
bool | is_bool (lolly_tree< T > t) |
template<typename T > | |
bool | is_int (lolly_tree< T > t) |
template<typename T > | |
bool | is_double (lolly_tree< T > t) |
template<typename T > | |
bool | is_string (lolly_tree< T > t) |
template<typename T > | |
bool | as_bool (lolly_tree< T > t) |
template<typename T > | |
int | as_int (lolly_tree< T > t) |
template<typename T > | |
long int | as_long_int (lolly_tree< T > t) |
template<typename T > | |
double | as_double (lolly_tree< T > t) |
template<typename T > | |
string | to_string (lolly_tree< T > t) |
template<typename T > | |
lolly_tree< T > | copy (lolly_tree< T > t) |
template<typename T > | |
lolly_tree< T > | operator* (lolly_tree< T > t1, lolly_tree< T > t2) |
template<typename T > | |
lolly_tree< T > & | operator<< (lolly_tree< T > &t, lolly_tree< T > t2) |
template<typename T > | |
lolly_tree< T > & | operator<< (lolly_tree< T > &t, array< lolly_tree< T > > a) |
template<typename T > | |
tm_ostream & | operator<< (tm_ostream &out, lolly_tree< T > t) |
string | to_roman (int32_t nr) |
Generates a Roman numeral string for an integer. | |
string | to_Roman (int32_t nr) |
Generates an uppercase Roman numeral string for an integer. | |
string | hanzi_sub (int16_t nr, bool leading_zero) |
string | to_hanzi (int32_t nr) |
Generates a Chinese numeral for a given integer. | |
string | to_padded_Hex (uint8_t i) |
string | to_padded_hex (uint8_t i) |
Converts an 8-bit unsigned integer to a fixed-length (2) hex string. | |
template<typename T > | |
std::enable_if_t< std::conjunction_v< std::is_integral< T >, std::is_unsigned< T > >, void > | to_Hex_positive (T i, string &s) |
Handle positive number separately to avoid unnecessary check of sign. string is passed into the function as reference, thus no reference counting is performed. | |
string | to_Hex (int32_t i) |
string | to_hex (int32_t i) |
string | to_Hex (pointer ptr) |
string | to_hex (pointer ptr) |
Converts a pointer to a hexadecimal string. | |
int | from_hex (string s) |
Converts a hexadecimal string to an integer. | |
template<unsigned int cur, typename T > | |
std::enable_if_t< std::conjunction_v< std::is_integral< T >, std::is_unsigned< T > >, void > | as_hexadecimal_sub (T i, string &s) |
Handle positive number separately to avoid unnecessary check of sign. string is passed into the function as reference, thus no reference counting is performed. Because length of string s is known here, use index instead of appending operator can avoid cost of reallocation. Firstly a string of given length is constructed, then digits is filled according to index rather than appending to the tail. | |
string | as_hexadecimal (int i, int length) |
Converts an unsigned integer to a hexadecimal string with a fixed length. | |
string | uint32_to_Hex (uint32_t i) |
Converts an unsigned integer to a hexadecimal string. | |
string | binary_to_hexadecimal (string bin) |
Converts a binary stream to its hexadecimal represention. | |
string | to_hex (int i) |
Converts an integer to a hexadecimal string. | |
string | to_Hex (int i) |
static constexpr int | round_length (int n) |
string_u16 | copy (const string_u16_view &a) |
string_u16 | copy (string_u16 a) |
string_u16 & | operator<< (string_u16 &a, char16_t ch) |
string_u16 & | operator<< (string_u16 &a, string_u16 b) |
string_u16 | operator* (string_u16 a, const string_u16_view &b) |
CONCRETE_CODE (string_u16) | |
int | N (string_u16 a) |
int | hash (string_u16 s) |
bool | operator== (string_u16 a, string_u16 b) |
bool | operator== (string_u16 a, string_u16_view b) |
bool | operator== (string_u16_view a, string_u16 b) |
template<size_t Nb> | |
bool | operator== (string_u16 a, const char16_t(&b)[Nb]) |
template<size_t Na> | |
bool | operator== (const char16_t(&a)[Na], string_u16 b) |
bool | operator!= (string_u16 a, string_u16 b) |
bool | operator!= (string_u16 a, string_u16_view b) |
bool | operator!= (string_u16_view a, string_u16 b) |
template<size_t Nb> | |
bool | operator!= (string_u16 a, const char16_t(&b)[Nb]) |
template<size_t Na> | |
bool | operator!= (const char16_t(&a)[Na], string_u16 b) |
bool | operator< (string_u16 a, string_u16 b) |
bool | operator<= (string_u16 a, string_u16 b) |
template<typename T > | |
bool | operator== (const string_view< T > &a, const string_view< T > &b) |
template<typename T , size_t Na> | |
bool | operator== (const T(&a)[Na], const string_view< T > &b) |
template<typename T , size_t Nb> | |
bool | operator== (const string_view< T > &a, const T(&b)[Nb]) |
template<typename T > | |
bool | operator!= (const string_view< T > &a, const string_view< T > &b) |
template<typename T , size_t Nb> | |
bool | operator!= (const string_view< T > &a, const T(&b)[Nb]) |
template<typename T , size_t Na> | |
bool | operator!= (const T(&a)[Na], const string_view< T > &b) |
template<typename T > | |
bool | operator< (const string_view< T > &a, const string_view< T > &b) |
template<typename T , size_t Nb> | |
bool | operator< (const string_view< T > &a, const T(&b)[Nb]) |
template<typename T , size_t Na> | |
bool | operator< (const T(&a)[Na], const string_view< T > &b) |
template<typename T > | |
bool | operator<= (const string_view< T > &a, const string_view< T > &b) |
template<typename T , size_t Nb> | |
bool | operator<= (const string_view< T > &a, const T(&b)[Nb]) |
template<typename T , size_t Na> | |
bool | operator<= (const T(&a)[Na], const string_view< T > &b) |
string_u8 | encode_as_utf8 (uint32_t code) |
Encode 4 bytes as string_u8. | |
uint32_t | decode_from_utf8 (string_u8 s, int &i) |
Decode string_u8 string as 4 bytes at position i. | |
string | unicode_get_range (int code) |
bool | is_cjk_unified_ideographs (string s) |
Checks if a string contains only CJK Unified Ideographs. | |
bool | has_cjk_unified_ideographs (string s) |
Checks if a string contains any CJK Unified Ideographs. | |
string | utf16_to_utf8 (string s_u16) |
Convert UTF-16 string to UTF-8 string. | |
string | utf8_to_utf16 (string s_u8) |
Convert UTF-8 string to UTF-16 string. | |
string | uri_host (url u) |
string | uri_path (url u) |
Variables | |
static const char | int_to_b64 [] |
static const char | b64_to_int [] |
static const string | roman_ones [10] |
static const string | roman_tens [10] |
static const string | roman_hundreds [10] |
static const string | roman_thousands [4] = {"", "m", "mm", "mmm"} |
static const string | chars_han [10] |
static const char * | hex_string = "0123456789ABCDEF" |
Definition at line 19 of file string_u16.hpp.
Definition at line 24 of file base64.cpp.
Definition at line 41 of file base64.cpp.
Definition at line 67 of file base64.cpp.
Definition at line 84 of file base64.cpp.
|
inline |
Definition at line 165 of file lolly_tree.hpp.
|
inline |
Definition at line 172 of file lolly_tree.hpp.
|
inline |
Definition at line 179 of file lolly_tree.hpp.
|
inline |
Definition at line 186 of file lolly_tree.hpp.
|
inline |
Definition at line 193 of file lolly_tree.hpp.
|
inline |
Definition at line 199 of file lolly_tree.hpp.
|
inline |
Definition at line 205 of file lolly_tree.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 223 of file lolly_tree.hpp.
|
inline |
Definition at line 229 of file lolly_tree.hpp.
|
inline |
Definition at line 235 of file lolly_tree.hpp.
|
inline |
Definition at line 241 of file lolly_tree.hpp.
|
inline |
Definition at line 247 of file lolly_tree.hpp.
|
inline |
|
inline |
Definition at line 263 of file lolly_tree.hpp.
|
inline |
Definition at line 269 of file lolly_tree.hpp.
|
inline |
Definition at line 275 of file lolly_tree.hpp.
|
inline |
Definition at line 281 of file lolly_tree.hpp.
|
inline |
Definition at line 287 of file lolly_tree.hpp.
|
inline |
Definition at line 293 of file lolly_tree.hpp.
|
inline |
Definition at line 299 of file lolly_tree.hpp.
|
inline |
Definition at line 305 of file lolly_tree.hpp.
|
inline |
Definition at line 312 of file lolly_tree.hpp.
|
inline |
Definition at line 319 of file lolly_tree.hpp.
|
inline |
Definition at line 326 of file lolly_tree.hpp.
|
inline |
Definition at line 333 of file lolly_tree.hpp.
|
inline |
Definition at line 389 of file lolly_tree.hpp.
|
inline |
Definition at line 342 of file lolly_tree.hpp.
|
inline |
Definition at line 342 of file lolly_tree.hpp.
|
inline |
Definition at line 342 of file lolly_tree.hpp.
|
inline |
Definition at line 371 of file lolly_tree.hpp.
Generates a Roman numeral string for an integer.
nr | The integer to be converted to Roman numeral. |
Definition at line 34 of file numeral.cpp.
Generates an uppercase Roman numeral string for an integer.
nr | The integer to be converted to Roman numeral. |
Definition at line 43 of file numeral.cpp.
Definition at line 48 of file numeral.cpp.
Generates a Chinese numeral for a given integer.
nr | The integer to be converted to a Chinese numeral. |
Definition at line 130 of file numeral.cpp.
Converts an 8-bit unsigned integer to a fixed-length (2) hex string.
i | The integer to be converted to a fixed-length hex string. |
Definition at line 153 of file numeral.cpp.
std::enable_if_t< std::conjunction_v< std::is_integral< T >, std::is_unsigned< T > >, void > lolly::data::to_Hex_positive | ( | T | i, |
string & | s ) |
Handle positive number separately to avoid unnecessary check of sign. string is passed into the function as reference, thus no reference counting is performed.
T | unsigned integral type is expected. |
Definition at line 166 of file numeral.cpp.
Definition at line 174 of file numeral.cpp.
Definition at line 189 of file numeral.cpp.
Definition at line 194 of file numeral.cpp.
Converts a pointer to a hexadecimal string.
ptr | The pointer to be converted to a hexadecimal string. |
Definition at line 209 of file numeral.cpp.
int lolly::data::from_hex | ( | string | s | ) |
Converts a hexadecimal string to an integer.
This function takes a hexadecimal string as input and converts it into its integer representation.
s | The hexadecimal string to be converted to an integer. |
Definition at line 214 of file numeral.cpp.
std::enable_if_t< std::conjunction_v< std::is_integral< T >, std::is_unsigned< T > >, void > lolly::data::as_hexadecimal_sub | ( | T | i, |
string & | s ) |
Handle positive number separately to avoid unnecessary check of sign. string is passed into the function as reference, thus no reference counting is performed. Because length of string s is known here, use index instead of appending operator can avoid cost of reallocation. Firstly a string of given length is constructed, then digits is filled according to index rather than appending to the tail.
T | unsigned integral type is expected. |
Definition at line 239 of file numeral.cpp.
string lolly::data::as_hexadecimal | ( | int | i, |
int | length ) |
Converts an unsigned integer to a hexadecimal string with a fixed length.
i | The integer to be converted to a hexadecimal string. |
len | The length of the output hexadecimal string. |
Definition at line 247 of file numeral.cpp.
Converts an unsigned integer to a hexadecimal string.
i | The integer to be converted to a hexadecimal string. |
Definition at line 306 of file numeral.cpp.
Converts a binary stream to its hexadecimal represention.
bin | The binary data to be converted to a hexadecimal string. |
Definition at line 313 of file numeral.cpp.
string lolly::data::to_hex | ( | int | i | ) |
Converts an integer to a hexadecimal string.
i | The integer to be converted to a hexadecimal string. |
string lolly::data::to_Hex | ( | int | i | ) |
Definition at line 17 of file string_u16.cpp.
string_u16 lolly::data::copy | ( | const string_u16_view & | a | ) |
Definition at line 100 of file string_u16.cpp.
string_u16 lolly::data::copy | ( | string_u16 | a | ) |
Definition at line 109 of file string_u16.cpp.
string_u16 & lolly::data::operator<< | ( | string_u16 & | a, |
char16_t | ch ) |
Definition at line 113 of file string_u16.cpp.
string_u16 & lolly::data::operator<< | ( | string_u16 & | a, |
string_u16 | b ) |
string_u16 lolly::data::operator* | ( | string_u16 | a, |
const string_u16_view & | b ) |
lolly::data::CONCRETE_CODE | ( | string_u16 | ) |
|
inline |
Definition at line 98 of file string_u16.hpp.
|
inline |
Definition at line 103 of file string_u16.hpp.
|
inline |
Definition at line 113 of file string_u16.hpp.
|
inline |
Definition at line 118 of file string_u16.hpp.
|
inline |
Definition at line 123 of file string_u16.hpp.
bool lolly::data::operator== | ( | string_u16 | a, |
const char16_t(&) | b[Nb] ) |
Definition at line 129 of file string_u16.hpp.
bool lolly::data::operator== | ( | const char16_t(&) | a[Na], |
string_u16 | b ) |
Definition at line 135 of file string_u16.hpp.
|
inline |
Definition at line 140 of file string_u16.hpp.
|
inline |
Definition at line 145 of file string_u16.hpp.
|
inline |
Definition at line 150 of file string_u16.hpp.
bool lolly::data::operator!= | ( | string_u16 | a, |
const char16_t(&) | b[Nb] ) |
Definition at line 156 of file string_u16.hpp.
bool lolly::data::operator!= | ( | const char16_t(&) | a[Na], |
string_u16 | b ) |
Definition at line 162 of file string_u16.hpp.
|
inline |
Definition at line 166 of file string_u16.hpp.
|
inline |
Definition at line 171 of file string_u16.hpp.
bool lolly::data::operator== | ( | const string_view< T > & | a, |
const string_view< T > & | b ) |
bool lolly::data::operator== | ( | const T(&) | a[Na], |
const string_view< T > & | b ) |
Definition at line 81 of file string_view.hpp.
bool lolly::data::operator== | ( | const string_view< T > & | a, |
const T(&) | b[Nb] ) |
Definition at line 87 of file string_view.hpp.
bool lolly::data::operator!= | ( | const string_view< T > & | a, |
const string_view< T > & | b ) |
bool lolly::data::operator!= | ( | const string_view< T > & | a, |
const T(&) | b[Nb] ) |
Definition at line 104 of file string_view.hpp.
bool lolly::data::operator!= | ( | const T(&) | a[Na], |
const string_view< T > & | b ) |
Definition at line 110 of file string_view.hpp.
bool lolly::data::operator< | ( | const string_view< T > & | a, |
const string_view< T > & | b ) |
Definition at line 115 of file string_view.hpp.
bool lolly::data::operator< | ( | const string_view< T > & | a, |
const T(&) | b[Nb] ) |
Definition at line 127 of file string_view.hpp.
bool lolly::data::operator< | ( | const T(&) | a[Na], |
const string_view< T > & | b ) |
Definition at line 133 of file string_view.hpp.
bool lolly::data::operator<= | ( | const string_view< T > & | a, |
const string_view< T > & | b ) |
bool lolly::data::operator<= | ( | const string_view< T > & | a, |
const T(&) | b[Nb] ) |
Definition at line 151 of file string_view.hpp.
bool lolly::data::operator<= | ( | const T(&) | a[Na], |
const string_view< T > & | b ) |
Definition at line 157 of file string_view.hpp.
Encode 4 bytes as string_u8.
code | The 4 bytes to encode |
Definition at line 19 of file unicode.cpp.
Decode string_u8 string as 4 bytes at position i.
s | The string_u8 string |
i | The position |
Definition at line 52 of file unicode.cpp.
string lolly::data::unicode_get_range | ( | int | code | ) |
Definition at line 99 of file unicode.cpp.
bool lolly::data::is_cjk_unified_ideographs | ( | string | s | ) |
Checks if a string contains only CJK Unified Ideographs.
s | The string to check. |
Definition at line 117 of file unicode.cpp.
bool lolly::data::has_cjk_unified_ideographs | ( | string | s | ) |
Checks if a string contains any CJK Unified Ideographs.
s | The string to check. |
Definition at line 136 of file unicode.cpp.
Convert UTF-16 string to UTF-8 string.
s_u16 | the string using the UTF-16 encoding |
Definition at line 155 of file unicode.cpp.
Convert UTF-8 string to UTF-16 string.
s_u8 | the string using the UTF-8 encoding |
Definition at line 208 of file unicode.cpp.
Definition at line 20 of file base64.cpp.
Definition at line 62 of file base64.cpp.
Definition at line 18 of file numeral.cpp.
Definition at line 20 of file numeral.cpp.
Definition at line 22 of file numeral.cpp.
Definition at line 24 of file numeral.cpp.
Definition at line 28 of file numeral.cpp.
Definition at line 31 of file numeral.cpp.