Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Macros | Typedefs | Functions | Variables
22.locale.ctype.is.cpp File Reference
#include <rw/_defs.h>
#include <locale>
#include <climits>
#include <clocale>
#include <cstring>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cwchar>
#include <cwctype>
#include <langinfo.h>
#include <rw_driver.h>
#include <rw_file.h>
#include <rw_locale.h>
Include dependency graph for 22.locale.ctype.is.cpp:

Go to the source code of this file.

Macros

#define LC_MESSAGES   _RWSTD_LC_MESSAGES
 
#define NLOOPS   25
 
#define MAX_STR_SIZE   16
 
#define LOCALES
 
#define BEGIN_LOCALE_LOOP(num, locname, loop_cntrl)
 
#define END_LOCALE_LOOP(locname)
 
#define ALPHA   std::ctype_base::alpha
 
#define UPPER   std::ctype_base::upper
 
#define LOWER   std::ctype_base::lower
 
#define DIGIT   std::ctype_base::digit
 
#define SPACE   std::ctype_base::space
 
#define CNTRL   std::ctype_base::cntrl
 
#define PUNCT   std::ctype_base::punct
 
#define XDIGIT   std::ctype_base::xdigit
 
#define GRAPH   std::ctype_base::graph
 
#define PRINT   std::ctype_base::print
 
#define IS(what)
 
#define IS(what)
 
#define TEST(ch, m)
 

Typedefs

typedef unsigned char UChar
 

Functions

int libc_isalpha (char ch)
 
int libc_isspace (char ch)
 
int libc_isprint (char ch)
 
int libc_iscntrl (char ch)
 
int libc_isupper (char ch)
 
int libc_islower (char ch)
 
int libc_isdigit (char ch)
 
int libc_ispunct (char ch)
 
int libc_isxdigit (char ch)
 
int libc_isalnum (char ch)
 
int libc_isgraph (char ch)
 
char libc_tolower (char ch)
 
char libc_toupper (char ch)
 
std::ctype_base::mask libc_mask (int mask, char ch, const char *locname)
 
bool libc_is (std::ctype_base::mask mask, char ch, const char *locname)
 
std::size_t c_strlen (const char *s1)
 
int c_strcmp (const char *s1, const char *s2)
 
const char * widen (char *dst, const char *src)
 
char widen (char, char ch, const char *)
 
int libc_isalpha (wchar_t ch)
 
int libc_isspace (wchar_t ch)
 
int libc_isprint (wchar_t ch)
 
int libc_iscntrl (wchar_t ch)
 
int libc_isupper (wchar_t ch)
 
int libc_islower (wchar_t ch)
 
int libc_isdigit (wchar_t ch)
 
int libc_ispunct (wchar_t ch)
 
int libc_isxdigit (wchar_t ch)
 
int libc_isalnum (wchar_t ch)
 
int libc_isgraph (wchar_t ch)
 
wchar_t libc_tolower (wchar_t ch)
 
wchar_t libc_toupper (wchar_t ch)
 
std::size_t c_strlen (const wchar_t *s1)
 
int c_strcmp (const wchar_t *s1, const wchar_t *s2)
 
const wchar_t * widen (wchar_t *dst, const char *src)
 
std::ctype_base::mask libc_mask (int mask, wchar_t ch, const char *locname)
 
bool libc_is (std::ctype_base::mask mask, wchar_t ch, const char *locname)
 
wchar_t widen (wchar_t, char ch, const char *locname)
 
template<class charT >
void gen_str (charT *str, std::size_t size)
 
template<class charT >
void test_is (charT, const char *cname)
 
template<class charT >
void test_is_ch (charT, const char *cname)
 
template<class charT >
void test_libc (charT, const char *cname)
 
template<class charT >
void test_libstd_mask (charT, const char *cname, const std::ctype< charT > &ct, const char *locname)
 
template<class charT >
void test_libstd (charT, const char *cname)
 
int main (int argc, char *argv[])
 

Variables

const char * locale_root
 
const char * locale_list = 0
 

Macro Definition Documentation

◆ ALPHA

#define ALPHA   std::ctype_base::alpha

Definition at line 113 of file 22.locale.ctype.is.cpp.

