filters

#include <TagProcessing.h>

Public Types

enum  AttrType {
  AttrNull = 0 , AttrInt , AttrDouble , AttrBool ,
  AttrTQString
}

Public Member Functions

 AttrProcessing ()
 AttrProcessing (const TQString &n, const TQString &t, void *d) TDE_DEPRECATED
 AttrProcessing (const TQString &_name)
 AttrProcessing (const TQString &_name, int &i)
 AttrProcessing (const TQString &_name, double &d)
 AttrProcessing (const TQString &_name, bool &flag)
 AttrProcessing (const TQString &_name, TQString &str)

Public Attributes

TQString name
AttrType type
void * data

Detailed Description

The class AttrProcessing and the two functions ProcessAttributes () and AllowNoSubtags () allow for easing parsing of the current tag's attributes.

If don't expect any attributes you call AllowNoAttributes (). Otherwise you create a list of AttrProcessing elements and pass that to ProcessAttributes () which will go through all attributes it can find, retrieve the value in the datatype defined, and do all the necessary error handling.

Definition at line 96 of file TagProcessing.h.

Member Enumeration Documentation

◆ AttrType

enum AttrProcessing::AttrType

Definition at line 100 of file TagProcessing.h.

Constructor & Destructor Documentation

◆ AttrProcessing() [1/7]

AttrProcessing::AttrProcessing ( )
inline

Default constructor.

Definition at line 106 of file TagProcessing.h.

◆ AttrProcessing() [2/7]

AttrProcessing::AttrProcessing ( const TQString & n,
const TQString & t,
void * d )

Old constructor (without type checking).

Deprecated
do not use for new code

Definition at line 105 of file TagProcessing.cpp.

◆ AttrProcessing() [3/7]

AttrProcessing::AttrProcessing ( const TQString & _name)
inline

No-op constructor.

This just avoids that a warning is triggered that an attribute is not known

Definition at line 119 of file TagProcessing.h.

◆ AttrProcessing() [4/7]

AttrProcessing::AttrProcessing ( const TQString & _name,
int & i )
inline

Integer constructor.

Get the attribute value as an integer

Definition at line 127 of file TagProcessing.h.

◆ AttrProcessing() [5/7]

AttrProcessing::AttrProcessing ( const TQString & _name,
double & d )
inline

Double constructor.

Get the attribute value as a double

Definition at line 135 of file TagProcessing.h.

◆ AttrProcessing() [6/7]

AttrProcessing::AttrProcessing ( const TQString & _name,
bool & flag )
inline

Boolean constructor.

Get the attribute value as a bool (The values "yes,", "no", "true", "false", "0" and "1" are supported)

Definition at line 144 of file TagProcessing.h.

◆ AttrProcessing() [7/7]

AttrProcessing::AttrProcessing ( const TQString & _name,
TQString & str )
inline

String constructor.

Get the attribute value as a TQString

Definition at line 152 of file TagProcessing.h.

Member Data Documentation

◆ data

void* AttrProcessing::data

Definition at line 159 of file TagProcessing.h.

◆ name

TQString AttrProcessing::name

Definition at line 157 of file TagProcessing.h.

◆ type

AttrType AttrProcessing::type

Definition at line 158 of file TagProcessing.h.


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