Jpp
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
JPARSER::JParserTemplateElement< JType_t, has_eq > Class Template Reference

Template class holder for I/O of parser element. More...

#include <JParser.hh>

Public Member Functions

template<>
std::istream & read (std::istream &in)
 
template<>
std::istream & read (std::istream &in)
 

Detailed Description

template<class JType_t, bool has_eq = JComparisonAvailable<JType_t>::has_eq>
class JPARSER::JParserTemplateElement< JType_t, has_eq >

Template class holder for I/O of parser element.

This class implements the JPARSER::JParserElementInterface interface.

Definition at line 454 of file JParser.hh.

Member Function Documentation

template<>
std::istream & JPARSER::JParserTemplateElement< std::string, false >::read ( std::istream &  in)
inline
Parameters
ininput stream
Returns
input stream

Definition at line 693 of file JParser.hh.

694  {
695  std::getline(in, object);
696 
697  if (fail(in)) {
698  THROW(JParserException, "JParser: error reading parameter " << getName());
699  }
700 
701  if (in.peek() != EOF) {
702  THROW(JParserException, "JParser: pending data after reading parameter " << getName());
703  }
704 
705  setInitialiationStatus(true);
706 
707  return in;
708  }
#define THROW(JException_t, A)
Marco for throwing exception with std::ostream compatible message.
Definition: JException.hh:633
std::istream & getline(std::istream &in, JString &object)
Read string from input stream until end of line.
Definition: JString.hh:468
Exception when parsing a value.
Definition: JException.hh:504
bool fail(std::istream &in)
Check for stream state.
Definition: JParser.hh:93
const char * getName()
Get ROOT name of given data type.
template<>
std::istream & JPARSER::JParserTemplateElement< std::vector< TString >, false >::read ( std::istream &  in)
inline
Parameters
ininput stream
Returns
input stream

Definition at line 752 of file JParser.hh.

753  {
754  using namespace JPP;
755 
757 
758  setInitialiationStatus(true);
759 
760  return in;
761  }
Test exitence of class T.
Definition: JResolve.hh:21
std::istream & read(std::istream &in, JContainer_t< TString, JAllocator_t > &object, const JBool< false > &option)
Auxiliary method for reading if TString does not exist.
Definition: JParser.hh:720
Auxiliary template class for type bool.
Definition: JBool.hh:20

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