Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

VTQL::Parse Class Reference

Parse a VTQL command line. More...

#include <vtql_parse.h>

List of all members.

Public Methods

void NewString (const std::string &line)
 Parse a new line and delete the old results. More...

int GetCom () const
 Get the arbitrary number of the command. More...

int Int10 (int field, int min=INT_MIN, int max=INT_MAX) const
 Get an integer command argument in decimal base. More...

int Freq (int field) const
 Get an frequency argument. More...

std::string String (int field) const
 Get an string argument. More...

template<typename ModeT> ModeT DecMode (int field) const
 Get an ShowMode or UserMode argument. More...


Detailed Description

Parse a VTQL command line.

This class is mainly used in the server itself, but maybe it is handy to know about it in a client application.


Member Function Documentation

void VTQL::Parse::NewString const std::string &    line
 

Parse a new line and delete the old results.

Parameters:
line  New command line, without a newline character.

int VTQL::Parse::GetCom   const
 

Get the arbitrary number of the command.

Returns:
The index number in the VTQL::cmAllCmds[] array.

int VTQL::Parse::Int10 int    field,
int    min = INT_MIN,
int    max = INT_MAX
const
 

Get an integer command argument in decimal base.

Interpret a field as integer in decimal writing and specify a range for it.

Parameters:
field  Field number. E.g. in "STATION 123 ADD" the field "123" has the field number 1.
min  Minmum value allowed.
max  Maximum value allowed.
Returns:
The value of the field, in the example above: 123

int VTQL::Parse::Freq int    field const
 

Get an frequency argument.

Interpret a field as frequency argument (e.g. '12345' (kHz) or 'europe_west::E2~m3').

Parameters:
field  Field number. E.g. in "FREQ europe_west::E2~m3 ZAP" the field "europe_west::E2~m3" has the field number 1.
Returns:
The frequency in kHz of the field, in the example above: 48063

std::string VTQL::Parse::String int    field const
 

Get an string argument.

Parameters:
field  Field number. E.g. in "STATION 123 NAME 'it''s a '''" the field "europe_west" has the field number 3
Returns:
The field as string (without the "'"s), in the example above "it's a '"

template<typename ModeT>
ModeT VTQL::Parse::DecMode int    field const
 

Get an ShowMode or UserMode argument.

Parameters:
ModeT  This is either UserMode or ShowMode
field  Field Number. E.g. in "SOCKET 123 MODE query" the field "query" has the field number 3
Returns:
The enum value of the field, in the example above UM_QUERY


The documentation for this class was generated from the following file:
Generated on Sun Apr 14 17:37:04 2002 for libvtql by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002