mxml::Element Class Reference

#include <element.h>

Inheritance diagram for mxml::Element:
mxml::Node zmm::Object

Public Member Functions

 Element (zmm::String name)
 Element (zmm::String name, zmm::Ref< Context > context)
zmm::String getAttribute (zmm::String name)
void setAttribute (zmm::String name, zmm::String value, enum mxml_value_type type=mxml_string_type)
zmm::String getText ()
enum mxml_value_type getVTypeText ()
zmm::String getName ()
void setName (zmm::String name)
int attributeCount ()
zmm::Ref< AttributegetAttribute (int index)
void setText (zmm::String text, enum mxml_value_type type=mxml_string_type)
int childCount (enum mxml_node_types type=mxml_node_all)
zmm::Ref< NodegetChild (int index, enum mxml_node_types type=mxml_node_all, bool remove=false)
zmm::Ref< NodegetFirstChild (enum mxml_node_types type=mxml_node_all)
void removeChild (int index, enum mxml_node_types type=mxml_node_all)
void appendChild (zmm::Ref< Node > child)
void insertChild (int index, zmm::Ref< Node > child)
void removeWhitespace ()
void indent (int level=0)
zmm::Ref< ElementgetFirstElementChild ()
zmm::Ref< ElementgetElementChild (int index)
int elementChildCount ()
void removeElementChild (int index)
bool removeElementChild (zmm::String name, bool removeAll)
void appendElementChild (zmm::Ref< Element > child)
void appendTextChild (zmm::String name, zmm::String text, enum mxml_value_type type=mxml_string_type)
int getChildIdByName (zmm::String name)
zmm::Ref< ElementgetChildByName (zmm::String name)
zmm::String getChildText (zmm::String name)
bool isArrayType ()
zmm::String getArrayName ()
void setArrayName (zmm::String arrayName)
zmm::String getTextKey ()
void setTextKey (zmm::String textKey)
enum mxml_node_types getType ()
virtual zmm::String print ()
void retain ()
void release ()
int getRefCount ()

Static Public Member Functions

static void * operator new (size_t size)
static void operator delete (void *ptr)

Protected Member Functions

void addAttribute (zmm::Ref< Attribute > attr)
void addAttribute (zmm::String name, zmm::String value, enum mxml_value_type type=mxml_string_type)
virtual void print_internal (zmm::Ref< zmm::StringBuffer > buf, int indent)

Static Protected Member Functions

static zmm::String escape (zmm::String str)

Protected Attributes

zmm::String name
zmm::Ref< zmm::Array< Attribute > > attributes
bool arrayType
zmm::String arrayName
zmm::String textKey
zmm::Ref< zmm::Array< Node > > children
zmm::Ref< Contextcontext
enum mxml_node_types type
mt_atomic_t _ref_count
pthread_mutex_t mutex

Friends

class Parser

Detailed Description

Definition at line 44 of file element.h.


Constructor & Destructor Documentation

Element::Element ( zmm::String  name  ) 

Definition at line 44 of file element.cc.

References arrayName, arrayType, mxml::mxml_node_element, nil, textKey, and mxml::Node::type.

Referenced by appendTextChild().

Element::Element ( zmm::String  name,
zmm::Ref< Context context 
)

Definition at line 52 of file element.cc.

References arrayName, arrayType, mxml::mxml_node_element, nil, textKey, and mxml::Node::type.


Member Function Documentation

void Element::addAttribute ( zmm::String  name,
zmm::String  value,
enum mxml_value_type  type = mxml_string_type 
) [protected]

Definition at line 74 of file element.cc.

References addAttribute().

void Element::addAttribute ( zmm::Ref< Attribute attr  )  [protected]

Definition at line 80 of file element.cc.

References attributes, and nil.

Referenced by addAttribute(), and setAttribute().

void Element::appendChild ( zmm::Ref< Node child  ) 

Definition at line 174 of file element.cc.

References mxml::Node::children, and nil.

Referenced by appendElementChild(), indent(), and setText().

void mxml::Element::appendElementChild ( zmm::Ref< Element child  )  [inline]

Definition at line 88 of file element.h.

References appendChild(), and RefCast.

Referenced by appendTextChild().

void Element::appendTextChild ( zmm::String  name,
zmm::String  text,
enum mxml_value_type  type = mxml_string_type 
)

Definition at line 360 of file element.cc.

References appendElementChild(), and Element().

int Element::attributeCount (  ) 

Definition at line 324 of file element.cc.

References attributes, and nil.

int Element::childCount ( enum mxml_node_types  type = mxml_node_all  ) 

Definition at line 105 of file element.cc.

References mxml::Node::children, mxml::mxml_node_all, and nil.

Referenced by elementChildCount(), indent(), removeWhitespace(), and setText().

int mxml::Element::elementChildCount (  )  [inline]

Definition at line 83 of file element.h.

References childCount(), and mxml::mxml_node_element.

String Node::escape ( zmm::String  str  )  [static, protected, inherited]

Definition at line 50 of file node.cc.

References zmm::String::c_str(), and zmm::String::length().

Referenced by mxml::Text::print_internal(), and print_internal().

zmm::String mxml::Element::getArrayName (  )  [inline]

Definition at line 98 of file element.h.

References arrayName.

Ref< Attribute > Element::getAttribute ( int  index  ) 

Definition at line 331 of file element.cc.

References attributes, and nil.

String Element::getAttribute ( zmm::String  name  ) 

Definition at line 61 of file element.cc.

References attributes, and nil.

Ref< Node > Element::getChild ( int  index,
enum mxml_node_types  type = mxml_node_all,
bool  remove = false 
)
Ref< Element > Element::getChildByName ( zmm::String  name  ) 

