Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Types | Private Attributes | List of all members
JLANG::JWhiteSpacesFacet Class Reference

Auxiliary class to specify white space character(s) in currect locale. More...

#include <JWhiteSpacesFacet.hh>

Inheritance diagram for JLANG::JWhiteSpacesFacet:
JLANG::JMask

Public Member Functions

 JWhiteSpacesFacet (const std::locale &loc, const std::string &ws)
 Constructor. More...
 

Private Types

typedef std::ctype< char > ctype
 

Private Attributes

ctype::mask mask_set [ctype::table_size]
 

Detailed Description

Auxiliary class to specify white space character(s) in currect locale.

Definition at line 35 of file JWhiteSpacesFacet.hh.

Member Typedef Documentation

typedef std::ctype<char> JLANG::JMask::ctype
inherited

Definition at line 25 of file JWhiteSpacesFacet.hh.

Constructor & Destructor Documentation

JLANG::JWhiteSpacesFacet::JWhiteSpacesFacet ( const std::locale &  loc,
const std::string &  ws 
)
inline

Constructor.

Parameters
loccurrent locale
wswhite space character(s)

Definition at line 46 of file JWhiteSpacesFacet.hh.

47  :
48  JMask(),
50  {
51  using namespace std;
52 
53  char buffer[table_size];
54 
55  for (unsigned int i = 0; i != table_size; ++i) {
56  buffer[i] = (char) i;
57  }
58 
59  use_facet<JMask::ctype>(loc).is(buffer, buffer + table_size, mask_set);
60 
61  for (unsigned int i = 0; i != table_size; ++i) {
62  if (mask_set[i] & JMask::ctype::space) {
63  mask_set[i] ^= JMask::ctype::space;
64  }
65  }
66 
67  for (string::const_iterator i = ws.begin(); i != ws.end(); ++i) {
68  mask_set[(int) *i] |= JMask::ctype::space;
69  }
70  }
ctype::mask mask_set[ctype::table_size]
is
Definition: JDAQCHSM.chsm:167
std::ctype< char > ctype
Auxiliary class to ensure that the mask set is defined prior to the ctype&lt;&gt;() constructor call...
char * loc(char *orig)

Member Data Documentation

ctype::mask JLANG::JMask::mask_set[ctype::table_size]
protectedinherited

Definition at line 28 of file JWhiteSpacesFacet.hh.


The documentation for this class was generated from the following file: