Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DBXmlHandler Class Reference

An Xml parser for flat tables. More...

#include </home/clem/local/src/opie/noncore/apps/tableviewer/db/xmlsource.h>

Collaboration diagram for DBXmlHandler:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DBXmlHandler (DBStore *ds)
virtual ~DBXmlHandler ()
QString errorProtocol ()
bool startDocument ()
bool startElement (const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
bool endElement (const QString &namespaceURI, const QString &localName, const QString &qName)
bool characters (const QString &ch)
QString errorString ()
bool warning (const QXmlParseException &exception)
bool error (const QXmlParseException &exception)
bool fatalError (const QXmlParseException &exception)

Private Types

enum  State {
  StateInit, StateHeader, StateKey, StateDocument,
  StateRecord, StateField
}

Private Attributes

QStack< QStringstack
KeyListcurrent_keyrep
DataElemcurrent_data
TVVariant::KeyType last_key_type
QString errorProt
DBStoredata_store
State state
QDict< int > keyIndexList
int keyIndex
QString key

Detailed Description

An Xml parser for flat tables.

An xml parser for parsing the files used by the table viewer application.

The format of the xml files can be found at the front of the file dataparser.h

Definition at line 69 of file xmlsource.h.


Member Enumeration Documentation

enum DBXmlHandler::State [private]
 

Enumeration values:
StateInit 
StateHeader 
StateKey 
StateDocument 
StateRecord 
StateField 

Definition at line 103 of file xmlsource.h.


Constructor & Destructor Documentation

DBXmlHandler::DBXmlHandler DBStore ds  ) 
 

Constructs a new DBXmlHandler, and sets that the table should be constructed in the DBStore pointed to by ds.

Definition at line 134 of file xmlsource.cpp.

References current_keyrep, and data_store.

DBXmlHandler::~DBXmlHandler  )  [virtual]
 

Destroys the DBXmlHandler

Definition at line 143 of file xmlsource.cpp.


Member Function Documentation

bool DBXmlHandler::characters const QString ch  ) 
 

Definition at line 241 of file xmlsource.cpp.

References KeyList::addKey(), current_data, current_keyrep, QDict< type >::insert(), QString::isEmpty(), key, keyIndex, keyIndexList, last_key_type, oendl, owarn, DataElem::setField(), state, StateField, StateKey, and TRUE.

bool DBXmlHandler::endElement const QString namespaceURI,
const QString localName,
const QString qName
 

Definition at line 209 of file xmlsource.cpp.

References DBStore::addItem(), current_data, current_keyrep, data_store, FALSE, oendl, owarn, DBStore::setKeys(), state, StateDocument, StateField, StateHeader, StateKey, StateRecord, and TRUE.

bool DBXmlHandler::error const QXmlParseException &  exception  ) 
 

Definition at line 283 of file xmlsource.cpp.

References errorProt, oendl, and owarn.

QString DBXmlHandler::errorProtocol  ) 
 

Definition at line 147 of file xmlsource.cpp.

References errorProt, oendl, and owarn.

QString DBXmlHandler::errorString  ) 
 

Definition at line 267 of file xmlsource.cpp.

bool DBXmlHandler::fatalError const QXmlParseException &  exception  ) 
 

Definition at line 294 of file xmlsource.cpp.

References errorProt, oendl, and owarn.

bool DBXmlHandler::startDocument  ) 
 

Definition at line 153 of file xmlsource.cpp.

References errorProt, state, StateInit, and TRUE.

bool DBXmlHandler::startElement const QString namespaceURI,
const QString localName,
const QString qName,
const QXmlAttributes &  atts
 

Definition at line 160 of file xmlsource.cpp.

References current_data, current_keyrep, data_store, FALSE, QString::isEmpty(), key, keyIndex, keyIndexList, last_key_type, TVVariant::nameToType(), oendl, owarn, DBStore::setName(), state, StateDocument, StateField, StateHeader, StateInit, StateKey, StateRecord, TVVariant::String, and TRUE.

bool DBXmlHandler::warning const QXmlParseException &  exception  ) 
 

Definition at line 272 of file xmlsource.cpp.

References errorProt, oendl, and owarn.


Member Data Documentation

DataElem* DBXmlHandler::current_data [private]
 

Definition at line 97 of file xmlsource.h.

Referenced by characters(), endElement(), and startElement().

KeyList* DBXmlHandler::current_keyrep [private]
 

Definition at line 96 of file xmlsource.h.

Referenced by characters(), DBXmlHandler(), endElement(), and startElement().

DBStore* DBXmlHandler::data_store [private]
 

Definition at line 101 of file xmlsource.h.

Referenced by DBXmlHandler(), endElement(), and startElement().

QString DBXmlHandler::errorProt [private]
 

Definition at line 100 of file xmlsource.h.

Referenced by error(), errorProtocol(), fatalError(), startDocument(), and warning().

QString DBXmlHandler::key [private]
 

Definition at line 116 of file xmlsource.h.

Referenced by characters(), and startElement().

int DBXmlHandler::keyIndex [private]
 

Definition at line 115 of file xmlsource.h.

Referenced by characters(), and startElement().

QDict<int> DBXmlHandler::keyIndexList [private]
 

Definition at line 114 of file xmlsource.h.

Referenced by characters(), and startElement().

TVVariant::KeyType DBXmlHandler::last_key_type [private]
 

Definition at line 98 of file xmlsource.h.

Referenced by characters(), and startElement().

QStack<QString> DBXmlHandler::stack [private]
 

Definition at line 95 of file xmlsource.h.

State DBXmlHandler::state [private]
 

Definition at line 112 of file xmlsource.h.

Referenced by characters(), endElement(), startDocument(), and startElement().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:30:50 2005 for OPIE by  doxygen 1.4.2