Facet class to specify parsing of a JLANG::JString object.  
 More...
#include <JStringFacet.hh>
 | 
| static std::locale::id  | id | 
|   | 
 | 
| virtual istreambuf_iterator  | do_get (const istreambuf_iterator __begin, const istreambuf_iterator __end, const std::ios_base &format, std::ios_base::iostate &result, std::string &buffer) const | 
|   | Get string.  More...
  | 
|   | 
| virtual ostreambuf_iterator  | do_put (ostreambuf_iterator out, const std::ios_base &format, const char c, const std::string &buffer) const | 
|   | Put string.  More...
  | 
|   | 
| virtual istreambuf_iterator  | do_ignore (const istreambuf_iterator __begin, const istreambuf_iterator __end) const | 
|   | Ignore characters until next end of line.  More...
  | 
|   | 
| virtual istreambuf_iterator  | do_getline (const istreambuf_iterator __begin, const istreambuf_iterator __end, std::ios_base::iostate &result, std::string &buffer) const | 
|   | Read string.  More...
  | 
|   | 
Facet class to specify parsing of a JLANG::JString object. 
This class extends the std::locale::facet class. 
Definition at line 26 of file JStringFacet.hh.
 
◆ istreambuf_iterator
◆ ostreambuf_iterator
◆ JStringFacet() [1/2]
  
  
      
        
          | JLANG::JStringFacet::JStringFacet  | 
          ( | 
          std::size_t  | 
          refs = 0 | ) | 
           | 
         
       
   | 
  
inline   | 
  
 
Constructor. 
- Parameters
 - 
  
  
 
Definition at line 44 of file JStringFacet.hh.
   45       std::locale::facet(refs)
 
 
 
 
◆ JStringFacet() [2/2]
◆ clone()
◆ get()
Get string. 
- Parameters
 - 
  
    | __begin | begin position of input stream  | 
    | __end | end position of input stream  | 
    | format | format  | 
    | result | status after input operation  | 
    | buffer | output string  | 
  
   
- Returns
 - position of input stream 
 
Definition at line 70 of file JStringFacet.hh.
 
 
◆ put()
Put string. 
- Parameters
 - 
  
    | out | begin position of output stream  | 
    | format | format  | 
    | c | fill character  | 
    | buffer | input string  | 
  
   
- Returns
 - position of output stream buffer 
 
Definition at line 89 of file JStringFacet.hh.
   94       return do_put(out, format, c, buffer);
 
 
 
 
◆ ignore()
  
  
      
        
          | std::istream& JLANG::JStringFacet::ignore  | 
          ( | 
          std::istream &  | 
          in | ) | 
           const | 
         
       
   | 
  
inline   | 
  
 
Ignore characters until next end of line. 
- Parameters
 - 
  
  
 
- Returns
 - input stream 
 
Definition at line 104 of file JStringFacet.hh.
  107         in.setstate(std::ios_base::eofbit);
 
 
 
 
◆ getline()
  
  
      
        
          | std::istream& JLANG::JStringFacet::getline  | 
          ( | 
          std::istream &  | 
          in,  | 
         
        
           | 
           | 
          std::string &  | 
          buffer  | 
         
        
           | 
          ) | 
           |  const | 
         
       
   | 
  
inline   | 
  
 
Read characters until next end of line. 
- Parameters
 - 
  
    | in | input stream  | 
    | buffer | output string  | 
  
   
- Returns
 - input stream 
 
Definition at line 121 of file JStringFacet.hh.
  126       ios_base::iostate state = in.rdstate();
 
  129         in.setstate(std::ios_base::eofbit);
 
  132       if (state != ios_base::goodbit && state != ios_base::eofbit) {
 
 
 
 
◆ getIndex()
  
  
      
        
          | static int JLANG::JStringFacet::getIndex  | 
          ( | 
           | ) | 
           | 
         
       
   | 
  
inlinestatic   | 
  
 
Get index for stream associated facet data. 
- Returns
 - index 
 
Definition at line 145 of file JStringFacet.hh.
  147       static int i = std::ios_base::xalloc();
 
 
 
 
◆ do_get()
Get string. 
- Parameters
 - 
  
    | __begin | begin position of input stream  | 
    | __end | end position of input stream  | 
    | format | format  | 
    | result | status after input operation  | 
    | buffer | output string  | 
  
   
- Returns
 - position of input stream 
 
Reimplemented in JLANG::JEquationFacet, and JLANG::JCppFacet.
Definition at line 164 of file JStringFacet.hh.
  172       result = (ios_base::iostate) 0;  
 
  174       streamsize 
n = format.width();   
 
  177         n = numeric_limits<streamsize>::max();
 
  184         result |= ios_base::failbit;    
 
  185         result |= ios_base::eofbit;
 
  191         buffer.push_back(*i);
 
  193         for (++i, --
n; i != __end && 
n != 0; ++i, --
n) {
 
  194           buffer.push_back(*i);
 
  198           result |= ios_base::eofbit;
 
 
 
 
◆ do_put()
Put string. 
- Parameters
 - 
  
    | out | begin position of output stream  | 
    | format | format  | 
    | c | fill character  | 
    | buffer | input string  | 
  
   
- Returns
 - current position of output stream 
 
Reimplemented in JLANG::JEquationFacet, and JLANG::JCppFacet.
Definition at line 215 of file JStringFacet.hh.
  222       if (format.flags() & ios_base::right) {
 
  223         for (streamsize i = buffer.size(); i < format.width(); ++i, ++out) {
 
  228       for (string::const_iterator i = buffer.begin(); i != buffer.end(); ++i, ++out) {
 
  232       if (format.flags() & ios_base::left) {
 
  233         for (streamsize i = buffer.size(); i < format.width(); ++i, ++out) {
 
 
 
 
◆ do_ignore()
Ignore characters until next end of line. 
- Parameters
 - 
  
    | __begin | begin position of input stream  | 
    | __end | end position of input stream  | 
  
   
- Returns
 - position of input stream 
 
Reimplemented in JLANG::JCppFacet.
Definition at line 249 of file JStringFacet.hh.
  254       while (i != __end && *i != 
'\n') {
 
  258       while (i != __end && *i == 
'\n') {
 
 
 
 
◆ do_getline()
Read string. 
- Parameters
 - 
  
    | __begin | begin position of input stream  | 
    | __end | end position of input stream  | 
    | result | status after input operation  | 
    | buffer | output string  | 
  
   
- Returns
 - position of input stream 
 
Reimplemented in JLANG::JEquationFacet.
Definition at line 275 of file JStringFacet.hh.
  286         result |= ios_base::failbit;    
 
  287         result |= ios_base::eofbit;
 
  293         for ( ; i != __end && *i != 
'\n'; ++i) {
 
  294           buffer.push_back(*i);
 
 
 
 
◆ operator=()
  
  
      
        
          | void JLANG::JStringFacet::operator=  | 
          ( | 
          const JStringFacet &  | 
           | ) | 
           | 
         
       
   | 
  
private   | 
  
 
 
◆ id
  
  
      
        
          | std::locale::id JLANG::JStringFacet::id | 
         
       
   | 
  
static   | 
  
 
 
The documentation for this class was generated from the following files:
 
virtual istreambuf_iterator do_get(const istreambuf_iterator __begin, const istreambuf_iterator __end, const std::ios_base &format, std::ios_base::iostate &result, std::string &buffer) const
Get string.