Jpp - the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
JPARSER::JParserElementInterface Class Referenceabstract

Interface for I/O of parser element. More...

#include <JParser.hh>

Inheritance diagram for JPARSER::JParserElementInterface:
JLANG::JStreamInput JLANG::JStreamOutput JPARSER::JParserTemplateElement< bool > JPARSER::JParserTemplateElement< JCounter > JPARSER::JParserTemplateElement< JType_t, false > JPARSER::JParserTemplateElement< JType_t, true >

Public Member Functions

const std::string & getName () const
 Get name of parameter. More...
 
const std::string & getHelp () const
 Get help of parameter. More...
 
virtual bool getStatus () const =0
 Get status of parameter. More...
 
virtual bool getInitialisationStatus () const =0
 Get initialisation status of parameter. More...
 
virtual void setInitialiationStatus (const bool value)=0
 Set initialisation status of parameter. More...
 
virtual void print (std::ostream &out) const
 Print. More...
 
virtual bool gcount () const
 Read counter. More...
 
virtual std::istream & read (std::istream &in)=0
 Stream input. More...
 
virtual std::ostream & write (std::ostream &out) const =0
 Stream output. More...
 

Protected Member Functions

 JParserElementInterface (const std::string &name="arg", const std::string &help="")
 Constructor. More...
 

Protected Attributes

std::string __name
 
std::string __help
 

Detailed Description

Interface for I/O of parser element.

Definition at line 348 of file JParser.hh.

Constructor & Destructor Documentation

JPARSER::JParserElementInterface::JParserElementInterface ( const std::string &  name = "arg",
const std::string &  help = "" 
)
inlineprotected

Constructor.

Parameters
namename of object
helphelp of object

Definition at line 359 of file JParser.hh.

360  :
361  __name(name),
362  __help(help)
363  {}
then echo Enter input within $TIMEOUT_S seconds echo n User name
Definition: JCookie.sh:40

Member Function Documentation

const std::string& JPARSER::JParserElementInterface::getName ( ) const
inline

Get name of parameter.

Returns
name

Definition at line 372 of file JParser.hh.

373  {
374  return __name;
375  }
const std::string& JPARSER::JParserElementInterface::getHelp ( ) const
inline

Get help of parameter.

Returns
help

Definition at line 383 of file JParser.hh.

384  {
385  return __help;
386  }
virtual bool JPARSER::JParserElementInterface::getStatus ( ) const
pure virtual
virtual bool JPARSER::JParserElementInterface::getInitialisationStatus ( ) const
pure virtual
virtual void JPARSER::JParserElementInterface::setInitialiationStatus ( const bool  value)
pure virtual

Set initialisation status of parameter.

Parameters
valueinitialisation status

Implemented in JPARSER::JParserTemplateElement< JCounter >, JPARSER::JParserTemplateElement< bool >, and JPARSER::JParserTemplateElement< JType_t, false >.

virtual void JPARSER::JParserElementInterface::print ( std::ostream &  out) const
inlinevirtual

Print.

Parameters
outoutput stream
Returns
output stream

Reimplemented in JPARSER::JParserTemplateElement< JType_t, true >.

Definition at line 419 of file JParser.hh.

420  {
421  using namespace std;
422 
423  out << "<" << getName() << ">";
424 
425  if (getStatus() && !getShortprint(out)) {
426 
427  int width = WIDTH - getName().length();
428 
429  if (width > 0) {
430  out << setw(width) << " ";
431  }
432 
433  out << " = ";
434 
435  write(out);
436  }
437 
438  if (getLongprint(out) && getHelp() != "") {
439  out << " \"" << getHelp() << "\"";
440  }
441  }
Auxiliary data structure for alignment of data.
Definition: JManip.hh:231
virtual bool getStatus() const =0
Get status of parameter.
const std::string & getName() const
Get name of parameter.
Definition: JParser.hh:372
bool getLongprint(std::ostream &out)
Get long print option.
Definition: JManip.hh:121
virtual std::ostream & write(std::ostream &out) const =0
Stream output.
bool getShortprint(std::ostream &out)
Get short print option.
Definition: JManip.hh:75
const std::string & getHelp() const
Get help of parameter.
Definition: JParser.hh:383
virtual bool JPARSER::JParserElementInterface::gcount ( ) const
inlinevirtual

Read counter.

Returns
true if at least one character to be read; else false

Reimplemented in JPARSER::JParserTemplateElement< JCounter >, and JPARSER::JParserTemplateElement< bool >.

Definition at line 449 of file JParser.hh.

450  {
451  return true;
452  }
virtual std::istream& JLANG::JStreamInput::read ( std::istream &  in)
pure virtualinherited
virtual std::ostream& JLANG::JStreamOutput::write ( std::ostream &  out) const
pure virtualinherited

Member Data Documentation

std::string JPARSER::JParserElementInterface::__name
protected

Definition at line 456 of file JParser.hh.

std::string JPARSER::JParserElementInterface::__help
protected

Definition at line 457 of file JParser.hh.


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