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

BxCharacter8 Class Reference

Class implementing the BinX data type character as Latin-1. More...

#include <BxCharacter8.h>

Inheritance diagram for BxCharacter8:

BxByte8 BxInteger BxDataObject BxObject List of all members.

Public Member Functions

 BxCharacter8 ()
 BxCharacter8 (const BxCharacter8 &)
 BxCharacter8 (const bx_char8)
virtual bool equals (const BxDataObject &) const
virtual char * toString (bool xml)
virtual bool parseValue (const char *)
BxCharacter8operator= (const bx_char8)

Detailed Description

Instances of this class hold and perform operations on the BinX XML Schema type <character-8>. The class provides manipulations such as:
Since: BinX version 1.0.


Constructor & Destructor Documentation

BxCharacter8::BxCharacter8  ) 
 

Default constructor.

Constructs and initialises an instance of the class BxCharacter8. Default attribute values are assigned as follows:

       sizeInBits_ = 8;
       sizeInBytes_ = 1; 
       sizeInAll_ = 1; 
   

BxCharacter8::BxCharacter8 const BxCharacter8 copy  ) 
 

Construct a BxCharacter8 instance by copying a specified BxCharacter8 instance.

Constructs and initialises an instance of the class BxCharacter8 .

Parameters:
copy A reference to the BxCharacter8 instance to copy.

BxCharacter8::BxCharacter8 const bx_char8  c  ) 
 

Construct a BxCharacter8 instance and assign it a specified character value.

Constructs and initialises an instance of the class BxCharacter8 .

Parameters:
c A single character value initialise the BxCharacter8 instance.


Member Function Documentation

bool BxCharacter8::equals const BxDataObject dataObj  )  const [virtual]
 

Compares the value of a specified data object with the value of this object.

In this method, two objects are considered to be equal if they are of the same BinX object type and if they store the same data value. Also, only primitive BinX data types implement this method.

Parameters:
dataObj A reference to another data object to be compared with this object.
Returns:
true If the data type and value of the two objects are equal,
false If the objects differ in type or value.

Reimplemented from BxByte8.

BxCharacter8 & BxCharacter8::operator= const bx_char8  c  ) 
 

Overloaded operator = assigns one character from a source to a BxCharacter8 destination object.

Parameters:
c A single character value to be assigned to a BxCharacter8 object.
Returns:
A reference to this BxCharacter8 object after the assignment has been performed.

bool BxCharacter8::parseValue const char *  strVal  )  [virtual]
 

Convert an ASCII number into a single character value and assign the value to this object.

The data contained in the input string is assumed to be an ASCII value in decimal, as such, the converted character value is assigned as the value of this object. Only primitive BinX data types implement this method.

Parameters:
strVal A pointer to the string to extract a character value from.
Returns:
true If value extraction and assignment was successful,
false If the input string is NULL.

Reimplemented from BxByte8.

char * BxCharacter8::toString bool  xml  )  [virtual]
 

Return a string containing the DataBinX XML element (or printable value only ) for this BxCharacter8 object.

The DataBinX representation of a BxCharacter8 object value consists of:

  • The BinX XML tags, <character-8> and </character-8>
  • The character value, represented by 4 characters corresponding to the hexadecimal value for the single character
  • Optional BinX XML schema attributes (name-value pairs) associated with the character value
Example Return Result:
<character-8 varName="SectionMark">0x53</character-8>
The ASCII character "S" is represented by the hexadecimal value 0x53. These four hexadecimal digits are represented by the four characters "0", "x", "5", "3" in the DataBinX representation. The BinX XML attribute varName provided metadata about the character. In this example the varName value is "SectionMark".
This method allocates memory to hold the returned string. The caller is responsible for releasing the memory when the string is no longer needed.
If only the character value is required, then the input boolean flag can be used to request that only the character value be included in the result string. In the above example, the result string would have length two and would contain a null-terminated letter "S". Note. If parameter xml is given as true, then the returned string should always be hexadecimal number representing the ASCII code for the character. The hexadecimal number is preceded with a prefix "0x", for example, a space is "0x20". If XML output is not required, then the output depends on the character. Specifically, if the character is a printable one, it is put in the string as is, otherwise, a hexadecimal ASCII code is used.
Only BinX primitive data types implement this method.
Parameters:
xml A boolean indicating whether to include BinX XML tags or not.
Returns:
A string buffer containing the DataBinX representation of the value of this object, if the input flag is true,
A string buffer containing the printable representation of the value of this object, if the input flag is false.

Reimplemented from BxByte8.


The documentation for this class was generated from the following files:
Generated on Fri May 6 13:36:18 2005 for edikt::BinX by doxygen 1.3.3