aja::DocumentHeader Class Reference

class representing DOCUMENT ITEM. More...

#include <DocumentHeader.h>

Inheritance diagram for aja::DocumentHeader:

aja::Item List of all members.

Public Member Functions

 DocumentHeader ()
 create document header for version 1.0
byte_t getVersion ()
 Function return version of document.
number_t getItemSize ()
 function return a complete size of item.
bool buildAja (OutputBuffer &out)
 Function build AJA binary form of document header.
std::string getValueStr (const char *value_name)
 Function return value by name like string.
int getValueInt (const char *value_name)
 Function return value by name like 32 bit integer.
bool setValue (const char *value_name, const std::string &value)
bool setValue (const char *value_name, const char *value)
 Function create new value or when value exist then set it.
bool setValue (const char *value_name, const int value)
 Function create new value or when value exist then set it.
transElm_tgetTransElement (number_t elm_id)
 Function return pointer to Element in translation table by element's ID.
transElm_tgetTransElement (const char *elm_name)
 Function return pointer to Element in translation table by element's name.
transAttr_tgetTransAttribute (number_t elm_id, byte_t attr_id)
 Function return pointer to Attribute in translation table by attribute's ID.
transAttr_tgetTransAttribute (number_t elm_id, const char *attr_name)
 Function return pointer to Attribute in translation table by attribute's name.
std::string getAttrName (number_t elm_id, byte_t attr_id)
 Function return attribute's name from trans. table by ID.
std::string getElmName (number_t elm_id)
 Function return element's name from trans. table by ID.
bool setTransElement (number_t elm_id, const char *elm_name, elementType_t elm_type=ELM_STRING, const char *elm_desc="")
 Function set existing element in translation table or create new element's informations when dont exist in translation table.
bool setTransAttr (number_t elm_id, byte_t attr_id, const char *attr_name, attributeType_t attr_type=ATTR_STRING, const char *attr_desc="")
 Function set existing atrribute in translation table or create new attribute's informations when dont exist in translation tab.

Static Public Member Functions

static DocumentHeaderparseDocument (const buffer_t buffer, unsigned int size, unsigned int &pos)
 This function parse document header in buffer.

Detailed Description

class representing DOCUMENT ITEM.

This class contain all needed functions manipulating with document values and translation table. This class parse data to AJA-ML documents, convert from AJA-ML to XML and build AJA-ML document. Class contain information about version of AJA-ML document.


Constructor & Destructor Documentation

aja::DocumentHeader::DocumentHeader  ) 
 

create document header for version 1.0


Member Function Documentation

bool aja::DocumentHeader::buildAja OutputBuffer out  )  [virtual]
 

Function build AJA binary form of document header.

Parameters:
out Into this class is written AJA binary result of building process.
Returns:
true id ok, false when error was occurred

Implements aja::Item.

string aja::DocumentHeader::getAttrName number_t  elm_id,
byte_t  attr_id
 

Function return attribute's name from trans. table by ID.

Parameters:
elm_id ID of element contained attribute
attr_id ID of attribute
Returns:
name, when dont exist in translation table, then is returned empty string

string aja::DocumentHeader::getElmName number_t  elm_id  ) 
 

Function return element's name from trans. table by ID.

Parameters:
elm_id ID of element
Returns:
name, when dont exist in translation table, then is returned empty string

number_t aja::DocumentHeader::getItemSize  )  [virtual]
 

function return a complete size of item.

Returns:
size of item in butes

Implements aja::Item.

transAttr_t * aja::DocumentHeader::getTransAttribute number_t  elm_id,
const char *  attr_name
 

Function return pointer to Attribute in translation table by attribute's name.

Parameters:
elm_id ID of element contained attribute
attr_name name of attribute
Returns:
pointer to attribute's information structure in translation table.When dont exist, then is returned NULL.

transAttr_t * aja::DocumentHeader::getTransAttribute number_t  elm_id,
byte_t  attr_id
 

Function return pointer to Attribute in translation table by attribute's ID.

Parameters:
elm_id ID of element contained attribute
attr_id ID of attribute
Returns:
pointer to attribute's information structure in translation table.When dont exist, then is returned NULL.

transElm_t * aja::DocumentHeader::getTransElement const char *  elm_name  ) 
 

Function return pointer to Element in translation table by element's name.

Parameters:
elm_name name of element
Returns:
pointer to element's information structure in translation table.When dont exist, then is returned NULL.

transElm_t * aja::DocumentHeader::getTransElement number_t  elm_id  ) 
 

Function return pointer to Element in translation table by element's ID.

Parameters:
elm_id ID of searched element
Returns:
pointer to element's information structure in translation table.When dont exist, then is returned NULL.

int aja::DocumentHeader::getValueInt const char *  value_name  ) 
 

Function return value by name like 32 bit integer.

Parameters:
value_name name of value
Returns:
int form of value, when dont exist is returned 0.

string aja::DocumentHeader::getValueStr const char *  value_name  ) 
 

Function return value by name like string.

Parameters:
value_name name of value
Returns:
string form of value, when dont exist, is returned empty string

byte_t aja::DocumentHeader::getVersion  ) 
 

Function return version of document.

DocumentHeader * aja::DocumentHeader::parseDocument const buffer_t  buffer,
unsigned int  size,
unsigned int &  pos
[static]
 

This function parse document header in buffer.

Function start building of document header at current position in buffer.When data in buffer are incorrect,not complete or is occured other error in parsing, then is returned NULL, otherwise is returned pointer to DocumentHeader class.

Parameters:
buffer buffer contained data for parsing
size size of buffer
pos position where starting parsing, after parsing this varibale contain position after parsed data.
Returns:
pointer to new created DocumentHeader, NULL when occured some error in parsing.

bool aja::DocumentHeader::setTransAttr number_t  elm_id,
byte_t  attr_id,
const char *  attr_name,
attributeType_t  attr_type = ATTR_STRING,
const char *  attr_desc = ""
 

Function set existing atrribute in translation table or create new attribute's informations when dont exist in translation tab.

Parameters:
attr_id ID of element
attr_name name of element
attr_type type of aja element(default is ELM_STRING)
attr_desc description of element(default is "")
Returns:
true when is added, false when some error occured

bool aja::DocumentHeader::setTransElement number_t  elm_id,
const char *  elm_name,
elementType_t  elm_type = ELM_STRING,
const char *  elm_desc = ""
 

Function set existing element in translation table or create new element's informations when dont exist in translation table.

Parameters:
elm_id ID of element
elm_name name of element
elm_type type of aja element(default is ELM_STRING)
elm_desc description of element(default is "")
Returns:
true when is added, false when some error occured

bool aja::DocumentHeader::setValue const char *  value_name,
const int  value
 

Function create new value or when value exist then set it.

Parameters:
value_name name of value
value value to set
Returns:
TRUE means ok, FALSE means error

bool aja::DocumentHeader::setValue const char *  value_name,
const char *  value
 

Function create new value or when value exist then set it.

Parameters:
value_name name of value
value value to set
Returns:
TRUE means ok, FALSE means error

bool aja::DocumentHeader::setValue const char *  value_name,
const std::string &  value
 


The documentation for this class was generated from the following files:
Generated on Sun Mar 4 00:30:37 2007 for LIBAJA by  doxygen 1.4.6