Ne.app NeANT
The Ne.app NeANT User module of the NeANT distribution.
Macros | Typedefs | Functions | Variables
22.locale.codecvt.length.cpp File Reference
#include <locale>
#include <climits>
#include <clocale>
#include <cstdlib>
#include <cstring>
#include <cwchar>
#include <rw_any.h>
#include <rw_cmdopt.h>
#include <rw_driver.h>
#include <rw_file.h>
#include <rw_locale.h>
#include <rw_printf.h>
Include dependency graph for 22.locale.codecvt.length.cpp:

Go to the source code of this file.

Macros

#define TEST(from, nchars, maxi, result)    test_length (char (), __LINE__, 0, cvt, from, nchars, maxi, result)
 
#define TEST(from, nchars, maxi, result)    test_length (wchar_t (), __LINE__, 0, cvt, from, nchars, maxi, result)
 
#define STRICT(from, nc, maxi, res)    test_length (wchar_t (), __LINE__, 0, cvt_strict, from, nc, maxi, res)
 
#define RELAXD(from, nc, maxi, res)    test_length (wchar_t (), __LINE__, 0, cvt_relaxd, from, nc, maxi, res)
 
#define TEST(from, nc, maxi, res)
 
#define TEST(from, nc, maxi, res)
 
#define TEST(from, nc, maxi, res)
 
#define TEST(what)
 

Typedefs

typedef std::codecvt< char, char, std::mbstate_t > Codecvt
 
typedef std::codecvt_byname< char, char, std::mbstate_t > CodecvtByname
 
typedef std::codecvt< wchar_t, char, std::mbstate_t > WCodecvt
 
typedef std::codecvt_byname< wchar_t, char, std::mbstate_t > WCodecvtByname
 

Functions

const char * create_locale ()
 
template<class internT >
void test_length (internT, int line, const std::mbstate_t *pstate, const std::codecvt< internT, char, std::mbstate_t > &cvt, const char *from, std::size_t nchars, int maxi, int result)
 
void test_codecvt (const Codecvt *pcvt=0)
 
int main (int argc, char *argv[])
 

Variables

const char * locale_root
 

Macro Definition Documentation

◆ RELAXD

#define RELAXD (   from,
  nc,
  maxi,
  res 
)     test_length (wchar_t (), __LINE__, 0, cvt_relaxd, from, nc, maxi, res)

◆ STRICT

#define STRICT (   from,
  nc,
  maxi,
  res 
)     test_length (wchar_t (), __LINE__, 0, cvt_strict, from, nc, maxi, res)

◆ TEST [1/6]

#define TEST (   from,
  nc,
  maxi,
  res 
)
Value:
STRICT (from, nc, maxi, res); \
RELAXD (from, nc, maxi, res)
#define res
Definition 17.names.cpp:531
#define STRICT(from, nc, maxi, res)

◆ TEST [2/6]

#define TEST (   from,
  nc,
  maxi,
  res 
)
Value:
test_length (wchar_t (), __LINE__, 0, cvt_table, \
from, std::size_t (nc), maxi, res)
void test_length(internT, int line, const std::mbstate_t *pstate, const std::codecvt< internT, char, std::mbstate_t > &cvt, const char *from, std::size_t nchars, int maxi, int result)

◆ TEST [3/6]

#define TEST (   from,
  nc,
  maxi,
  res 
)
Value:
test_length (wchar_t (), __LINE__, 0, cvt_libc, \
from, std::size_t (nc), maxi, res)

◆ TEST [4/6]

#define TEST (   from,
  nchars,
  maxi,
  result 
)     test_length (char (), __LINE__, 0, cvt, from, nchars, maxi, result)

◆ TEST [5/6]

#define TEST (   from,
  nchars,
  maxi,
  result 
)     test_length (wchar_t (), __LINE__, 0, cvt, from, nchars, maxi, result)

◆ TEST [6/6]

#define TEST (   what)
Value:
if (no_ ## what) { \
rw_note (0, 0, __LINE__, "%s test disabled", #what); \
} \
else { \
test_ ## what (); \
} typedef void unused_typedef

Typedef Documentation

◆ Codecvt

typedef std::codecvt<char, char, std::mbstate_t> Codecvt

codecvt_length.cpp - test exercising the std::codecvt::length()

$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 2004-2006 Rogue Wave Software.

Definition at line 51 of file 22.locale.codecvt.length.cpp.

◆ CodecvtByname

typedef std::codecvt_byname<char, char, std::mbstate_t> CodecvtByname

Definition at line 52 of file 22.locale.codecvt.length.cpp.

◆ WCodecvt

typedef std::codecvt<wchar_t, char, std::mbstate_t> WCodecvt

Definition at line 56 of file 22.locale.codecvt.length.cpp.

◆ WCodecvtByname

typedef std::codecvt_byname<wchar_t, char, std::mbstate_t> WCodecvtByname

Definition at line 57 of file 22.locale.codecvt.length.cpp.

Function Documentation

◆ create_locale()

const char * create_locale ( )

Definition at line 69 of file 22.locale.codecvt.length.cpp.

◆ main()

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

Definition at line 801 of file 22.locale.codecvt.length.cpp.

◆ test_codecvt()

void test_codecvt ( const Codecvt *  pcvt = 0)

Definition at line 160 of file 22.locale.codecvt.length.cpp.

◆ test_length()

template<class internT >
void test_length ( internT  ,
int  line,
const std::mbstate_t *  pstate,
const std::codecvt< internT, char, std::mbstate_t > &  cvt,
const char *  from,
std::size_t  nchars,
int  maxi,
int  result 
)

Definition at line 126 of file 22.locale.codecvt.length.cpp.

Variable Documentation

◆ locale_root

const char* locale_root

Definition at line 65 of file 22.locale.codecvt.length.cpp.