// file: $isip/class/mmedia/xt_05.cc // version: $Id: xt_05.cc 9929 2004-12-31 02:42:05Z duncan $ #include "XMLToken.h" // method: setDepth // // arguments: // short int depth: (input) the depth to assign // to the token // // return: a bool8 indicating status // bool8 XMLToken::setDepth(short int depth_a) { // prevent depths below 0 // if(depth_a < 0) { return false; } else { depth_d = depth_a; } // indicate success // return true; } // method: isA // // arguments: // XMLToken::Type type: (input) an xml token type // // returns: a bool8 indicating status // // this method compares type_a against this // token's type // bool8 XMLToken::isA(XMLToken::TYPE type_a) { return (getType() == type_a); } // method: isA // // arguments: // String value: (input) an xml token value // // returns: a bool8 indicating status // // this method compares the value of an XMLToken // against this token's value // bool8 XMLToken::isA(String value_a) { return (getValue().eq(value_a)); } // method: isA // // arguments: // XMLToken::Type type: (input) an xml token type // String value: (input) an xml token value // // returns: a bool8 indicating status // // this method checks the type and value of an XMLToken // against this token's type and value // bool8 XMLToken::isA(String value_a, XMLToken::TYPE type_a) { return (isA(value_a) && isA(type_a)); } // method: init // // arguments: // TYPE type: (input) the type to assign to the token // String value: (input) the value to assign to the token // Vector< Pair > attrib_array: (input) // a vector of attribute/value pairs // Integral::CMODE ctype: (input) the clear type to use // on the token // int32 token_depth: the depth to assign to the token // // return: a bool8 indicating status // // this method initializes the token // bool8 XMLToken::init(TYPE type_a, String value_a, Vector< Pair > attrib_array_a, int32 token_depth_a, Integral::CMODE ctype_a) { clear(ctype_a); setType(type_a); setValue(value_a); setAttributes(attrib_array_a); setDepth(token_depth_a); return true; } // method: init // // arguments: // TYPE type: (input) the type to assign to the token // String value: (input) the value to assign to the token // Integral::CMODE ctype: (input) the clear type to use // on the token // int32 token_depth: the depth to assign to the token // // return: a bool8 indicating status // // this method initializes the token, with no attributes // bool8 XMLToken::init(TYPE type_a, String value_a, int32 token_depth_a, Integral::CMODE ctype_a) { clear(ctype_a); setType(type_a); setValue(value_a); setDepth(token_depth_a); return true; } // method: init // // arguments: // TYPE type: (input) the type to assign to the token // String value: (input) the value to assign to the token // byte8** attrib_array: (input) // a 2D array of attribute/value pairs // Integral::CMODE ctype: (input) the clear type to use // on the token // int32 token_depth: (input) the depth to assign to the token // // return: a bool8 indicating status // // this method initializes the token // bool8 XMLToken::init(TYPE type_a, String value_a, const byte8** attrib_array_a, int32 token_depth_a, Integral::CMODE ctype_a) { clear(ctype_a); setType(type_a); setValue(value_a); setAttributes(attrib_array_a); setDepth(token_depth_a); return true; }