◆ BEGIN_LOCALE_LOOP

#define BEGIN_LOCALE_LOOP (   num,
  locname,
  loop_cntrl 
)
Value:
for (const char* locname = locale_list; \
locname && *locname; locname += std::strlen (locname) + 1) { \
_TRY { \
const std::locale loc (locname); \
const std::ctype<char> &ctc = \
_STD_USE_FACET (std::ctype<char>, loc); \
_RWSTD_UNUSED (ctc); \
const std::ctype<charT> &ctp = \
_STD_USE_FACET (std::ctype<charT>, loc); \
for (int loop_cntrl = 0; loop_cntrl < int (num); loop_cntrl++)
#define loc
Definition 17.names.cpp:492
#define num
Definition 17.names.cpp:505
const char * locale_list
#define LOCALES
#define LC_CTYPE
#define _TRY
Definition _defs.h:850
_TEST_EXPORT char * rw_locale_query(int=_UNUSED_CAT, const char *=0, _RWSTD_SIZE_T=0)

Definition at line 88 of file 22.locale.ctype.is.cpp.

◆ CNTRL

#define CNTRL   std::ctype_base::cntrl

Definition at line 118 of file 22.locale.ctype.is.cpp.

◆ DIGIT

#define DIGIT   std::ctype_base::digit

Definition at line 116 of file 22.locale.ctype.is.cpp.

◆ END_LOCALE_LOOP

#define END_LOCALE_LOOP (   locname)
Value:
} \
_CATCH (...) { \
rw_assert (0, 0, __LINE__, \
"locale (\"%s\") threw an exception", locname); \
} \
}

Definition at line 101 of file 22.locale.ctype.is.cpp.

◆ GRAPH

#define GRAPH   std::ctype_base::graph

Definition at line 121 of file 22.locale.ctype.is.cpp.

◆ IS [1/2]

