quick start:g++ [flags ...] file ... -l /isip/tools/lib/$ISIP_BINARY/lib_mmedia.a #include <XMLToken.h> XMLToken(); boolean init(TYPE type, String value, Vector< Pair> attrib_array, long token_depth = 0, Integral::CMODE ctype = Integral::RESET); boolean isA(String value, TYPE type); String getAttributeValue(const String arg_name) const; String toXML() const;
description:XMLToken token; token.init(L"xml_tag", START_TAG); token.addAttribute("attrib_name_1", "attrib_val_1"); token.addAttribute("attrib_name_2", "attrib_val_2"); token.removeAttribute("attrib_name_1"); Console::put(token.toXML());
static const String XMLToken::CLASS_NAME(L"XMLToken");
enum TYPE { NULL_TAG = 0, START_TAG, END_TAG, CDATA, START_AND_END_TAG, UNHANDLED, DEF_TYPE = NULL_TAG };
static const long ERR = 50900;
String value_d;
TYPE type_d;
short int depth_d;
Vector< Pair> attributes_d;
DebugLevel debug_level_d;
static const String& name();
static boolean diagnose(Integral::DEBUG debug_level);
boolean setDebug(Integral::DEBUG debug_level);
boolean debug(const unichar* msg) const;
XMLToken();
these methods are omitted because XMLToken objects cannot write themselves to an Sof file
boolean assign(const XMLToken& arg);
XMLToken& operator=(const XMLToken& token);
XMLToken& operator==(const XMLToken& token);
boolean eq(const XMLToken& xt) const;
boolean clear(Integral::CMODE ctype);
boolean setDepth(short int depth);
long getDepth() const;
boolean setValue(String value);
String getValue() const;
boolean setType(TYPE type);
boolean setDebug(Integral::DEBUG level);
DebugLevel getDebug() const;
boolean setAttributes(Vector>& attribs);
boolean setAttributes(const byte** attrib_array);
Vector< Pair> getAttributes();
boolean addAttribute(String attrib_name, String attrib_value);
boolean removeAttribute(String attrib_name);
boolean setAttributeValue(const String aname, const String avalue);
String getAttributeValue(const String arg_name) const;
boolean init(TYPE type, String value, Vector< Pair> attrib_array, long token_depth = 0, Integral::CMODE ctype = Integral::RESET);
boolean init( TYPE type, String value, long token_depth = 0, Integral::CMODE ctype = Integral::RESET );
boolean init( TYPE type, String value, const byte** attrib_array, long token_depth = 0, Integral::CMODE ctype = Integral::RESET )
boolean isA(XMLToken::TYPE type);
boolean isA(String value);
boolean isA(String value, TYPE type);
String toXML() const;
boolean hasAttributes();
String addQuotes(String attrib) const;
boolean concatAttributesAsXML(String& output) const;
// initialize a token // XMLToken token; token.init(L"xml_tag", START_TAG); token.addAttribute("attrib_name1", "attrib_val1"); token.addAttribute("attrib_name2", "attrib_val2"); token.addAttribute("attrib_name3", "attrib_val3"); // displays <xml_tag attrib_name1='attrib_val1' attrib_name2='attrib_val2' attrib_name3='attrib_val3'> // if(token.isA(START_TAG, L"xml_tag")) { Console::put(token.toXML()); } // change the value of the attrib_name attribute // token.setAttributeValue(L"attrib_name1", L"new_value"); // this will outut the new value: "new_value" // Console::put(token.getAttributeValue(L"attrib_name1")); token.removeAttribute(L"attrib_name2"); // displays <xml_tag attrib_name1='new_value' attrib_name3='attrib_val3'> // Console::put(token.toXML()); // change the type of the tag // token.setType(END_TAG); // end tags may not have attributes. displays </xml_tag> // if(!token.isA(START_TAG, L"xml_tag")) { Console::put(token.toXML()); }