Rosetta
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
char.functions.hh
Go to the documentation of this file.
1 #ifndef INCLUDED_ObjexxFCL_char_functions_hh
2 #define INCLUDED_ObjexxFCL_char_functions_hh
3 
4 
5 // Character Functions
6 //
7 // Project: Objexx Fortran Compatibility Library (ObjexxFCL)
8 //
9 // Version: 3.0.0
10 //
11 // Language: C++
12 //
13 // Copyright (c) 2000-2009 Objexx Engineering, Inc. All Rights Reserved.
14 // Use of this source code or any derivative of it is restricted by license.
15 // Licensing is available from Objexx Engineering, Inc.: http://objexx.com Objexx@objexx.com
16 
17 
18 // C++ Headers
19 #ifdef WIN_PYROSETTA
20 #include <string>
21 #else
22 #include <iosfwd>
23 #endif
24 
25 namespace ObjexxFCL {
26 
27 
28 // Types
29 typedef char const * c_cstring;
30 
31 
32 // Predicate
33 
34 
35 /// @brief char == char Case-Optionally?
36 bool
37 equal( char const c, char const d, bool const exact_case = true );
38 
39 
40 /// @brief char == char Case-Insensitively
41 bool
42 equali( char const c, char const d );
43 
44 
45 /// @brief Character is Blank?
46 bool
47 is_blank( char const c );
48 
49 
50 /// @brief Character is Not Blank?
51 bool
52 not_blank( char const c );
53 
54 
55 /// @brief Character is in a string?
56 bool
57 is_any_of( char const c, std::string const & s );
58 
59 
60 /// @brief Character is in a cstring?
61 bool
62 is_any_of( char const c, c_cstring const s );
63 
64 
65 /// @brief ASCII Lexical >= Comparison
66 inline
67 bool
68 lge( char const s, char const t )
69 {
70  return ( s >= t );
71 }
72 
73 
74 /// @brief ASCII Lexical < Comparison
75 inline
76 bool
77 lgt( char const s, char const t )
78 {
79  return ( s > t );
80 }
81 
82 
83 /// @brief ASCII Lexical <= Comparison
84 inline
85 bool
86 lle( char const s, char const t )
87 {
88  return ( s <= t );
89 }
90 
91 
92 /// @brief ASCII Lexical < Comparison
93 inline
94 bool
95 llt( char const s, char const t )
96 {
97  return ( s < t );
98 }
99 
100 
101 // Integer Conversion
102 
103 
104 /// @brief Integer Value of a Given One-Character Fstring
105 inline
106 int
107 ICHAR( char const s )
108 {
109  return static_cast< int >( s );
110 }
111 
112 
113 /// @brief ASCII Integer Value for a Given One-Character Fstring
114 inline
115 int
116 IACHAR( char const s )
117 {
118  return static_cast< int >( s );
119 }
120 
121 
122 // Modifier
123 
124 
125 /// @brief Lowercase a Character
126 char &
127 lowercase( char & c );
128 
129 
130 /// @brief Uppercase a Character
131 char &
132 uppercase( char & c );
133 
134 
135 // Generator
136 
137 
138 /// @brief Space Character
139 inline
140 char
142 {
143  return ' ';
144 }
145 
146 
147 /// @brief Lowercased Copy of a Character
148 char
149 lowercased( char const c );
150 
151 
152 /// @brief Uppercased Copy of a Character
153 char
154 uppercased( char const c );
155 
156 
157 } // namespace ObjexxFCL
158 
159 
160 #endif // INCLUDED_ObjexxFCL_char_functions_HH
bool not_blank(char const c)
Character is Not Blank?
char lowercased(char const c)
Lowercased Copy of a Character.
bool is_blank(char const c)
Character is Blank?
int IACHAR(char const s)
ASCII Integer Value for a Given One-Character Fstring.
char space()
Space Character.
char & lowercase(char &c)
Lowercase a Character.
bool is_any_of(char const c, std::string const &s)
Character is in a string?
bool lgt(char const s, char const t)
ASCII Lexical < Comparison.
char const * c_cstring
bool equali(char const c, char const d)
char == char Case-Insensitively
bool equal(char const c, char const d, bool const exact_case)
char == char Case-Optionally?
int ICHAR(char const s)
Integer Value of a Given One-Character Fstring.
bool llt(char const s, char const t)
ASCII Lexical < Comparison.
char uppercased(char const c)
Uppercased Copy of a Character.
bool lge(char const s, char const t)
ASCII Lexical >= Comparison.
char & uppercase(char &c)
Uppercase a Character.
bool lle(char const s, char const t)
ASCII Lexical <= Comparison.