Auxiliary class to specify white space character(s) in currect locale.
More...
#include <JWhiteSpacesFacet.hh>
|
typedef std::ctype< char > | ctype |
|
|
void | configure (const std::locale &loc, const std::string &ws) |
| Configure.
|
|
|
ctype::mask | mask_set [ctype::table_size] |
|
Auxiliary class to specify white space character(s) in currect locale.
Definition at line 35 of file JWhiteSpacesFacet.hh.
◆ ctype
◆ JWhiteSpacesFacet() [1/2]
JLANG::JWhiteSpacesFacet::JWhiteSpacesFacet |
( |
const std::locale & | loc, |
|
|
const char | ws ) |
|
inline |
Constructor.
- Parameters
-
loc | current locale |
ws | white space character |
Definition at line 46 of file JWhiteSpacesFacet.hh.
47 :
48 JMask(),
50 {
52 }
ctype::mask mask_set[ctype::table_size]
void configure(const std::locale &loc, const std::string &ws)
Configure.
◆ JWhiteSpacesFacet() [2/2]
JLANG::JWhiteSpacesFacet::JWhiteSpacesFacet |
( |
const std::locale & | loc, |
|
|
const std::string & | ws ) |
|
inline |
Constructor.
- Parameters
-
loc | current locale |
ws | white space character(s) |
Definition at line 61 of file JWhiteSpacesFacet.hh.
62 :
63 JMask(),
65 {
67 }
◆ configure()
void JLANG::JWhiteSpacesFacet::configure |
( |
const std::locale & | loc, |
|
|
const std::string & | ws ) |
|
inlineprivate |
Configure.
- Parameters
-
loc | current locale |
ws | white space character(s) |
Definition at line 76 of file JWhiteSpacesFacet.hh.
78 {
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) {
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 }
◆ mask_set
ctype::mask JLANG::JMask::mask_set[ctype::table_size] |
|
protectedinherited |
The documentation for this class was generated from the following file: