Read@CVL
rdf::PageXmlParser Class Reference

#include <PageParser.h>

Public Types

enum  RootTags {
  tag_root, tag_page, tag_meta, tag_layers,
  tag_meta_creator, tag_meta_created, tag_meta_changed, attr_imageFilename,
  attr_imageWidth, attr_imageHeight, attr_text_type, attr_xmlns,
  attr_xsi, attr_schemaLocation, tag_end
}
 
enum  LoadStatus {
  status_not_loaded = 0, status_file_not_found, status_file_locked, status_file_empty,
  status_not_downloaded, status_ok, status_end
}
 

Public Member Functions

 PageXmlParser ()
 
bool read (const QString &xmlPath, bool ignoreLayers=false)
 
void write (const QString &xmlPath, const QSharedPointer< PageElement > pageElement)
 
LoadStatus loadStatus () const
 
QString loadStatusMessage () const
 
QString tagName (const RootTags &tag) const
 
void setPage (QSharedPointer< PageElement > page)
 
QSharedPointer< PageElementpage () const
 

Static Public Member Functions

static QString imagePathToXmlPath (const QString &path, const QString &subDir="")
 

Protected Member Functions

virtual QSharedPointer< PageElementparse (const QByteArray &ba, LoadStatus &status, bool ignoreLayers=false) const
 
virtual void parseRegion (QXmlStreamReader &reader, QSharedPointer< Region > parent) const
 Parses all regions from a PAGE XML hierarchically. More...
 
virtual void parseMetadata (QXmlStreamReader &reader, QSharedPointer< PageElement > page) const
 Parses the metadata of a PAGE XML. More...
 
virtual void parseLayers (QXmlStreamReader &reader, QSharedPointer< PageElement > page, bool ignoreLayers=false) const
 Parses the layers of a PAGE XML. More...
 
QByteArray writePageElement () const
 
void writeMetaData (QXmlStreamWriter &writer) const
 

Protected Attributes

QSharedPointer< PageElementmPage
 
LoadStatus mStatus = status_not_loaded
 

Member Enumeration Documentation

Enumerator
status_not_loaded 
status_file_not_found 
status_file_locked 
status_file_empty 
status_not_downloaded 
status_ok 
status_end 
Enumerator
tag_root 
tag_page 
tag_meta 
tag_layers 
tag_meta_creator 
tag_meta_created 
tag_meta_changed 
attr_imageFilename 
attr_imageWidth 
attr_imageHeight 
attr_text_type 
attr_xmlns 
attr_xsi 
attr_schemaLocation 
tag_end 

Constructor & Destructor Documentation

rdf::PageXmlParser::PageXmlParser ( )

Member Function Documentation

QString rdf::PageXmlParser::imagePathToXmlPath ( const QString &  path,
const QString &  subDir = "" 
)
static
PageXmlParser::LoadStatus rdf::PageXmlParser::loadStatus ( ) const
QString rdf::PageXmlParser::loadStatusMessage ( ) const
QSharedPointer< PageElement > rdf::PageXmlParser::page ( ) const
QSharedPointer< PageElement > rdf::PageXmlParser::parse ( const QByteArray &  ba,
LoadStatus status,
bool  ignoreLayers = false 
) const
protectedvirtual
void rdf::PageXmlParser::parseLayers ( QXmlStreamReader &  reader,
QSharedPointer< PageElement page,
bool  ignoreLayers = false 
) const
protectedvirtual

Parses the layers of a PAGE XML.

Parameters
readerThe reader.
pageThe page.
void rdf::PageXmlParser::parseMetadata ( QXmlStreamReader &  reader,
QSharedPointer< PageElement page 
) const
protectedvirtual

Parses the metadata of a PAGE XML.

Parameters
readerThe XML reader.
pageThe page element.
void rdf::PageXmlParser::parseRegion ( QXmlStreamReader &  reader,
QSharedPointer< Region parent 
) const
protectedvirtual

Parses all regions from a PAGE XML hierarchically.

Parameters
readerThe XML Reader.
parentThe parent of the region which is parsed next.
bool rdf::PageXmlParser::read ( const QString &  xmlPath,
bool  ignoreLayers = false 
)
void rdf::PageXmlParser::setPage ( QSharedPointer< PageElement page)
QString rdf::PageXmlParser::tagName ( const RootTags tag) const
void rdf::PageXmlParser::write ( const QString &  xmlPath,
const QSharedPointer< PageElement pageElement 
)
void rdf::PageXmlParser::writeMetaData ( QXmlStreamWriter &  writer) const
protected
QByteArray rdf::PageXmlParser::writePageElement ( ) const
protected

Member Data Documentation

QSharedPointer<PageElement> rdf::PageXmlParser::mPage
protected
LoadStatus rdf::PageXmlParser::mStatus = status_not_loaded
protected

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