Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

NML Class Reference

#include <NML.h>

List of all members.


Detailed Description

NML (news markup language for Journaline).


Public Types

typedef unsigned short NewsObjectId_t
 NML object id.

enum  object_type_t {
  INVALID, MENU, PLAIN, TITLE,
  LIST
}
 NML object types. More...


Public Methods

 NML ()
 default NML constructor

 NML (const NML &prototype)
 copy NML constructor

 ~NML ()
 destructor

const NML & operator= (const NML &prototype)
 NML assignment operator.

bool operator== (const NML &prototype) const
 NML comparison operator.

std::ostream & operator<< (std::ostream &os) const
 dump news object to stream

std::string Dump (void) const
 dump the news object as string

bool isValid (void) const
 check whether NML object is valid

bool isRootObject (void) const
 check whether NML object is the root object

bool isMenu (void) const
 check whether NML object is a menu

bool isStatic (void) const
 check whether NML object is static

object_type_t GetObjectType (void) const
 NML object type.

const char * GetObjectTypeString (void) const
 NML object type string.

NewsObjectId_t GetObjectId (void) const
 NML object id.

unsigned char GetRevisionIndex (void) const
 NML revision index.

std::string GetExtendedHeader (void) const
 NML extended header.

std::string GetTitle (void) const
 title of NML object

unsigned int GetNrOfItems (void) const
 number of items contained in NML object

const std::vector< Item_t > & GetItems (void) const
 vector of items contained in NML object

std::string GetItemText (unsigned int i) const
 get specified item contained in NML object

NewsObjectId_t GetLinkId (unsigned int i) const
 get specified link id contained in NML menu.

bool isLinkIdAvailable (unsigned int i) const
 check availability of a depending link id

void SetObjectId (NewsObjectId_t oid)
 set object id

void SetLinkAvailability (unsigned int i, bool f)
 set i-th linked object id (in a menu) availability flag

void SetError (NewsObjectId_t oid, const char *title)
void SetErrorDump (NewsObjectId_t oid, const RawNewsObject_t &rno, const char *error_msg)
 set NML to an error object generates a fake NML object containing an error message.


Static Public Attributes

const unsigned int NML_MAX_LEN = 2044
 maximum length of a raw NML object

const unsigned int NML_MAX_NR_OF_LEVELS = 20
 maximum number of hierarchy levels

const unsigned int NML_MAX_NR_OF_MENU_ITEMS = 32
 maximum number of menu items

const unsigned int MAX_NR_OF_WATCHES = NML::NML_MAX_NR_OF_MENU_ITEMS + 1
 maximum number of watches

const unsigned int NML_MIN_NR_OF_ITEM_BYTES = 3
 minimum number of bytes in a menu or list item

const unsigned int NML_NR_OF_HEADER_BYTES = 3
 number of header bytes

const unsigned short ROOT_OBJECT_ID = 0x0000
 object id of root object

const char * ObjectTypeString []
 textual description of NML object types


Private Attributes

bool _valid
News_t _news
NMLEscapeCodeHandler_EscapeCodeHandler

Friends

class NMLFactory


Member Typedef Documentation

typedef unsigned short NML::NewsObjectId_t
 

NML object id.


Member Enumeration Documentation

enum NML::object_type_t
 

NML object types.

Enumeration values:
INVALID 
MENU 
PLAIN 
TITLE 
LIST 


Constructor & Destructor Documentation

NML::NML  
 

default NML constructor

NML::NML const NML &    prototype
 

copy NML constructor

Parameters:
prototype  NML object to clone

NML::~NML  
 

destructor


Member Function Documentation

std::string NML::Dump void    const
 

dump the news object as string

Returns :
dump as string

std::string NML::GetExtendedHeader void    const [inline]
 

NML extended header.

Returns :
extended header as string

const std::vector<Item_t>& NML::GetItems void    const [inline]
 

vector of items contained in NML object

Returns :
items for lists and menus, empty otherwise

std::string NML::GetItemText unsigned int    i const [inline]
 

get specified item contained in NML object

Returns :
item text of i-th item

NewsObjectId_t NML::GetLinkId unsigned int    i const [inline]
 

