1 | // $Source$ |
---|
2 | // $Revision: 756 $ |
---|
3 | // $Date: 2003-05-25 16:58:24 +0000 (Sun, 25 May 2003) $ |
---|
4 | // $Author: luba $ |
---|
5 | |
---|
6 | #ifndef __rf_char_hh__ |
---|
7 | #define __rf_char_hh__ |
---|
8 | |
---|
9 | #include "rf_types.hh" |
---|
10 | #include "rf_term.hh" |
---|
11 | #include "rf_expr.hh" |
---|
12 | |
---|
13 | namespace rftype |
---|
14 | { |
---|
15 | |
---|
16 | using namespace rfrt ; |
---|
17 | |
---|
18 | class Char : |
---|
19 | public Term |
---|
20 | { |
---|
21 | |
---|
22 | public: |
---|
23 | /// |
---|
24 | /// Constructor from a wide character |
---|
25 | inline Char (wchar_t _wch) ; |
---|
26 | inline wchar_t to_wchar_t() const; |
---|
27 | #if 0 |
---|
28 | inline Char(const Char& _ch) ; |
---|
29 | #endif |
---|
30 | |
---|
31 | static Expr create_expr (wchar_t const* _wstr, size_t _len = -1) ; |
---|
32 | |
---|
33 | static Expr create_expr (const WString& _wstr) ; |
---|
34 | |
---|
35 | static Expr create_expr (char const* _str, char const* _locale = null) ; |
---|
36 | |
---|
37 | /// |
---|
38 | /// Create new expression -- character sequence representing specified |
---|
39 | /// argument. |
---|
40 | static Expr to_chars (const Expr& _expr) ; |
---|
41 | |
---|
42 | /// |
---|
43 | /// Convert character sequence to lower case. Note that argument must be a |
---|
44 | /// character sequence and the method doesn't check this. |
---|
45 | static Expr to_lower (const Expr& _expr) ; |
---|
46 | |
---|
47 | /// |
---|
48 | /// Convert character sequence to upper case. Note that argument must be a |
---|
49 | /// character sequence and the method doesn't check this. |
---|
50 | static Expr to_upper (const Expr& _expr) ; |
---|
51 | |
---|
52 | static Expr bytes_to_chars (const Expr& _expr) ; |
---|
53 | static Expr chars_to_bytes (const Expr& _expr) ; |
---|
54 | // static Expr to_int (const Expr& _expr) ; |
---|
55 | |
---|
56 | inline bool is_digit() const; |
---|
57 | |
---|
58 | inline bool is_not_space() const; |
---|
59 | |
---|
60 | #if 0 |
---|
61 | inline Int to_byte() const; |
---|
62 | |
---|
63 | inline bool operator == (Char const&) const; |
---|
64 | |
---|
65 | |
---|
66 | inline wchar_t to_wchar_t() const; |
---|
67 | #endif |
---|
68 | |
---|
69 | static uintptr_t ctor (uintptr_t _data) ; |
---|
70 | static void dtor (uintptr_t _data) ; |
---|
71 | static bool eq (uintptr_t _data1, uintptr_t _data2) ; |
---|
72 | static int compare (uintptr_t _data1, uintptr_t _data2) ; |
---|
73 | static uint32_t hash (uintptr_t _data) ; |
---|
74 | static pxx::WString to_string (uintptr_t _data) ; |
---|
75 | static short_type_funcs_t funcs ; |
---|
76 | static TypeRegister reg ; |
---|
77 | |
---|
78 | }; |
---|
79 | |
---|
80 | } |
---|
81 | |
---|
82 | #endif // __rf_char_hh__ |
---|