class SugElement

SugElement is really the current heart of libsugar.

Inheritance:


Public Methods

[more] SugElement ()
The class constructor
[more]void addAttribute (char* name, char* value)
Adds an attribute and it's corresponding value to the attribute map
[more]bool getColorAttribute (char* attrName, SugColor& attrValue)
Gets the specified attribute's value in color format.
[more]SugTypes::ElementType getElementType ()
returns the mElementType, this is later used for casting
[more]bool getFloatAttribute (char* attrName, float& attrValue)
Gets the specified attribute's value in float format.
[more]const char* getId ()
Returns the id of this element.
[more]bool getIntegerAttribute (char* attrName, int& attrValue)
Gets the specified attribute's value in integer format.
[more]bool getPointListAttribute (char* attrName, vector<SugPoint>& attrValue)
Gets the specified attribute's value in point list format.
[more]const char* getStringAttribute (char* attrName)
Gets the specified attribute's value in string format.
[more]bool getTransformListAttribute (vector<SugTransform>& attrValue)
Gets the "transform" attribute's value in transform list format.
[more]void printAttributes ()
Debug function that prints the names and values of all attributes
[more]void setElementType (SugTypes::ElementType newType)
sets the mElementType of this class
[more] ~SugElement ()
The class destructor

Protected Fields

[more]map<string, string> mAttributes
A map containing all the attributes of this element.
[more]SugTypes::ElementType mElementType
This is the element type identifier, this is how we know what to cast our element as (see above)


Inherited from SugNode:

Public Methods

oSugNode* appendChild(SugNode* newChild)
ovector<SugNode> * getChildNodes()
oSugNode* getFirstChild()
oSugNode* getLastChild()
oSugNode* getNextSibling()
ochar* getNodeName()
ounsigned short getNodeType()
ochar* getNodeValue()
oSugNode* getParentNode()
oSugNode* getPreviousSibling()
obool hasAttributes()
obool hasChildNodes()
oSugNode* insertBefore(SugNode* newChild, SugNode* refChild)
oSugNode* removeChild(SugNode* oldChild)
oSugNode* replaceChild(SugNode* newChild, SugNode* oldChild)
oSugNode* setFirstChild(SugNode* newFirstChild)
oSugNode* setLastChild(SugNode* newLastChild)
oSugNode* setNextSibling(SugNode* newNextSibling)
ochar* setNodeName(char* newNodeName)
ounsigned short setNodeType(unsigned short newNodeType)
ochar* setNodeValue(char* newNodeValue)
oSugNode* setParentNode(SugNode* newParentNode)
oSugNode* setPreviousSibling(SugNode* newPreviousSibling)

Protected Fields

ovector<SugNode> mChildNodes
oSugNode* mFirstChild
oSugNode* mLastChild
oSugNode* mNextSibling
ochar* mNodeName
ounsigned short mNodeType
ochar* mNodeValue
oSugNode* mParentNode
oSugNode* mPreviousSibling


Documentation

SugElement is really the current heart of libsugar. The parser will output a vector of SugElements. These SugElements are not of type SugElement but are of one of a derived class, so you can think of SugElement as the cookie cutter parent class that they all conform to.
oSugTypes::ElementType mElementType
This is the element type identifier, this is how we know what to cast our element as (see above)

omap<string, string> mAttributes
A map containing all the attributes of this element. It is a string to string mapping.

oconst char* getStringAttribute(char* attrName)
Gets the specified attribute's value in string format.

Parameters:
attrName - The name of the attribute we are getting the value for.
Returns:
The attribute's value in string format. NULL if the attribute doesn't exist in the element.

obool getIntegerAttribute(char* attrName, int& attrValue)
Gets the specified attribute's value in integer format.

Parameters:
attrName - The name of the attribute we are getting the value for.
attrValue - The value of the attribute.
Returns:
Boolean value indicating whether or not the attribute exists in this element.

obool getFloatAttribute(char* attrName, float& attrValue)
Gets the specified attribute's value in float format.

Parameters:
attrName - The name of the attribute we are getting the value for.
attrValue - The value of the attribute.
Returns:
Boolean value indicating whether or not the attribute exists in this element.

obool getColorAttribute(char* attrName, SugColor& attrValue)
Gets the specified attribute's value in color format.

Parameters:
attrName - The name of the attribute we are getting the value for.
attrValue - The value of the attribute.
Returns:
Boolean value indicating whether or not the attribute exists in this element.

obool getPointListAttribute(char* attrName, vector<SugPoint>& attrValue)
Gets the specified attribute's value in point list format.

Parameters:
attrName - The name of the attribute we are getting the value for.
attrValue - The value of the attribute.
Returns:
Boolean value indicating whether or not the attribute exists in this element.

obool getTransformListAttribute(vector<SugTransform>& attrValue)
Gets the "transform" attribute's value in transform list format.

Parameters:
attrValue - The value of the attribute.
Returns:
Boolean value indicating whether or not the attribute exists in this element.

oconst char* getId()
Returns the id of this element.

Returns:
The id string if it exists, NULL otherwise.

oSugTypes::ElementType getElementType()
returns the mElementType, this is later used for casting

ovoid setElementType(SugTypes::ElementType newType)
sets the mElementType of this class

ovoid addAttribute(char* name, char* value)
Adds an attribute and it's corresponding value to the attribute map

ovoid printAttributes()
Debug function that prints the names and values of all attributes

o SugElement()
The class constructor

o ~SugElement()
The class destructor


Direct child classes:
SugUseElement
SugTextElement
SugSymbolElement
SugSvgElement
SugRectElement
SugPolylineElement
SugPolygonElement
SugPathElement
SugGroupElement
SugDocument
SugDefsElement

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.