This class contains the data of a start element tag. More...
#include <ODi_StartTag.h>
Public Member Functions | |
ODi_StartTag (UT_uint32 attributeGrowStep=10) | |
Constructor. | |
~ODi_StartTag () | |
Destructor. | |
void | set (const gchar *pName, const gchar **ppAtts) |
const char * | getName () const |
UT_uint32 | getAttributeCount () const |
const char * | getAttributeValue (const char *rName) const |
Private Member Functions | |
void | _growAttributes () |
Private Attributes | |
UT_UTF8Stringbuf | m_name |
UT_UTF8Stringbuf * | m_pAttributes |
UT_uint32 | m_attributeSize |
UT_uint32 | m_attributeMemSize |
UT_uint32 | m_attributeGrowStep |
This class contains the data of a start element tag.
It's intended to be reused, so, its data is buffered. Reusing this class is a good idea beacuse during the parsing of an OpenDocument text stream there will be LOTS of creation and destruction of start tags. Making "new" and "delete" operations for these events would be a significant performance burden.
ODi_StartTag::ODi_StartTag | ( | UT_uint32 | attributeGrowStep = 10 |
) |
Constructor.
ODi_StartTag::~ODi_StartTag | ( | ) |
Destructor.
References DELETEPV, and m_pAttributes.
void ODi_StartTag::_growAttributes | ( | ) | [private] |
References DELETEPV, m_attributeGrowStep, m_attributeMemSize, m_attributeSize, and m_pAttributes.
Referenced by set().
UT_uint32 ODi_StartTag::getAttributeCount | ( | ) | const [inline] |
References m_attributeSize.
const char * ODi_StartTag::getAttributeValue | ( | const char * | rName | ) | const |
rName | An UTF-8 string, conataining the attribute name. |
References UT_UTF8Stringbuf::data(), m_attributeSize, and m_pAttributes.
Referenced by ODi_Frame_ListenerState::_drawImage(), ODi_Frame_ListenerState::_drawInlineImage(), ODi_Frame_ListenerState::_drawObject(), ODi_Frame_ListenerState::_drawTextBox(), ODi_Frame_ListenerState::_getFrameProperties(), ODi_TextContent_ListenerState::_insureInSection(), ODi_TextContent_ListenerState::_startParagraphElement(), ODi_TextContent_ListenerState::endElement(), ODi_MetaStream_ListenerState::endElement(), and ODi_TextContent_ListenerState::startElement().
const char* ODi_StartTag::getName | ( | ) | const [inline] |
References UT_UTF8Stringbuf::data(), and m_name.
Referenced by ODi_TextContent_ListenerState::_startParagraphElement(), ODi_ElementStack::getClosestElement(), ODi_ElementStack::getElementLevel(), ODi_ElementStack::hasElement(), ODi_TextContent_ListenerState::startElement(), ODi_StylesStream_ListenerState::startElement(), and ODi_Style_Style::startElement().
void ODi_StartTag::set | ( | const gchar * | pName, | |
const gchar ** | ppAtts | |||
) |
References _growAttributes(), UT_UTF8Stringbuf::assign(), m_attributeMemSize, m_attributeSize, m_name, and m_pAttributes.
Referenced by ODi_ElementStack::startElement().
UT_uint32 ODi_StartTag::m_attributeGrowStep [private] |
Referenced by _growAttributes().
UT_uint32 ODi_StartTag::m_attributeMemSize [private] |
Referenced by _growAttributes(), and set().
UT_uint32 ODi_StartTag::m_attributeSize [private] |
Referenced by _growAttributes(), getAttributeCount(), getAttributeValue(), and set().
UT_UTF8Stringbuf ODi_StartTag::m_name [private] |
UT_UTF8Stringbuf* ODi_StartTag::m_pAttributes [private] |
Referenced by _growAttributes(), getAttributeValue(), set(), and ~ODi_StartTag().