get specified link id contained in NML menu.

Will only have a useful value if

  • the NML object is a menu
  • the index is not out of range
Returns :
link id of i-th menu item

unsigned int NML::GetNrOfItems void    const [inline]
 

number of items contained in NML object

Returns :
number of items for lists and menus, 0 otherwise

NewsObjectId_t NML::GetObjectId void    const [inline]
 

NML object id.

Returns :
object id

object_type_t NML::GetObjectType void    const [inline]
 

NML object type.

Returns :
object type

const char* NML::GetObjectTypeString void    const [inline]
 

NML object type string.

Returns :
object type as string

unsigned char NML::GetRevisionIndex void    const [inline]
 

NML revision index.

Returns :
revision index

std::string NML::GetTitle void    const [inline]
 

title of NML object

Returns :
title in UTF8-Coding

bool NML::isLinkIdAvailable unsigned int    i const [inline]
 

check availability of a depending link id

Parameters:
i  index of item in menu
Return values:
true  iff item's link id is available

bool NML::isMenu void    const [inline]
 

check whether NML object is a menu

Return values:
true  if object is a menu object

bool NML::isRootObject void    const [inline]
 

check whether NML object is the root object

Return values:
true  if object is the root object

bool NML::isStatic void    const [inline]
 

check whether NML object is static

Return values:
true  if object is static

bool NML::isValid void    const [inline]
 

check whether NML object is valid

Return values:
false  iff fake news object (error message)

std::ostream & NML::operator<< std::ostream &    os const
 

dump news object to stream

Parameters:
os  output stream to dump to
Returns :
output stream (for chained stream io)

const NML & NML::operator= const NML &    prototype
 

NML assignment operator.

Parameters:
prototype  NML object to clone
Returns :
reference to cloned object

bool NML::operator== const NML &    prototype const
 

NML comparison operator.

Parameters:
prototype  NML object to compare this with
Return values:
true  NML objects are equal

void NML::SetError NewsObjectId_t    oid,
const char *    title
 

void NML::SetErrorDump NewsObjectId_t    oid,
const RawNewsObject_t   rno,
const char *    error
 

set NML to an error object generates a fake NML object containing an error message.

The title of the error message will be error_msg, and the body will consist of a hex dump of the erroneous raw NML object. and a hex dump of the raw news object

Parameters:
oid  NML object id
rno  raw NML object
error  error message

void NML::SetLinkAvailability unsigned int    i,
bool    f
[inline]
 

set i-th linked object id (in a menu) availability flag

Parameters:
i  index
f  new availability value

void NML::SetObjectId NewsObjectId_t    oid [inline]
 

set object id

Parameters:
oid  object id


Friends And Related Function Documentation

friend class NMLFactory [friend]
 


Member Data Documentation

NMLEscapeCodeHandler* NML::_EscapeCodeHandler [private]
 

News_t NML::_news [private]
 

bool NML::_valid [private]
 

const unsigned int NML::MAX_NR_OF_WATCHES = NML::NML_MAX_NR_OF_MENU_ITEMS + 1 [static]
 

maximum number of watches

const unsigned int NML::NML_MAX_LEN = 2044 [static]
 

maximum length of a raw NML object

const unsigned int NML::NML_MAX_NR_OF_LEVELS = 20 [static]
 

maximum number of hierarchy levels

const unsigned int NML::NML_MAX_NR_OF_MENU_ITEMS = 32 [static]
 

maximum number of menu items

const unsigned int NML::NML_MIN_NR_OF_ITEM_BYTES = 3 [static]
 

minimum number of bytes in a menu or list item

const unsigned int NML::NML_NR_OF_HEADER_BYTES = 3 [static]
 

number of header bytes

const char * NML::ObjectTypeString [static]
 

Initial value:

  {"illegal", "menu", "plain", "title", "list"}
textual description of NML object types

const NML::NewsObjectId_t NML::ROOT_OBJECT_ID = 0x0000 [static]
 

object id of root object


The documentation for this class was generated from the following files:
Generated on Thu Mar 18 13:10:33 2004 for journaline_demo by doxygen1.2.17