Wire Sysio Wire Sysion 1.0.0
Loading...
Searching...
No Matches
picojson::input< Iter > Class Template Reference

Public Member Functions

 input (const Iter &first, const Iter &last)
 
int getc ()
 
void ungetc ()
 
Iter cur () const
 
int line () const
 
void skip_ws ()
 
bool expect (const int expected)
 
bool match (const std::string &pattern)
 

Protected Attributes

Iter cur_
 
Iter end_
 
bool consumed_
 
int line_
 

Detailed Description

template<typename Iter>
class picojson::input< Iter >

Definition at line 621 of file spec_test_generator.cpp.

Constructor & Destructor Documentation

◆ input()

template<typename Iter >
picojson::input< Iter >::input ( const Iter & first,
const Iter & last )
inline

Member Function Documentation

◆ cur()

template<typename Iter >
Iter picojson::input< Iter >::cur ( ) const
inline

Definition at line 644 of file spec_test_generator.cpp.

644 {
645 if (consumed_) {
646 input<Iter>* self = const_cast<input<Iter>*>(this);
647 self->consumed_ = false;
648 ++self->cur_;
649 }
650 return cur_;
651 }
input(const Iter &first, const Iter &last)
@ self
the connection is to itself
Definition protocol.hpp:48

◆ expect()

template<typename Iter >
bool picojson::input< Iter >::expect ( const int expected)
inline

Definition at line 662 of file spec_test_generator.cpp.

662 {
663 skip_ws();
664 if (getc() != expected) {
665 ungetc();
666 return false;
667 }
668 return true;
669 }
Here is the call graph for this function:

◆ getc()

template<typename Iter >
int picojson::input< Iter >::getc ( )
inline

Definition at line 629 of file spec_test_generator.cpp.

629 {
630 if (consumed_) {
631 if (*cur_ == '\n') {
632 ++line_;
633 }
634 ++cur_;
635 }
636 if (cur_ == end_) {
637 consumed_ = false;
638 return -1;
639 }
640 consumed_ = true;
641 return *cur_ & 0xff;
642 }
Here is the caller graph for this function:

◆ line()

template<typename Iter >
int picojson::input< Iter >::line ( ) const
inline

Definition at line 652 of file spec_test_generator.cpp.

652{ return line_; }

◆ match()

template<typename Iter >
bool picojson::input< Iter >::match ( const std::string & pattern)
inline

Definition at line 670 of file spec_test_generator.cpp.

670 {
671 for (std::string::const_iterator pi(pattern.begin()); pi != pattern.end(); ++pi) {
672 if (getc() != *pi) {
673 ungetc();
674 return false;
675 }
676 }
677 return true;
678 }
Here is the call graph for this function:

◆ skip_ws()

template<typename Iter >
void picojson::input< Iter >::skip_ws ( )
inline

Definition at line 653 of file spec_test_generator.cpp.

653 {
654 while (1) {
655 int ch = getc();
656 if (!(ch == ' ' || ch == '\t' || ch == '\n' || ch == '\r')) {
657 ungetc();
658 break;
659 }
660 }
661 }
static const Reg8 ch(Operand::CH)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ungetc()

template<typename Iter >
void picojson::input< Iter >::ungetc ( )
inline

Definition at line 643 of file spec_test_generator.cpp.

643{ consumed_ = false; }
Here is the caller graph for this function:

Member Data Documentation

◆ consumed_

template<typename Iter >
bool picojson::input< Iter >::consumed_
protected

Definition at line 624 of file spec_test_generator.cpp.

◆ cur_

template<typename Iter >
Iter picojson::input< Iter >::cur_
protected

Definition at line 623 of file spec_test_generator.cpp.

◆ end_

template<typename Iter >
Iter picojson::input< Iter >::end_
protected

Definition at line 623 of file spec_test_generator.cpp.

◆ line_

template<typename Iter >
int picojson::input< Iter >::line_
protected

Definition at line 625 of file spec_test_generator.cpp.


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