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

CP_XMLAttributes Class Reference

A class to handle xml element attributes. More...

List of all members.

Public Member Functions

Constructor / Destructor
 CP_XMLAttributes ()
 Constructor.
 CP_XMLAttributes (const XML_Char **inAttributes)
 CP_XMLAttributes (CFDictionaryRef inAttributes)
Attribute List
bool HasAttribute (const CP_String &inAttributeName) const
UInt32 GetCount ()
CP_String GetNthAttribute (const SInt32 inIndex)
CP_Attribute_List GetAttributeList ()
Attributes
bool GetBoolValue (const CP_String &inAttributeName)
CP_String GetStringValue (const CP_String &inAttributeName)
char GetCharValue (const CP_String &inAttributeName)
SInt16 GetSInt16Value (const CP_String &inAttributeName)
UInt16 GetUInt16Value (const CP_String &inAttributeName)
SInt32 GetSInt32Value (const CP_String &inAttributeName)
UInt32 GetUInt32Value (const CP_String &inAttributeName)
float GetFloatValue (const CP_String &inAttributeName)

Protected Attributes

CP_Attribute_List fAttributes


Detailed Description

A class to handle getting the attributes from an XML stream. All of the data passed to your object from the XML streams is passed as a list of CP_XMLAttributes. To retrieve the data you need to ask the passed in attributes for the data that corresponds to the tag contained in inAttributeName.


Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_XMLAttributes::CP_XMLAttributes  ) 
 

Constructor.

Exceptions:
none 

CP_XMLAttributes::CP_XMLAttributes const XML_Char **  inAttributes  ) 
 

Constructor.

Parameters:
inAttributes A list of the attributes from the XML parser.
Exceptions:
none 

CP_XMLAttributes::CP_XMLAttributes CFDictionaryRef  inAttributes  ) 
 

Constructor.

Parameters:
inAttributes A CFDictionaryRef list of the attributes.
Exceptions:
none 


Member Function Documentation

bool CP_XMLAttributes::HasAttribute const CP_String inAttributeName  )  const
 

Returns true if this object contains an attribute with the passed in name.

Parameters:
inAttributeName The name of the attribute we are looking for.
Exceptions:
none 
Returns:
bool const Returns true if the attribute if contained in this list.

UInt32 CP_XMLAttributes::GetCount  ) 
 

Returns the number of attributes in the list of attributes.

Exceptions:
none 
Returns:
UInt32 The number of attributes in our list of attributes.

CP_String CP_XMLAttributes::GetNthAttribute const SInt32  inIndex  ) 
 

Returns the nth attribute from our list of attributes. inIndex should be between 1 and the total number of attributes in the list of attributes.

Parameters:
inIndex The index of the attribute to return. The index should be between 1 and the total number of attributes in the list of attributes.
Exceptions:
none 
Returns:
CP_String Returns the attribute as a CP_String.

CP_Attribute_List CP_XMLAttributes::GetAttributeList  ) 
 

Returns the list of attributes.

Exceptions:
none 
Returns:
CP_Attribute_List List of attributes.

bool CP_XMLAttributes::GetBoolValue const CP_String inAttributeName  ) 
 

Returns the attributes as a bool value. If the attribute is not found, then false is returned.

Parameters:
inAttributeName The name of the attribute we are looking for.
Exceptions:
none 
Returns:
bool Returns the attributes value, or false if not found.

CP_String CP_XMLAttributes::GetStringValue const CP_String inAttributeName  ) 
 

Returns the attributes as a CP_String. If the attribute is not found, then an empty string is returned.

Parameters:
inAttributeName The name of the attribute we are looking for.
Exceptions:
none 
Returns:
CP_String Returns the attributes value as a CP_String, if the attribute is not found, an empty string is returned.

char CP_XMLAttributes::GetCharValue const CP_String inAttributeName  ) 
 

Returns the attributes as a char. If the attribute is not found, then 0 is returned.

Parameters:
inAttributeName The name of the attribute we are looking for.
Exceptions:
none 
Returns:
char Returns the attributes value as a char, if the attribute is not found, 0 is returned.

SInt16 CP_XMLAttributes::GetSInt16Value const CP_String inAttributeName  ) 
 

Returns the attributes as a SInt16. If the attribute is not found, then 0 is returned.

Parameters:
inAttributeName The name of the attribute we are looking for.
Exceptions:
none 
Returns:
SInt16 Returns the attributes value as a SInt16, if the attribute is not found, 0 is returned.

UInt16 CP_XMLAttributes::GetUInt16Value const CP_String inAttributeName  ) 
 

Returns the attributes as a UInt16. If the attribute is not found, then 0 is returned.

Parameters:
inAttributeName The name of the attribute we are looking for.
Exceptions:
none 
Returns:
UInt16 Returns the attributes value as a UInt16, if the attribute is not found, 0 is returned.

SInt32 CP_XMLAttributes::GetSInt32Value const CP_String inAttributeName  ) 
 

Returns the attributes as a SInt32. If the attribute is not found, then 0 is returned.

Parameters:
inAttributeName The name of the attribute we are looking for.
Exceptions:
none 
Returns:
SInt32 Returns the attributes value as a SInt32, if the attribute is not found, 0 is returned.

UInt32 CP_XMLAttributes::GetUInt32Value const CP_String inAttributeName  ) 
 

Returns the attributes as a UInt32. If the attribute is not found, then 0 is returned.

Parameters:
inAttributeName The name of the attribute we are looking for.
Exceptions:
none 
Returns:
UInt32 Returns the attributes value as a UInt32, if the attribute is not found, 0 is returned.

float CP_XMLAttributes::GetFloatValue const CP_String inAttributeName  ) 
 

Returns the attributes as a float. If the attribute is not found, then 0 is returned.

Parameters:
inAttributeName The name of the attribute we are looking for.
Exceptions:
none 
Returns:
float Returns the attributes value as a float, if the attribute is not found, 0 is returned.


Member Data Documentation

CP_Attribute_List CP_XMLAttributes::fAttributes [protected]
 


The documentation for this class was generated from the following files:
Generated on Tue Sep 20 20:22:24 2005 for CPLAT_MacOS by  doxygen 1.4.0