Definition at line 386 of file element.cc.

References getChild(), getChildIdByName(), nil, and RefCast.

Referenced by getChildText().

int Element::getChildIdByName ( zmm::String  name  ) 

Definition at line 369 of file element.cc.

References mxml::Node::children, mxml::mxml_node_element, nil, and RefCast.

Referenced by getChildByName(), and removeElementChild().

String Element::getChildText ( zmm::String  name  ) 

Definition at line 394 of file element.cc.

References getChildByName(), and nil.

zmm::Ref<Element> mxml::Element::getElementChild ( int  index  )  [inline]

Definition at line 82 of file element.h.

References getChild(), mxml::mxml_node_element, and RefCast.

Referenced by getFirstElementChild().

zmm::Ref<Node> mxml::Element::getFirstChild ( enum mxml_node_types  type = mxml_node_all  )  [inline]

Definition at line 73 of file element.h.

References getChild(), and mxml::Node::type.

zmm::Ref<Element> mxml::Element::getFirstElementChild (  )  [inline]

Definition at line 81 of file element.h.

References getElementChild().

zmm::String mxml::Element::getName (  )  [inline]

Definition at line 63 of file element.h.

References name.

int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

References zmm::Object::_ref_count, and atomic_get().

String Element::getText (  ) 

Definition at line 285 of file element.cc.

References getChild(), mxml::mxml_node_text, nil, and RefCast.

zmm::String mxml::Element::getTextKey (  )  [inline]

Definition at line 101 of file element.h.

References textKey.

enum mxml_node_types mxml::Node::getType (  )  [inline, inherited]

Definition at line 60 of file node.h.

References mxml::Node::type.

enum mxml_value_type Element::getVTypeText (  ) 

Definition at line 302 of file element.cc.

References getChild(), mxml::mxml_node_text, mxml::mxml_string_type, nil, and RefCast.

void Element::indent ( int  level = 0  ) 
void Element::insertChild ( int  index,
zmm::Ref< Node child 
)

Definition at line 181 of file element.cc.

References mxml::Node::children, and nil.

Referenced by indent().

bool mxml::Element::isArrayType (  )  [inline]

Definition at line 95 of file element.h.

References arrayType.

void Object::operator delete ( void *  ptr  )  [static, inherited]

Definition at line 87 of file object.cc.

References FREE.

void * Object::operator new ( size_t  size  )  [static, inherited]

Definition at line 83 of file object.cc.

References MALLOC.

String Node::print (  )  [virtual, inherited]

Definition at line 43 of file node.cc.

References mxml::Node::print_internal().

void Element::print_internal ( zmm::Ref< zmm::StringBuffer buf,
int  indent 
) [protected, virtual]

Implements mxml::Node.

Definition at line 402 of file element.cc.

References attributes, mxml::Node::children, mxml::Node::escape(), name, and nil.

void Object::release (  )  [inherited]
void Element::removeChild ( int  index,
enum mxml_node_types  type = mxml_node_all 
)

Definition at line 188 of file element.cc.

References mxml::Node::children, getChild(), and mxml::mxml_node_all.

Referenced by removeElementChild(), and removeWhitespace().

bool Element::removeElementChild ( zmm::String  name,
bool  removeAll 
)

Definition at line 160 of file element.cc.

References getChild(), getChildIdByName(), mxml::mxml_node_all, nil, and removeElementChild().

void mxml::Element::removeElementChild ( int  index  )  [inline]

Definition at line 85 of file element.h.

References mxml::mxml_node_element, and removeChild().

Referenced by removeElementChild().

void Element::removeWhitespace (  ) 
void Object::retain (  )  [inherited]
void mxml::Element::setArrayName ( zmm::String  arrayName  )  [inline]

Definition at line 99 of file element.h.

References arrayType.

void Element::setAttribute ( zmm::String  name,
zmm::String  value,
enum mxml_value_type  type = mxml_string_type 
)

Definition at line 87 of file element.cc.

References addAttribute(), attributes, and nil.

void mxml::Element::setName ( zmm::String  name  )  [inline]

Definition at line 64 of file element.h.

void Element::setText ( zmm::String  text,
enum mxml_value_type  type = mxml_string_type 
)

Definition at line 340 of file element.cc.

References _, _Exception, appendChild(), childCount(), getChild(), mxml::mxml_node_text, nil, and RefCast.

void mxml::Element::setTextKey ( zmm::String  textKey  )  [inline]

Definition at line 102 of file element.h.


Friends And Related Function Documentation

friend class Parser [friend]

Definition at line 107 of file element.h.


Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]

Definition at line 52 of file element.h.

Referenced by Element(), and getArrayName().

bool mxml::Element::arrayType [protected]

Definition at line 51 of file element.h.

Referenced by Element(), isArrayType(), and setArrayName().

Definition at line 48 of file element.h.

Referenced by addAttribute(), attributeCount(), getAttribute(), print_internal(), and setAttribute().

zmm::Ref<zmm::Array<Node> > mxml::Node::children [protected, inherited]
zmm::Ref<Context> mxml::Node::context [protected, inherited]

Definition at line 56 of file node.h.

pthread_mutex_t zmm::Object::mutex [protected, inherited]

Definition at line 47 of file element.h.

Referenced by getName(), and print_internal().

Definition at line 53 of file element.h.

Referenced by Element(), and getTextKey().

enum mxml_node_types mxml::Node::type [protected, inherited]

The documentation for this class was generated from the following files:

Generated on Fri Mar 26 20:16:58 2010 for MediaTomb by  doxygen 1.6.1