MySQL 5.6.14 Source Code Document
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Parser< T > Class Template Reference

#include <Parser.hpp>

Classes

class  Context

Public Types

enum  ParserStatus {
  Ok = 0, Eof = 1, NoLine = 2, EmptyLine = 3,
  UnknownCommand = 4, UnknownArgument = 5, TypeMismatch = 6, InvalidArgumentFormat = 7,
  UnknownArgumentType = 8, CommandWithoutFunction = 9, ArgumentGivenTwice = 10, ExternalStop = 11,
  MissingMandatoryArgument = 12
}

Public Member Functions

 Parser (const ParserRow< T > rows[], class InputStream &in=Stdin, bool breakOnCommand=false, bool breakOnEmptyLine=true, bool breakOnInvalidArg=false)
bool run (Context &, T &, volatile bool *stop=0) const
const Propertiesparse (Context &, T &)
bool getBreakOnCommand () const
void setBreakOnCommand (bool v)
bool getBreakOnEmptyLine () const
void setBreakOnEmptyLine (bool v)
bool getBreakOnInvalidArg () const
void setBreakOnInvalidArg (bool v)

Public Attributes

int read_lines
int current_line

Detailed Description

template<class T>
class Parser< T >

A generic parser

Definition at line 261 of file mysqltest.cc.

Member Enumeration Documentation

template<class T>
enum Parser::ParserStatus

Status for parser

Definition at line 46 of file Parser.hpp.

Constructor & Destructor Documentation

template<class T >
Parser< T >::Parser ( const ParserRow< T >  rows[],
class InputStream in = Stdin,
bool  breakOnCommand = false,
bool  breakOnEmptyLine = true,
bool  breakOnInvalidArg = false 
)
inline

Initialize parser

Definition at line 164 of file Parser.hpp.

Member Function Documentation

template<class T >
const Properties * Parser< T >::parse ( Context ctx,
T &  t 
)
inline

Parse only one entry and return Properties object representing the message

Should happen if run returns true

Report alias usage with callback (if specified by user)

Definition at line 219 of file Parser.hpp.

template<class T >
bool Parser< T >::run ( Context ctx,
T &  t,
volatile bool *  stop = 0 
) const
inline

Run parser

Should happen if run returns true

Report alias usage with callback (if specified by user)

Definition at line 179 of file Parser.hpp.


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