#define IS (   what)
Value:
libc_is##what (ch) \
? (void)std::strcat (is_C, #what" ") : (void)0;
bool libc_is(std::ctype_base::mask mask, char ch, const char *locname)

◆ IS [2/2]

#define IS (   what)
Value:
ctp.is (std::ctype_base::what, ch) \
? (void)std::strcat (is_CXX, #what" ") : (void)0; \
(std::is##what)(ch, loc) \
? (void)std::strcat (is_CXX2, #what" ") : (void)0;

◆ LC_MESSAGES

#define LC_MESSAGES   _RWSTD_LC_MESSAGES

22.locale.ctype.is.cpp - Tests exercising the is() of ctype facet

$Id$

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Copyright 2001-2006 Rogue Wave Software.

Definition at line 63 of file 22.locale.ctype.is.cpp.

◆ LOCALES

#define LOCALES
Value:
"{{en-US,de-DE,fr-FR,es-ES}-*-{ISO-8859-*,UTF-8,CP125?}," \
"{ja-JP-*-{EUC-JP,SHIFT_JIS,UTF-8,CP125?}}," \
"{zh-CN-*-{GB*,UTF-8,CP125?}}," \
"{ru-RU-*-{KOI*,UTF-8,CP125?}}}"

Definition at line 81 of file 22.locale.ctype.is.cpp.

◆ LOWER

#define LOWER   std::ctype_base::lower

Definition at line 115 of file 22.locale.ctype.is.cpp.

◆ MAX_STR_SIZE

#define MAX_STR_SIZE   16

Definition at line 79 of file 22.locale.ctype.is.cpp.

◆ NLOOPS

#define NLOOPS   25

Definition at line 78 of file 22.locale.ctype.is.cpp.

◆ PRINT

#define PRINT   std::ctype_base::print

Definition at line 122 of file 22.locale.ctype.is.cpp.

◆ PUNCT

#define PUNCT   std::ctype_base::punct

Definition at line 119 of file 22.locale.ctype.is.cpp.

◆ SPACE

#define SPACE   std::ctype_base::space

Definition at line 117 of file 22.locale.ctype.is.cpp.

◆ TEST

#define TEST (   ch,
  m 
)
Value:
rw_assert (ct.is (m, ch), 0, __LINE__, \
"ctype<%s>::is(%d, %d) failed", cname, m, ch)
#define m
Definition 17.names.cpp:129
_TEST_EXPORT int rw_assert(int, const char *, int, const char *,...)
Definition driver.cpp:1630

◆ UPPER

#define UPPER   std::ctype_base::upper

Definition at line 114 of file 22.locale.ctype.is.cpp.

◆ XDIGIT

#define XDIGIT   std::ctype_base::xdigit

Definition at line 120 of file 22.locale.ctype.is.cpp.

Typedef Documentation

◆ UChar

typedef unsigned char UChar

Definition at line 111 of file 22.locale.ctype.is.cpp.

Function Documentation

◆ c_strcmp() [1/2]

int c_strcmp ( const char *  s1,
const char *  s2 
)

Definition at line 245 of file 22.locale.ctype.is.cpp.

◆ c_strcmp() [2/2]

int c_strcmp ( const wchar_t *  s1,
const wchar_t *  s2 
)

Definition at line 339 of file 22.locale.ctype.is.cpp.

◆ c_strlen() [1/2]

std::size_t c_strlen ( const char *  s1)

Definition at line 240 of file 22.locale.ctype.is.cpp.

◆ c_strlen() [2/2]

std::size_t c_strlen ( const wchar_t *  s1)

Definition at line 334 of file 22.locale.ctype.is.cpp.

◆ gen_str()

template<class charT >
void gen_str ( charT *  str,
std::size_t  size 
)

Definition at line 450 of file 22.locale.ctype.is.cpp.

◆ libc_is() [1/2]

bool libc_is ( std::ctype_base::mask  mask,
char  ch,
const char *  locname 
)
inline

Definition at line 233 of file 22.locale.ctype.is.cpp.

◆ libc_is() [2/2]

bool libc_is ( std::ctype_base::mask  mask,
wchar_t  ch,
const char *  locname 
)

Definition at line 408 of file 22.locale.ctype.is.cpp.

◆ libc_isalnum() [1/2]

int libc_isalnum ( char  ch)

Definition at line 171 of file 22.locale.ctype.is.cpp.

◆ libc_isalnum() [2/2]

int libc_isalnum ( wchar_t  ch)

Definition at line 314 of file 22.locale.ctype.is.cpp.

◆ libc_isalpha() [1/2]

int libc_isalpha ( char  ch)

Definition at line 126 of file 22.locale.ctype.is.cpp.

◆ libc_isalpha() [2/2]

int libc_isalpha ( wchar_t  ch)

Definition at line 269 of file 22.locale.ctype.is.cpp.

◆ libc_iscntrl() [1/2]

int libc_iscntrl ( char  ch)

Definition at line 141 of file 22.locale.ctype.is.cpp.

◆ libc_iscntrl() [2/2]

int libc_iscntrl ( wchar_t  ch)

Definition at line 284 of file 22.locale.ctype.is.cpp.

◆ libc_isdigit() [1/2]

int libc_isdigit ( char  ch)

Definition at line 156 of file 22.locale.ctype.is.cpp.

◆ libc_isdigit() [2/2]

int libc_isdigit ( wchar_t  ch)

Definition at line 299 of file 22.locale.ctype.is.cpp.

◆ libc_isgraph() [1/2]

int libc_isgraph ( char  ch)

Definition at line 176 of file 22.locale.ctype.is.cpp.

◆ libc_isgraph() [2/2]

int libc_isgraph ( wchar_t  ch)

Definition at line 319 of file 22.locale.ctype.is.cpp.

◆ libc_islower() [1/2]

int libc_islower ( char  ch)

Definition at line 151 of file 22.locale.ctype.is.cpp.

◆ libc_islower() [2/2]

int libc_islower ( wchar_t  ch)

Definition at line 294 of file 22.locale.ctype.is.cpp.

◆ libc_isprint() [1/2]

int libc_isprint ( char  ch)

Definition at line 136 of file 22.locale.ctype.is.cpp.

◆ libc_isprint() [2/2]

int libc_isprint ( wchar_t  ch)

Definition at line 279 of file 22.locale.ctype.is.cpp.

◆ libc_ispunct() [1/2]

int libc_ispunct ( char  ch)

Definition at line 161 of file 22.locale.ctype.is.cpp.

◆ libc_ispunct() [2/2]

int libc_ispunct ( wchar_t  ch)

Definition at line 304 of file 22.locale.ctype.is.cpp.

◆ libc_isspace() [1/2]

int libc_isspace ( char  ch)

Definition at line 131 of file 22.locale.ctype.is.cpp.

◆ libc_isspace() [2/2]

int libc_isspace ( wchar_t  ch)

Definition at line 274 of file 22.locale.ctype.is.cpp.

◆ libc_isupper() [1/2]

int libc_isupper ( char  ch)

Definition at line 146 of file 22.locale.ctype.is.cpp.

◆ libc_isupper() [2/2]

int libc_isupper ( wchar_t  ch)

Definition at line 289 of file 22.locale.ctype.is.cpp.

◆ libc_isxdigit() [1/2]

int libc_isxdigit ( char  ch)

Definition at line 166 of file 22.locale.ctype.is.cpp.

◆ libc_isxdigit() [2/2]

int libc_isxdigit ( wchar_t  ch)

Definition at line 309 of file 22.locale.ctype.is.cpp.

◆ libc_mask() [1/2]

std::ctype_base::mask libc_mask ( int  mask,
char  ch,
const char *  locname 
)

Definition at line 191 of file 22.locale.ctype.is.cpp.

◆ libc_mask() [2/2]

std::ctype_base::mask libc_mask ( int  mask,
wchar_t  ch,
const char *  locname 
)

Definition at line 368 of file 22.locale.ctype.is.cpp.

◆ libc_tolower() [1/2]

char libc_tolower ( char  ch)

Definition at line 181 of file 22.locale.ctype.is.cpp.

◆ libc_tolower() [2/2]

wchar_t libc_tolower ( wchar_t  ch)

Definition at line 324 of file 22.locale.ctype.is.cpp.

◆ libc_toupper() [1/2]

char libc_toupper ( char  ch)

Definition at line 186 of file 22.locale.ctype.is.cpp.

◆ libc_toupper() [2/2]

wchar_t libc_toupper ( wchar_t  ch)

Definition at line 329 of file 22.locale.ctype.is.cpp.

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 1062 of file 22.locale.ctype.is.cpp.

◆ test_is()

template<class charT >
void test_is ( charT  ,
const char *  cname 
)

Definition at line 471 of file 22.locale.ctype.is.cpp.

◆ test_is_ch()

template<class charT >
void test_is_ch ( charT  ,
const char *  cname 
)

Definition at line 532 of file 22.locale.ctype.is.cpp.

◆ test_libc()

template<class charT >
void test_libc ( charT  ,
const char *  cname 
)

Definition at line 739 of file 22.locale.ctype.is.cpp.

◆ test_libstd()

template<class charT >
void test_libstd ( charT  ,
const char *  cname 
)

Definition at line 849 of file 22.locale.ctype.is.cpp.

◆ test_libstd_mask()

template<class charT >
void test_libstd_mask ( charT  ,
const char *  cname,
const std::ctype< charT > &  ct,
const char *  locname 
)

Definition at line 748 of file 22.locale.ctype.is.cpp.

◆ widen() [1/4]

const char * widen ( char *  dst,
const char *  src 
)

Definition at line 251 of file 22.locale.ctype.is.cpp.

◆ widen() [2/4]

char widen ( char  ,
char  ch,
const char *   
)

Definition at line 261 of file 22.locale.ctype.is.cpp.

◆ widen() [3/4]

const wchar_t * widen ( wchar_t *  dst,
const char *  src 
)

Definition at line 346 of file 22.locale.ctype.is.cpp.

◆ widen() [4/4]

wchar_t widen ( wchar_t  ,
char  ch,
const char *  locname 
)

Definition at line 415 of file 22.locale.ctype.is.cpp.

Variable Documentation

◆ locale_list

const char* locale_list = 0

Definition at line 86 of file 22.locale.ctype.is.cpp.

◆ locale_root

const char* locale_root

Definition at line 76 of file 22.locale.ctype.is.cpp.