#include <character.hh>
Public Member Functions | |
| character (void) | |
| Initializes internal tables. | |
| ~character (void) | |
| Destructor of the initializer. | |
Static Public Member Functions | |
| static ucn | create_internal (ulint code) |
| Returns internal character set ucn. | |
| static ucn | create_from_host (hchar c) |
| Returns internal ucn from host character. | |
| static ucn | create_external (ulint code) |
| Returns external character set ucn. | |
| static ucn | create_xdigit (ulint digit) |
| Returns internal character set ucn from hexadecimal digit. | |
| static bool | is_internal (ucn u) |
| Tests if value is internal character. | |
| static bool | is_external (ucn u) |
| Tests if value is external character. | |
| static bool | is_basic (ucn u) |
| Tests if value is basic source character. | |
| static bool | is_translated (ucn u) |
| Tests if value is translated source character. | |
| static bool | is_ascii7 (ucn u) |
| Tests if value is 7 bit ASCII. | |
| static bool | is_alpha (ucn u) |
| Tests if value is ASCII letter. | |
| static bool | is_upper (ucn u) |
| Tests if value is ASCII uppercase letter. | |
| static bool | is_lower (ucn u) |
| Tests if value is ASCII lowercase letter. | |
| static bool | is_digit (ucn u) |
| Tests if value is ASCII digit. | |
| static bool | is_odigit (ucn u) |
| Tests if value is ASCII octal digit. | |
| static bool | is_xdigit (ucn u) |
| Tests if value is ASCII hexadecimal digit . | |
| static bool | is_space (ucn u) |
| Tests if value is ASCII space character . | |
| static bool | is_translated_identifier (ucn u) |
| Tests if value is translated C++ identifier character. | |
| static bool | is_encodable_host (ucn u) |
| Tests if value is host character encodable in ucn. | |
| static ucn | to_upper (ucn u) |
| Returns uppercase of ASCII letter. | |
| static ucn | to_lower (ucn u) |
| Returns lowercase of ASCII letter. | |
| static hchar | to_host (ucn u) |
| Returns host character. | |
| static ulint | extract_digit (ucn u) |
| Returns digit value. | |
| static ulint | extract_xdigit (ucn u) |
| Returns hexadecimal digit value. | |
| static ulint | extract_odigit (ucn u) |
| Returns hexadecimal digit value. | |
| static ulint | extract_value (ucn u) |
| Returns character value. | |
Static Public Attributes | |
| static const ucn | ascii_bell = static_cast<ucn>(0x07) |
| ASCII bell character. | |
| static const ucn | ascii_backspace = static_cast<ucn>(0x08) |
| ASCII backspace character. | |
| static const ucn | ascii_tab = static_cast<ucn>(0x09) |
| ASCII tabulator character. | |
| static const ucn | ascii_vtab = static_cast<ucn>(0x0B) |
| ASCII vertical tabulator character. | |
| static const ucn | ascii_form_feed = static_cast<ucn>(0x0C) |
| ASCII form feed character. | |
| static const ucn | ascii_new_line = static_cast<ucn>(0x0A) |
| ASCII new line character. | |
| static const ucn | ascii_carriage_return = static_cast<ucn>(0x0D) |
| ASCII carriage return character. | |
| static const ucn | ascii_space = static_cast<ucn>(0x20) |
| ASCII space character. | |
| static const ucn | ascii_emark = static_cast<ucn>(0x21) |
| ASCII exclamation mark character. | |
| static const ucn | ascii_dquote = static_cast<ucn>(0x22) |
| ASCII double quote character. | |
| static const ucn | ascii_hash = static_cast<ucn>(0x23) |
| ASCII hash character. | |
| static const ucn | ascii_dollar = static_cast<ucn>(0x24) |
| ASCII dollar character. | |
| static const ucn | ascii_percent = static_cast<ucn>(0x25) |
| ASCII percent character. | |
| static const ucn | ascii_amp = static_cast<ucn>(0x26) |
| ASCII ampersand character. | |
| static const ucn | ascii_quote = static_cast<ucn>(0x27) |
| ASCII quote character. | |
| static const ucn | ascii_left_par = static_cast<ucn>(0x28) |
| ASCII left parenthesis character. | |
| static const ucn | ascii_right_par = static_cast<ucn>(0x29) |
| ASCII right parenthesis character. | |
| static const ucn | ascii_star = static_cast<ucn>(0x2A) |
| ASCII star character. | |
| static const ucn | ascii_plus = static_cast<ucn>(0x2B) |
| ASCII plus character. | |
| static const ucn | ascii_comma = static_cast<ucn>(0x2C) |
| ASCII comma character. | |
| static const ucn | ascii_minus = static_cast<ucn>(0x2D) |
| ASCII minus character. | |
| static const ucn | ascii_dot = static_cast<ucn>(0x2E) |
| ASCII dot character. | |
| static const ucn | ascii_slash = static_cast<ucn>(0x2F) |
| ASCII slash character. | |
| static const ucn | ascii_digit_0 = static_cast<ucn>(0x30) |
| ASCII digit 0 character. | |
| static const ucn | ascii_digit_1 = static_cast<ucn>(0x31) |
| ASCII digit 1 character. | |
| static const ucn | ascii_digit_2 = static_cast<ucn>(0x32) |
| ASCII digit 2 character. | |
| static const ucn | ascii_digit_3 = static_cast<ucn>(0x33) |
| ASCII digit 3 character. | |
| static const ucn | ascii_digit_4 = static_cast<ucn>(0x34) |
| ASCII digit 4 character. | |
| static const ucn | ascii_digit_5 = static_cast<ucn>(0x35) |
| ASCII digit 5 character. | |
| static const ucn | ascii_digit_6 = static_cast<ucn>(0x36) |
| ASCII digit 6 character. | |
| static const ucn | ascii_digit_7 = static_cast<ucn>(0x37) |
| ASCII digit 7 character. | |
| static const ucn | ascii_digit_8 = static_cast<ucn>(0x38) |
| ASCII digit 8 character. | |
| static const ucn | ascii_digit_9 = static_cast<ucn>(0x39) |
| ASCII digit 9 character. | |
| static const ucn | ascii_colon = static_cast<ucn>(0x3A) |
| ASCII colon character. | |
| static const ucn | ascii_semicolon = static_cast<ucn>(0x3B) |
| ASCII semicolon character. | |
| static const ucn | ascii_lt = static_cast<ucn>(0x3C) |
| ASCII less than character. | |
| static const ucn | ascii_eq = static_cast<ucn>(0x3D) |
| ASCII equals character. | |
| static const ucn | ascii_gt = static_cast<ucn>(0x3E) |
| ASCII greater than character. | |
| static const ucn | ascii_qmark = static_cast<ucn>(0x3F) |
| ASCII question mark character. | |
| static const ucn | ascii_at = static_cast<ucn>(0x40) |
| ASCII commercial at character (zavinac). | |
| static const ucn | ascii_upper_a = static_cast<ucn>(0x41) |
| ASCII upper a character. | |
| static const ucn | ascii_upper_b = static_cast<ucn>(0x42) |
| ASCII upper b character. | |
| static const ucn | ascii_upper_c = static_cast<ucn>(0x43) |
| ASCII upper c character. | |
| static const ucn | ascii_upper_d = static_cast<ucn>(0x44) |
| ASCII upper d character. | |
| static const ucn | ascii_upper_e = static_cast<ucn>(0x45) |
| ASCII upper e character. | |
| static const ucn | ascii_upper_f = static_cast<ucn>(0x46) |
| ASCII upper f character. | |
| static const ucn | ascii_upper_g = static_cast<ucn>(0x47) |
| ASCII upper g character. | |
| static const ucn | ascii_upper_h = static_cast<ucn>(0x48) |
| ASCII upper h character. | |
| static const ucn | ascii_upper_i = static_cast<ucn>(0x49) |
| ASCII upper i character. | |
| static const ucn | ascii_upper_j = static_cast<ucn>(0x4A) |
| ASCII upper j character. | |
| static const ucn | ascii_upper_k = static_cast<ucn>(0x4B) |
| ASCII upper k character. | |
| static const ucn | ascii_upper_l = static_cast<ucn>(0x4C) |
| ASCII upper l character. | |
| static const ucn | ascii_upper_m = static_cast<ucn>(0x4D) |
| ASCII upper m character. | |
| static const ucn | ascii_upper_n = static_cast<ucn>(0x4E) |
| ASCII upper n character. | |
| static const ucn | ascii_upper_o = static_cast<ucn>(0x4F) |
| ASCII upper o character. | |
| static const ucn | ascii_upper_p = static_cast<ucn>(0x50) |
| ASCII upper p character. | |
| static const ucn | ascii_upper_q = static_cast<ucn>(0x51) |
| ASCII upper q character. | |
| static const ucn | ascii_upper_r = static_cast<ucn>(0x52) |
| ASCII upper r character. | |
| static const ucn | ascii_upper_s = static_cast<ucn>(0x53) |
| ASCII upper s character. | |
| static const ucn | ascii_upper_t = static_cast<ucn>(0x54) |
| ASCII upper t character. | |
| static const ucn | ascii_upper_u = static_cast<ucn>(0x55) |
| ASCII upper u character. | |
| static const ucn | ascii_upper_v = static_cast<ucn>(0x56) |
| ASCII upper v character. | |
| static const ucn | ascii_upper_w = static_cast<ucn>(0x57) |
| ASCII upper w character. | |
| static const ucn | ascii_upper_x = static_cast<ucn>(0x58) |
| ASCII upper x character. | |
| static const ucn | ascii_upper_y = static_cast<ucn>(0x59) |
| ASCII upper y character. | |
| static const ucn | ascii_upper_z = static_cast<ucn>(0x5A) |
| ASCII upper z character. | |
| static const ucn | ascii_left_bracket = static_cast<ucn>(0x5B) |
| ASCII left bracket character. | |
| static const ucn | ascii_backslash = static_cast<ucn>(0x5C) |
| ASCII backslash character. | |
| static const ucn | ascii_right_bracket = static_cast<ucn>(0x5D) |
| ASCII right bracket character. | |
| static const ucn | ascii_hat = static_cast<ucn>(0x5E) |
| ASCII hat character. | |
| static const ucn | ascii_underscore = static_cast<ucn>(0x5F) |
| ASCII underscore character. | |
| static const ucn | ascii_bquote = static_cast<ucn>(0x60) |
| ASCII back quote character. | |
| static const ucn | ascii_lower_a = static_cast<ucn>(0x61) |
| ASCII lower a character. | |
| static const ucn | ascii_lower_b = static_cast<ucn>(0x62) |
| ASCII lower b character. | |
| static const ucn | ascii_lower_c = static_cast<ucn>(0x63) |
| ASCII lower c character. | |
| static const ucn | ascii_lower_d = static_cast<ucn>(0x64) |
| ASCII lower d character. | |
| static const ucn | ascii_lower_e = static_cast<ucn>(0x65) |
| ASCII lower e character. | |
| static const ucn | ascii_lower_f = static_cast<ucn>(0x66) |
| ASCII lower f character. | |
| static const ucn | ascii_lower_g = static_cast<ucn>(0x67) |
| ASCII lower g character. | |
| static const ucn | ascii_lower_h = static_cast<ucn>(0x68) |
| ASCII lower h character. | |
| static const ucn | ascii_lower_i = static_cast<ucn>(0x69) |
| ASCII lower i character. | |
| static const ucn | ascii_lower_j = static_cast<ucn>(0x6A) |
| ASCII lower j character. | |
| static const ucn | ascii_lower_k = static_cast<ucn>(0x6B) |
| ASCII lower k character. | |
| static const ucn | ascii_lower_l = static_cast<ucn>(0x6C) |
| ASCII lower l character. | |
| static const ucn | ascii_lower_m = static_cast<ucn>(0x6D) |
| ASCII lower m character. | |
| static const ucn | ascii_lower_n = static_cast<ucn>(0x6E) |
| ASCII lower n character. | |
| static const ucn | ascii_lower_o = static_cast<ucn>(0x6F) |
| ASCII lower o character. | |
| static const ucn | ascii_lower_p = static_cast<ucn>(0x70) |
| ASCII lower p character. | |
| static const ucn | ascii_lower_q = static_cast<ucn>(0x71) |
| ASCII lower q character. | |
| static const ucn | ascii_lower_r = static_cast<ucn>(0x72) |
| ASCII lower r character. | |
| static const ucn | ascii_lower_s = static_cast<ucn>(0x73) |
| ASCII lower s character. | |
| static const ucn | ascii_lower_t = static_cast<ucn>(0x74) |
| ASCII lower t character. | |
| static const ucn | ascii_lower_u = static_cast<ucn>(0x75) |
| ASCII lower u character. | |
| static const ucn | ascii_lower_v = static_cast<ucn>(0x76) |
| ASCII lower v character. | |
| static const ucn | ascii_lower_w = static_cast<ucn>(0x77) |
| ASCII lower w character. | |
| static const ucn | ascii_lower_x = static_cast<ucn>(0x78) |
| ASCII lower x character. | |
| static const ucn | ascii_lower_y = static_cast<ucn>(0x79) |
| ASCII lower y character. | |
| static const ucn | ascii_lower_z = static_cast<ucn>(0x7A) |
| ASCII lower z character. | |
| static const ucn | ascii_left_brace = static_cast<ucn>(0x7B) |
| ASCII left brace character. | |
| static const ucn | ascii_vbar = static_cast<ucn>(0x7C) |
| ASCII vertical bar character. | |
| static const ucn | ascii_right_brace = static_cast<ucn>(0x7D) |
| ASCII right brace character. | |
| static const ucn | ascii_tilde = static_cast<ucn>(0x7E) |
| ASCII tilde character. | |
Private Types | |
| enum | ascii_flags_values { FLG_NONE = 0x00, FLG_BASIC = 0x01, FLG_UPPER = 0x02, FLG_LOWER = 0x04, FLG_ALPHA = 0x06, FLG_DIGIT = 0x08, FLG_ODIGIT = 0x10, FLG_XDIGIT = 0x20, FLG_SPACE = 0x40 } |
| Values of ASCII flags. More... | |
| typedef lc_host_uint_least8 | ascii_flags_type |
| Type of ASCII flags. | |
Private Member Functions | |
| character (const character ©) | |
| Hides copy constructor. | |
| character & | operator= (const character &rhs) |
| Hides assignment operator. | |
Static Private Attributes | |
| static const ulint | ucn_bits = 32 |
| Number of significant ucn_bits. | |
| static const ucn | value_mask = (static_cast<ucn>(1) << (ucn_bits - 1)) - 1 |
| Mask for character value. | |
| static const ucn | external_mask = (static_cast<ucn>(1) << (ucn_bits - 1)) |
| Mask for external characters. | |
| static const ucn | eof = ((static_cast<ucn>(1) << (ucn_bits - 1) - 1) << 1) | 1 |
| Internal eof constant, only for ucn_traits, must not be used elsewhere. | |
| static const hchar | hchar_unknown = '\0' |
| Host character value presumably not representing encodable character. | |
| static const ulint | ascii_length = 128 |
| Length of 7 bit ASCII table. | |
| static const ulint | host_length = 1 << (::std::numeric_limits<hchar>::digits) |
| Length of table of host characters . | |
| static ascii_flags_type | ascii_flags [ascii_length] |
| Flags of ASCII characters. | |
| static range_type | identifier_ranges [] |
| List of unicode character ranges for C++ identifiers. | |
| static hchar | internal_to_host [ascii_length] |
| Internal to host encoding of basic characters translation table. | |
| static ulint | host_to_internal [host_length] |
| Host to internal value encoding translation table. | |
| static bool | initialized = false |
| Multiple initialization guard. | |
Classes | |
| struct | range_type |
| Range of 16 bit codes. More... | |
Contains symbolic constants for Unicode representation of basic source characters as well as creators, predicates, transformers and extracters.
Definition at line 72 of file character.hh.
typedef lc_host_uint_least8 lestes::std::character::ascii_flags_type [private] |
enum lestes::std::character::ascii_flags_values [private] |
Values of ASCII flags.
| FLG_NONE | |
| FLG_BASIC | |
| FLG_UPPER | |
| FLG_LOWER | |
| FLG_ALPHA | |
| FLG_DIGIT | |
| FLG_ODIGIT | |
| FLG_XDIGIT | |
| FLG_SPACE |
Definition at line 348 of file character.hh.
00348 { 00349 FLG_NONE = 0x00, 00350 FLG_BASIC = 0x01, 00351 FLG_UPPER = 0x02, 00352 FLG_LOWER = 0x04, 00353 FLG_ALPHA = 0x06, 00354 FLG_DIGIT = 0x08, 00355 FLG_ODIGIT = 0x10, 00356 FLG_XDIGIT = 0x20, 00357 FLG_SPACE = 0x40 00358 };
| lestes::std::character::character | ( | void | ) |
Initializes internal tables.
Initializes some of the internal tables.
Definition at line 918 of file character.cc.
References ascii_length, hchar_unknown, host_to_internal, initialized, and internal_to_host.
00919 { 00920 if (initialized) return; 00921 initialized = 1; 00922 // fill the table according the reverse 00923 for (ulint i = 0; i < ascii_length; i++) { 00924 hchar c = internal_to_host[i]; 00925 if (c != hchar_unknown) { 00926 host_to_internal[static_cast<ulint>(c)] = i; 00927 } 00928 } 00929 }
| lestes::std::character::~character | ( | void | ) |
Destructor of the initializer.
Destructs the initializer instance.
Definition at line 934 of file character.cc.
| lestes::std::character::character | ( | const character & | copy | ) | [private] |
Hides copy constructor.
Returns internal character set ucn.
Returns ucn for internal character of given code.
| code | The code of the character. |
Definition at line 388 of file character.hh.
References lassert.
Referenced by create_from_host().
Returns internal ucn from host character.
Returns ucn for basic host character.
| c | The host character. |
Definition at line 400 of file character.hh.
References create_internal(), host_to_internal, and lassert.
Referenced by lestes::std::ucn_string::ucn_string().
00401 { 00402 ulint i = static_cast<unsigned char>(c); 00403 ulint x = host_to_internal[i]; 00404 lassert(x != 0); 00405 return create_internal(x); 00406 }
Returns external character set ucn.
Returns ucn for external character of given code.
| code | The code of the character. |
Definition at line 414 of file character.hh.
References external_mask, and lassert.
00415 { 00416 lassert(code < 0x7FFFFFFF); 00417 return static_cast<ucn>(code) | external_mask; 00418 }
Returns internal character set ucn from hexadecimal digit.
Returns ucn for internal character representing given lower case hexadecimal number.
| digit | The hexadecimal digit. |
Definition at line 426 of file character.hh.
References ascii_digit_0, ascii_lower_a, and lassert.
00427 { 00428 lassert(digit < 16); 00429 return static_cast<ucn>(digit < 10 ? ascii_digit_0 + digit : ascii_lower_a + digit - 10); 00430 }
| bool lestes::std::character::is_internal | ( | ucn | u | ) | [inline, static] |
Tests if value is internal character.
Tests if value is internal character.
| u | The value to test. |
Definition at line 437 of file character.hh.
References external_mask.
Referenced by is_translated().
00438 { 00439 return (u & external_mask) == 0; 00440 }
| bool lestes::std::character::is_external | ( | ucn | u | ) | [inline, static] |
Tests if value is external character.
Tests if value is external character.
| u | The value to test. |
Definition at line 459 of file character.hh.
References external_mask.
Referenced by is_encodable_host(), and lestes::std::ucn_string::to_host_string().
00460 { 00461 return (u & external_mask) != 0; 00462 }
| bool lestes::std::character::is_basic | ( | ucn | u | ) | [inline, static] |
Tests if value is basic source character.
Tests if value is basic source character.
| u | The value to test. |
Definition at line 469 of file character.hh.
References ascii_flags, FLG_BASIC, and is_ascii7().
Referenced by is_translated(), and lestes::std::ucn_string::to_host_string().
00470 { 00471 return is_ascii7(u) && (ascii_flags[u] & FLG_BASIC); 00472 }
| bool lestes::std::character::is_translated | ( | ucn | u | ) | [inline, static] |
Tests if value is translated source character.
Tests if value is translated source character. Certain ranges are disallowed for translated characters.
| u | The value to test. |
Definition at line 480 of file character.hh.
References is_basic(), and is_internal().
Referenced by is_translated_identifier().
00481 { 00482 return is_internal(u) && !is_basic(u) && !(u < 0x20 || (0x7F <= u && u <= 0x9F)); 00483 }
| bool lestes::std::character::is_ascii7 | ( | ucn | u | ) | [inline, static] |
Tests if value is 7 bit ASCII.
Tests if value is 7 bit ASCII.
| u | The value to test. |
Definition at line 490 of file character.hh.
Referenced by is_alpha(), is_basic(), is_digit(), is_lower(), is_odigit(), is_space(), is_upper(), is_xdigit(), and to_host().
00491 { 00492 // implicitly is_internal(u) check 00493 return u < 0x80; 00494 }
| bool lestes::std::character::is_alpha | ( | ucn | u | ) | [inline, static] |
Tests if value is ASCII letter.
Tests if value is ASCII letter.
| u | The value to test. |
Definition at line 501 of file character.hh.
References ascii_flags, FLG_ALPHA, and is_ascii7().
00502 { 00503 return is_ascii7(u) && (ascii_flags[u] & FLG_ALPHA == FLG_ALPHA); 00504 }
| bool lestes::std::character::is_upper | ( | ucn | u | ) | [inline, static] |
Tests if value is ASCII uppercase letter.
Tests if value is ASCII uppercase letter.
| u | The value to test. |
Definition at line 511 of file character.hh.
References ascii_flags, FLG_UPPER, and is_ascii7().
Referenced by to_lower().
00512 { 00513 return is_ascii7(u) && (ascii_flags[u] & FLG_UPPER); 00514 }
| bool lestes::std::character::is_lower | ( | ucn | u | ) | [inline, static] |
Tests if value is ASCII lowercase letter.
Tests if value is ASCII lowercase letter.
| u | The value to test. |
Definition at line 521 of file character.hh.
References ascii_flags, FLG_LOWER, and is_ascii7().
Referenced by to_upper().
00522 { 00523 return is_ascii7(u) && (ascii_flags[u] & FLG_LOWER); 00524 }
| bool lestes::std::character::is_digit | ( | ucn | u | ) | [inline, static] |
Tests if value is ASCII digit.
Tests if value is ASCII digit.
| u | The value to test. |
Definition at line 531 of file character.hh.
References ascii_flags, FLG_DIGIT, and is_ascii7().
Referenced by extract_digit(), and extract_xdigit().
00532 { 00533 return is_ascii7(u) && (ascii_flags[u] & FLG_DIGIT); 00534 }
| bool lestes::std::character::is_odigit | ( | ucn | u | ) | [inline, static] |
Tests if value is ASCII octal digit.
Tests if value is ASCII octal digit.
| u | The value to test. |
Definition at line 541 of file character.hh.
References ascii_flags, FLG_ODIGIT, and is_ascii7().
Referenced by extract_odigit().
00542 { 00543 return is_ascii7(u) && (ascii_flags[u] & FLG_ODIGIT); 00544 }
| bool lestes::std::character::is_xdigit | ( | ucn | u | ) | [inline, static] |
Tests if value is ASCII hexadecimal digit .
Tests if value is ASCII hexadecimal digit.
| u | The value to test. |
Definition at line 551 of file character.hh.
References ascii_flags, FLG_XDIGIT, and is_ascii7().
Referenced by extract_xdigit().
00552 { 00553 return is_ascii7(u) && (ascii_flags[u] & FLG_XDIGIT); 00554 }
| bool lestes::std::character::is_space | ( | ucn | u | ) | [inline, static] |
Tests if value is ASCII space character .
Tests if value is ASCII space character (space, tab, vtab, ff, cr, lf)
| u | The value to test. |
Definition at line 561 of file character.hh.
References ascii_flags, FLG_SPACE, and is_ascii7().
00562 { 00563 return is_ascii7(u) && (ascii_flags[u] & FLG_SPACE); 00564 }
| bool lestes::std::character::is_translated_identifier | ( | ucn | u | ) | [static] |
Tests if value is translated C++ identifier character.
Tests if value is translated unicode C++ identifier character. Performs a binary search, idea taken from gcc.
| u | The value to test. |
Definition at line 944 of file character.cc.
References extract_value(), identifier_ranges, and is_translated().
00945 { 00946 if (!is_translated(u)) return false; 00947 00948 ulint x = extract_value(u); 00949 00950 ulint i = 0; 00951 ulint j = sizeof(identifier_ranges)/sizeof(identifier_ranges[0]); 00952 ulint k; 00953 00954 while (i < j) { 00955 k = i + ((j - i) >> 1); 00956 if (x < identifier_ranges[k].low) 00957 j = k; 00958 else if (x > identifier_ranges[k].high) 00959 i = k + 1; 00960 else return true; 00961 } 00962 return false; 00963 }
| bool lestes::std::character::is_encodable_host | ( | ucn | u | ) | [inline, static] |
Tests if value is host character encodable in ucn.
Tests if value is external host character with known encoding into ucn.
| u | The value to test. |
Definition at line 447 of file character.hh.
References extract_value(), host_length, host_to_internal, and is_external().
00448 { 00449 if (!is_external(u)) return false; 00450 ulint x = extract_value(u); 00451 return x < host_length && host_to_internal[x] != 0; 00452 }
Returns uppercase of ASCII letter.
Returns uppercase of ASCII lowercase letter, other values intact.
| u | The value to transform. |
Definition at line 571 of file character.hh.
References is_lower().
Referenced by extract_xdigit().
Returns lowercase of ASCII letter.
Returns lowercase of ASCII uppercase letter, other values intact.
| u | The value to transform. |
Definition at line 582 of file character.hh.
References is_upper().
Returns host character.
Returns host character for subset of ASCII for which the encoding is known. It contains basic ASCII characters, '$', '@' and '`'. Other values are not supported.
| u | The value to transform. |
Definition at line 596 of file character.hh.
References extract_value(), hchar_unknown, internal_to_host, is_ascii7(), and lassert.
Referenced by lestes::std::ucn_string::to_host_string().
00597 { 00598 lassert(is_ascii7(u)); 00599 hchar c = internal_to_host[extract_value(u)]; 00600 lassert(c != hchar_unknown); 00601 return c; 00602 }
Returns digit value.
Returns digit value of the ucn.
| u | The digit to extract. |
Definition at line 610 of file character.hh.
References ascii_digit_0, is_digit(), and lassert.
Referenced by extract_odigit(), and extract_xdigit().
Returns hexadecimal digit value.
Returns hexadecimal digit value of the ucn.
| u | The digit to extract. |
Definition at line 622 of file character.hh.
References ascii_upper_a, extract_digit(), is_digit(), is_xdigit(), lassert, and to_upper().
00623 { 00624 if (is_digit(u)) return extract_digit(u); 00625 lassert(is_xdigit(u)); 00626 return static_cast<ulint>(to_upper(u)) - ascii_upper_a + 10; 00627 }
Returns hexadecimal digit value.
Returns octal digit value of the ucn.
| u | The digit to extract. |
Definition at line 635 of file character.hh.
References extract_digit(), is_odigit(), and lassert.
00636 { 00637 lassert(is_odigit(u)); 00638 return extract_digit(u); 00639 }
Returns character value.
Returns character value of the ucn for both unicode and external characters.
| u | The character to extract. |
Definition at line 646 of file character.hh.
References value_mask.
Referenced by is_encodable_host(), is_translated_identifier(), to_host(), and lestes::std::ucn_string::to_host_string().
00647 { 00648 return u & value_mask; 00649 }
Hides assignment operator.
const ucn lestes::std::character::ascii_bell = static_cast<ucn>(0x07) [static] |
const ucn lestes::std::character::ascii_backspace = static_cast<ucn>(0x08) [static] |
const ucn lestes::std::character::ascii_tab = static_cast<ucn>(0x09) [static] |
const ucn lestes::std::character::ascii_vtab = static_cast<ucn>(0x0B) [static] |
ASCII vertical tabulator character.
ASCII vertical tabulator character.
Definition at line 81 of file character.hh.
const ucn lestes::std::character::ascii_form_feed = static_cast<ucn>(0x0C) [static] |
const ucn lestes::std::character::ascii_new_line = static_cast<ucn>(0x0A) [static] |
const ucn lestes::std::character::ascii_carriage_return = static_cast<ucn>(0x0D) [static] |
ASCII carriage return character.
ASCII carriage return character.
Definition at line 87 of file character.hh.
const ucn lestes::std::character::ascii_space = static_cast<ucn>(0x20) [static] |
const ucn lestes::std::character::ascii_emark = static_cast<ucn>(0x21) [static] |
ASCII exclamation mark character.
ASCII exclamation mark character.
Definition at line 91 of file character.hh.
const ucn lestes::std::character::ascii_dquote = static_cast<ucn>(0x22) [static] |
ASCII double quote character.
ASCII double quote character.
Definition at line 93 of file character.hh.
const ucn lestes::std::character::ascii_hash = static_cast<ucn>(0x23) [static] |
const ucn lestes::std::character::ascii_dollar = static_cast<ucn>(0x24) [static] |
const ucn lestes::std::character::ascii_percent = static_cast<ucn>(0x25) [static] |
const ucn lestes::std::character::ascii_amp = static_cast<ucn>(0x26) [static] |
const ucn lestes::std::character::ascii_quote = static_cast<ucn>(0x27) [static] |
const ucn lestes::std::character::ascii_left_par = static_cast<ucn>(0x28) [static] |
ASCII left parenthesis character.
ASCII left parenthesis character.
Definition at line 105 of file character.hh.
const ucn lestes::std::character::ascii_right_par = static_cast<ucn>(0x29) [static] |
ASCII right parenthesis character.
ASCII right parenthesis character.
Definition at line 107 of file character.hh.
const ucn lestes::std::character::ascii_star = static_cast<ucn>(0x2A) [static] |
const ucn lestes::std::character::ascii_plus = static_cast<ucn>(0x2B) [static] |
const ucn lestes::std::character::ascii_comma = static_cast<ucn>(0x2C) [static] |
const ucn lestes::std::character::ascii_minus = static_cast<ucn>(0x2D) [static] |
const ucn lestes::std::character::ascii_dot = static_cast<ucn>(0x2E) [static] |
const ucn lestes::std::character::ascii_slash = static_cast<ucn>(0x2F) [static] |
const ucn lestes::std::character::ascii_digit_0 = static_cast<ucn>(0x30) [static] |
ASCII digit 0 character.
ASCII digit 0 character.
Definition at line 121 of file character.hh.
Referenced by create_xdigit(), and extract_digit().
const ucn lestes::std::character::ascii_digit_1 = static_cast<ucn>(0x31) [static] |
const ucn lestes::std::character::ascii_digit_2 = static_cast<ucn>(0x32) [static] |
const ucn lestes::std::character::ascii_digit_3 = static_cast<ucn>(0x33) [static] |
const ucn lestes::std::character::ascii_digit_4 = static_cast<ucn>(0x34) [static] |
const ucn lestes::std::character::ascii_digit_5 = static_cast<ucn>(0x35) [static] |
const ucn lestes::std::character::ascii_digit_6 = static_cast<ucn>(0x36) [static] |
const ucn lestes::std::character::ascii_digit_7 = static_cast<ucn>(0x37) [static] |
const ucn lestes::std::character::ascii_digit_8 = static_cast<ucn>(0x38) [static] |
const ucn lestes::std::character::ascii_digit_9 = static_cast<ucn>(0x39) [static] |
const ucn lestes::std::character::ascii_colon = static_cast<ucn>(0x3A) [static] |
const ucn lestes::std::character::ascii_semicolon = static_cast<ucn>(0x3B) [static] |
const ucn lestes::std::character::ascii_lt = static_cast<ucn>(0x3C) [static] |
const ucn lestes::std::character::ascii_eq = static_cast<ucn>(0x3D) [static] |
const ucn lestes::std::character::ascii_gt = static_cast<ucn>(0x3E) [static] |
ASCII greater than character.
ASCII greater than character.
Definition at line 149 of file character.hh.
const ucn lestes::std::character::ascii_qmark = static_cast<ucn>(0x3F) [static] |
ASCII question mark character.
ASCII question mark character.
Definition at line 151 of file character.hh.
const ucn lestes::std::character::ascii_at = static_cast<ucn>(0x40) [static] |
ASCII commercial at character (zavinac).
ASCII commercial at character (zavinac).
Definition at line 153 of file character.hh.
const ucn lestes::std::character::ascii_upper_a = static_cast<ucn>(0x41) [static] |
Definition at line 155 of file character.hh.
Referenced by extract_xdigit().
const ucn lestes::std::character::ascii_upper_b = static_cast<ucn>(0x42) [static] |
const ucn lestes::std::character::ascii_upper_c = static_cast<ucn>(0x43) [static] |
const ucn lestes::std::character::ascii_upper_d = static_cast<ucn>(0x44) [static] |
const ucn lestes::std::character::ascii_upper_e = static_cast<ucn>(0x45) [static] |
const ucn lestes::std::character::ascii_upper_f = static_cast<ucn>(0x46) [static] |
const ucn lestes::std::character::ascii_upper_g = static_cast<ucn>(0x47) [static] |
const ucn lestes::std::character::ascii_upper_h = static_cast<ucn>(0x48) [static] |
const ucn lestes::std::character::ascii_upper_i = static_cast<ucn>(0x49) [static] |
const ucn lestes::std::character::ascii_upper_j = static_cast<ucn>(0x4A) [static] |
const ucn lestes::std::character::ascii_upper_k = static_cast<ucn>(0x4B) [static] |
const ucn lestes::std::character::ascii_upper_l = static_cast<ucn>(0x4C) [static] |
const ucn lestes::std::character::ascii_upper_m = static_cast<ucn>(0x4D) [static] |
const ucn lestes::std::character::ascii_upper_n = static_cast<ucn>(0x4E) [static] |
const ucn lestes::std::character::ascii_upper_o = static_cast<ucn>(0x4F) [static] |
const ucn lestes::std::character::ascii_upper_p = static_cast<ucn>(0x50) [static] |
const ucn lestes::std::character::ascii_upper_q = static_cast<ucn>(0x51) [static] |
const ucn lestes::std::character::ascii_upper_r = static_cast<ucn>(0x52) [static] |
const ucn lestes::std::character::ascii_upper_s = static_cast<ucn>(0x53) [static] |
const ucn lestes::std::character::ascii_upper_t = static_cast<ucn>(0x54) [static] |
const ucn lestes::std::character::ascii_upper_u = static_cast<ucn>(0x55) [static] |
const ucn lestes::std::character::ascii_upper_v = static_cast<ucn>(0x56) [static] |
const ucn lestes::std::character::ascii_upper_w = static_cast<ucn>(0x57) [static] |
const ucn lestes::std::character::ascii_upper_x = static_cast<ucn>(0x58) [static] |
const ucn lestes::std::character::ascii_upper_y = static_cast<ucn>(0x59) [static] |
const ucn lestes::std::character::ascii_upper_z = static_cast<ucn>(0x5A) [static] |
const ucn lestes::std::character::ascii_left_bracket = static_cast<ucn>(0x5B) [static] |
ASCII left bracket character.
ASCII left bracket character.
Definition at line 207 of file character.hh.
const ucn lestes::std::character::ascii_backslash = static_cast<ucn>(0x5C) [static] |
const ucn lestes::std::character::ascii_right_bracket = static_cast<ucn>(0x5D) [static] |
ASCII right bracket character.
ASCII right bracket character.
Definition at line 211 of file character.hh.
const ucn lestes::std::character::ascii_hat = static_cast<ucn>(0x5E) [static] |
const ucn lestes::std::character::ascii_underscore = static_cast<ucn>(0x5F) [static] |
ASCII underscore character.
ASCII underscore character.
Definition at line 215 of file character.hh.
const ucn lestes::std::character::ascii_bquote = static_cast<ucn>(0x60) [static] |
ASCII back quote character.
ASCII back quote character.
Definition at line 217 of file character.hh.
const ucn lestes::std::character::ascii_lower_a = static_cast<ucn>(0x61) [static] |
Definition at line 219 of file character.hh.
Referenced by create_xdigit().
const ucn lestes::std::character::ascii_lower_b = static_cast<ucn>(0x62) [static] |
const ucn lestes::std::character::ascii_lower_c = static_cast<ucn>(0x63) [static] |
const ucn lestes::std::character::ascii_lower_d = static_cast<ucn>(0x64) [static] |
const ucn lestes::std::character::ascii_lower_e = static_cast<ucn>(0x65) [static] |
const ucn lestes::std::character::ascii_lower_f = static_cast<ucn>(0x66) [static] |
const ucn lestes::std::character::ascii_lower_g = static_cast<ucn>(0x67) [static] |
const ucn lestes::std::character::ascii_lower_h = static_cast<ucn>(0x68) [static] |
const ucn lestes::std::character::ascii_lower_i = static_cast<ucn>(0x69) [static] |
const ucn lestes::std::character::ascii_lower_j = static_cast<ucn>(0x6A) [static] |
const ucn lestes::std::character::ascii_lower_k = static_cast<ucn>(0x6B) [static] |
const ucn lestes::std::character::ascii_lower_l = static_cast<ucn>(0x6C) [static] |
const ucn lestes::std::character::ascii_lower_m = static_cast<ucn>(0x6D) [static] |
const ucn lestes::std::character::ascii_lower_n = static_cast<ucn>(0x6E) [static] |
const ucn lestes::std::character::ascii_lower_o = static_cast<ucn>(0x6F) [static] |
const ucn lestes::std::character::ascii_lower_p = static_cast<ucn>(0x70) [static] |
const ucn lestes::std::character::ascii_lower_q = static_cast<ucn>(0x71) [static] |
const ucn lestes::std::character::ascii_lower_r = static_cast<ucn>(0x72) [static] |
const ucn lestes::std::character::ascii_lower_s = static_cast<ucn>(0x73) [static] |
const ucn lestes::std::character::ascii_lower_t = static_cast<ucn>(0x74) [static] |
const ucn lestes::std::character::ascii_lower_u = static_cast<ucn>(0x75) [static] |
const ucn lestes::std::character::ascii_lower_v = static_cast<ucn>(0x76) [static] |
const ucn lestes::std::character::ascii_lower_w = static_cast<ucn>(0x77) [static] |
const ucn lestes::std::character::ascii_lower_x = static_cast<ucn>(0x78) [static] |
const ucn lestes::std::character::ascii_lower_y = static_cast<ucn>(0x79) [static] |
const ucn lestes::std::character::ascii_lower_z = static_cast<ucn>(0x7A) [static] |
const ucn lestes::std::character::ascii_left_brace = static_cast<ucn>(0x7B) [static] |
ASCII left brace character.
ASCII left brace character.
Definition at line 271 of file character.hh.
const ucn lestes::std::character::ascii_vbar = static_cast<ucn>(0x7C) [static] |
ASCII vertical bar character.
ASCII vertical bar character.
Definition at line 273 of file character.hh.
const ucn lestes::std::character::ascii_right_brace = static_cast<ucn>(0x7D) [static] |
ASCII right brace character.
ASCII right brace character.
Definition at line 275 of file character.hh.
const ucn lestes::std::character::ascii_tilde = static_cast<ucn>(0x7E) [static] |
const ulint lestes::std::character::ucn_bits = 32 [static, private] |
const ucn lestes::std::character::value_mask = (static_cast<ucn>(1) << (ucn_bits - 1)) - 1 [static, private] |
Mask for character value.
Definition at line 336 of file character.hh.
Referenced by extract_value().
const ucn lestes::std::character::external_mask = (static_cast<ucn>(1) << (ucn_bits - 1)) [static, private] |
Mask for external characters.
Definition at line 338 of file character.hh.
Referenced by create_external(), is_external(), and is_internal().
const ucn lestes::std::character::eof = ((static_cast<ucn>(1) << (ucn_bits - 1) - 1) << 1) | 1 [static, private] |
Internal eof constant, only for ucn_traits, must not be used elsewhere.
Definition at line 340 of file character.hh.
const hchar lestes::std::character::hchar_unknown = '\0' [static, private] |
Host character value presumably not representing encodable character.
Definition at line 342 of file character.hh.
Referenced by character(), and to_host().
const ulint lestes::std::character::ascii_length = 128 [static, private] |
Length of 7 bit ASCII table.
Definition at line 344 of file character.hh.
Referenced by character().
const ulint lestes::std::character::host_length = 1 << (::std::numeric_limits<hchar>::digits) [static, private] |
Length of table of host characters .
Definition at line 346 of file character.hh.
Referenced by is_encodable_host().
character::ascii_flags_type lestes::std::character::ascii_flags [static, private] |
Flags of ASCII characters.
Flags of ASCII part of internal characters, used for predicates.
Definition at line 362 of file character.hh.
Referenced by is_alpha(), is_basic(), is_digit(), is_lower(), is_odigit(), is_space(), is_upper(), and is_xdigit().
character::range_type lestes::std::character::identifier_ranges [static, private] |
List of unicode character ranges for C++ identifiers.
List of unicode character ranges for C++ identifiers. Does not include basic source character ranges. Shall be sorted in increasing order (for binary search).
Definition at line 369 of file character.hh.
Referenced by is_translated_identifier().
hchar lestes::std::character::internal_to_host [static, private] |
Internal to host encoding of basic characters translation table.
Internal to host encoding of basic characters translation table. Unused fields are ignored. Assumes that no basic character has code hchar_unknown in host encoding.
Definition at line 371 of file character.hh.
Referenced by character(), and to_host().
ulint lestes::std::character::host_to_internal [static, private] |
Initial value:
{
}
Host to internal encoding translation table. This is reasonable only for narrow range host characters, could be substituted by map. Zeroed statically, initialization is done in constructor.
Definition at line 373 of file character.hh.
Referenced by character(), create_from_host(), and is_encodable_host().
bool lestes::std::character::initialized = false [static, private] |
Multiple initialization guard.
Multiple initialization guard, set to true after first constructor run.
Definition at line 379 of file character.hh.
Referenced by character().
1.5.1-20070107