source: to-imperative/trunk/runtime/rf_char.hh @ 723

Last change on this file since 723 was 723, checked in by orlov, 18 years ago
  • Reworked Char::to_chars() method.
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.8 KB
Line 
1// $Source$
2// $Revision: 723 $
3// $Date: 2003-05-05 12:04:11 +0000 (Mon, 05 May 2003) $
4// $Author: orlov $
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
13namespace rftype
14{
15
16using namespace rfrt ;
17
18class Char :
19  public Term
20{
21
22public:
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#if 0
59  inline Int to_byte() const;
60
61  inline bool operator == (Char const&) const;
62
63
64  inline wchar_t to_wchar_t() const;
65#endif
66
67  static uintptr_t ctor (uintptr_t _data) ;
68  static void dtor (uintptr_t _data) ;
69  static bool eq (uintptr_t _data1, uintptr_t _data2) ;
70  static int compare (uintptr_t _data1, uintptr_t _data2) ;
71  static uint32_t hash (uintptr_t _data) ;
72  static pxx::WString to_string (uintptr_t _data) ;
73  static short_type_funcs_t funcs ;
74  static TypeRegister reg ;
75
76};
77
78}
79
80#endif // __rf_char_hh__
Note: See TracBrowser for help on using the repository browser.