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

Last change on this file since 246 was 246, checked in by luba, 18 years ago

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.1 KB
Line 
1// $Source$
2// $Revision: 246 $
3// $Date: 2002-11-21 09:32:52 +0000 (Thu, 21 Nov 2002) $
4// $Author: luba $
5#include <ctype.h>
6#include "rf_int.hh"
7#include "rf_core.hh"
8
9class rf_char {
10  intptr_t ch;
11public:
12  inline rf_char (const rf_int& );
13  inline rf_char (const intptr_t& );
14  inline rf_char to_lower() const;
15  inline rf_int to_byte() const;
16  inline rf_char to_upper() const;
17  inline rf_char operator==(const rf_char& ) const;
18  inline uintptr_t get_char_len() const;
19  inline Term* to_rf_chars(Term* ) const;
20  inline bool is_digit() const;
21};
22
23inline rf_char::rf_char(const rf_int& c) {
24  ch = c.to_int();
25};
26
27inline rf_char::rf_char(const intptr_t& c) {
28  ch = c;
29};
30
31inline rf_char rf_char::to_lower() const {
32  rf_char(tolower(ch));
33};
34
35inline rf_int rf_char::to_byte() const {
36  rf_int(ch);
37};
38
39inline rf_char rf_char::to_upper() const {
40  rf_char(toupper(ch));
41};
42
43inline bool rf_char::operator==(const rf_char& c) const {
44  return (ch == c.ch);
45};
46
47inline uintptr_t rf_char::get_char_len() const {
48  return 1;
49};
50
51inline Term* rf_char::to_rf_chars(Term* t) const {
52  *t = *this;
53  return (t + 1);
54};
55
56inline bool rf_char::is_digit() const {
57  return isdigit(this->ch);
58};
59
60
61
Note: See TracBrowser for help on using the repository browser.