Jpp  15.0.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Types | Private Member Functions | 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 char ws)
 Constructor. More...
 
 JWhiteSpacesFacet (const std::locale &loc, const std::string &ws)
 Constructor. More...
 

Private Types

typedef std::ctype< char > ctype
 

Private Member Functions

void configure (const std::locale &loc, const std::string &ws)
 Configure. More...
 

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 char  ws 
)
inline

Constructor.

Parameters
loccurrent locale
wswhite space character

Definition at line 46 of file JWhiteSpacesFacet.hh.

47  :
48  JMask(),
50  {
51  configure(loc, std::string(1, ws));
52  }
ctype::mask mask_set[ctype::table_size]
void configure(const std::locale &loc, const std::string &ws)
Configure.
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)
JLANG::JWhiteSpacesFacet::JWhiteSpacesFacet ( const std::locale &  loc,
const std::string &  ws 
)
inline

Constructor.

Parameters
loccurrent locale
wswhite space character(s)

Definition at line 61 of file JWhiteSpacesFacet.hh.

62  :
63  JMask(),
65  {
66  configure(loc, ws);
67  }
ctype::mask mask_set[ctype::table_size]
void configure(const std::locale &loc, const std::string &ws)
Configure.
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 Function Documentation

void JLANG::JWhiteSpacesFacet::configure ( const std::locale &  loc,
const std::string &  ws 
)
inlineprivate

Configure.

Parameters
loccurrent locale
wswhite space character(s)

Definition at line 76 of file JWhiteSpacesFacet.hh.

78  {
79  using namespace std;
80 
81  char buffer[table_size];
82 
83  for (unsigned int i = 0; i != table_size; ++i) {
84  buffer[i] = (char) i;
85  }
86 
87  use_facet<JMask::ctype>(loc).is(buffer, buffer + table_size, mask_set);
88 
89  for (unsigned int i = 0; i != table_size; ++i) {
90  if (mask_set[i] & JMask::ctype::space) {
91  mask_set[i] ^= JMask::ctype::space;
92  }
93  }
94 
95  for (string::const_iterator i = ws.begin(); i != ws.end(); ++i) {
96  mask_set[(int) *i] |= JMask::ctype::space;
97  }
98  }
ctype::mask mask_set[ctype::table_size]
is
Definition: JDAQCHSM.chsm:167
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: