00001 // -*- C++ -*- 00002 00003 //============================================================================= 00004 /** 00005 * @file OS_NS_ctype.h 00006 * 00007 * $Id: OS_NS_ctype.h 83891 2008-11-28 11:01:50Z johnnyw $ 00008 * 00009 * @author Douglas C. Schmidt <schmidt@cs.wustl.edu> 00010 * @author Jesper S. M|ller<stophph@diku.dk> 00011 * @author and a cast of thousands... 00012 * 00013 * Originally in OS.h. 00014 */ 00015 //============================================================================= 00016 00017 #ifndef ACE_OS_NS_CTYPE_H 00018 # define ACE_OS_NS_CTYPE_H 00019 00020 # include /**/ "ace/pre.h" 00021 00022 # include "ace/config-all.h" 00023 00024 # if !defined (ACE_LACKS_PRAGMA_ONCE) 00025 # pragma once 00026 # endif /* ACE_LACKS_PRAGMA_ONCE */ 00027 00028 #include /**/ "ace/ACE_export.h" 00029 00030 #if defined (ACE_EXPORT_MACRO) 00031 # undef ACE_EXPORT_MACRO 00032 #endif 00033 #define ACE_EXPORT_MACRO ACE_Export 00034 00035 #include "ace/os_include/os_ctype.h" 00036 #if defined ACE_HAS_WCHAR 00037 # include "ace/os_include/os_wctype.h" 00038 #endif /* ACE_HAS_WCHAR */ 00039 00040 ACE_BEGIN_VERSIONED_NAMESPACE_DECL 00041 00042 namespace ACE_OS { 00043 00044 // these are non-standard names... 00045 00046 /** @name Functions from <cctype> 00047 * 00048 * Included are the functions defined in <cctype> and their <cwctype> 00049 * equivalents. 00050 * 00051 * Since they are often implemented as macros, we don't use the same name 00052 * here. Instead, we change by prepending "ace_". 00053 */ 00054 //@{ 00055 00056 /// Returns true if the character is an alphanumeric character. 00057 ACE_NAMESPACE_INLINE_FUNCTION 00058 int ace_isalnum (ACE_TCHAR c); 00059 00060 /// Returns true if the character is an alphabetic character. 00061 ACE_NAMESPACE_INLINE_FUNCTION 00062 int ace_isalpha (ACE_TCHAR c); 00063 00064 /// Returns true if the character is a control character. 00065 ACE_NAMESPACE_INLINE_FUNCTION 00066 int ace_isblank (ACE_TCHAR c); 00067 00068 /// Returns true if the character is a control character. 00069 ACE_NAMESPACE_INLINE_FUNCTION 00070 int ace_isascii (ACE_TCHAR c); 00071 00072 /// Returns true if the character is a control character. 00073 ACE_NAMESPACE_INLINE_FUNCTION 00074 int ace_iscntrl (ACE_TCHAR c); 00075 00076 /// Returns true if the character is a decimal-digit character. 00077 ACE_NAMESPACE_INLINE_FUNCTION 00078 int ace_isdigit (ACE_TCHAR c); 00079 00080 /// Returns true if the character is a printable character other than a space. 00081 ACE_NAMESPACE_INLINE_FUNCTION 00082 int ace_isgraph (ACE_TCHAR c); 00083 00084 /// Returns true if the character is a lowercase character. 00085 ACE_NAMESPACE_INLINE_FUNCTION 00086 int ace_islower (ACE_TCHAR c); 00087 00088 /// Returns true if the character is a printable character. 00089 ACE_NAMESPACE_INLINE_FUNCTION 00090 int ace_isprint (ACE_TCHAR c); 00091 00092 /// Returns true if the character is a punctuation character. 00093 ACE_NAMESPACE_INLINE_FUNCTION 00094 int ace_ispunct (ACE_TCHAR c); 00095 00096 /// Returns true if the character is a space character. 00097 ACE_NAMESPACE_INLINE_FUNCTION 00098 int ace_isspace (ACE_TCHAR c); 00099 00100 /// Returns true if the character is an uppercase character. 00101 ACE_NAMESPACE_INLINE_FUNCTION 00102 int ace_isupper (ACE_TCHAR c); 00103 00104 /// Returns true if the character is a hexadecimal-digit character. 00105 ACE_NAMESPACE_INLINE_FUNCTION 00106 int ace_isxdigit (ACE_TCHAR c); 00107 00108 /// Converts a character to lower case (char version). 00109 ACE_NAMESPACE_INLINE_FUNCTION 00110 int ace_tolower (int c); 00111 00112 #if defined (ACE_HAS_WCHAR) 00113 /// Converts a character to lower case (wchar_t version). 00114 ACE_NAMESPACE_INLINE_FUNCTION 00115 wint_t ace_towlower (wint_t c); 00116 #endif /* ACE_HAS_WCHAR */ 00117 00118 /// Converts a character to upper case (char version). 00119 ACE_NAMESPACE_INLINE_FUNCTION 00120 int ace_toupper (int c); 00121 00122 #if defined (ACE_HAS_WCHAR) && !defined (ACE_LACKS_TOWUPPER) 00123 /// Converts a character to upper case (wchar_t version). 00124 ACE_NAMESPACE_INLINE_FUNCTION 00125 wint_t ace_towupper (wint_t c); 00126 #endif /* ACE_HAS_WCHAR && !ACE_LACKS_TOWUPPER */ 00127 00128 /// Tests @a c for the property specified by the @a desc argument 00129 ACE_NAMESPACE_INLINE_FUNCTION 00130 int ace_isctype (int c, ctype_t desc); 00131 //@} 00132 00133 } /* namespace ACE_OS */ 00134 00135 ACE_END_VERSIONED_NAMESPACE_DECL 00136 00137 # if defined (ACE_HAS_INLINED_OSCALLS) 00138 # if defined (ACE_INLINE) 00139 # undef ACE_INLINE 00140 # endif /* ACE_INLINE */ 00141 # define ACE_INLINE inline 00142 # include "ace/OS_NS_ctype.inl" 00143 # endif /* ACE_HAS_INLINED_OSCALLS */ 00144 00145 # include /**/ "ace/post.h" 00146 #endif /* ACE_OS_NS_CTYPE_H */