pug::xml_attribute Class Reference
#include <pugxml.h>
Collaboration diagram for pug::xml_attribute:

Detailed Description
Definition at line 1519 of file pugxml.h.
Constructor & Destructor Documentation
| pug::xml_attribute::xml_attribute | ( | ) | [inline] |
Definition at line 1527 of file pugxml.h.
01527 : _attr(NULL), _delete_attr(false) {} //Default constructor.
| pug::xml_attribute::xml_attribute | ( | xml_attribute_struct * | attr | ) | [inline] |
Definition at line 1528 of file pugxml.h.
01528 : _attr(attr), _delete_attr(false) {} //Initializing constructor.
| pug::xml_attribute::xml_attribute | ( | xml_attribute_struct * | attr, | |
| const bool | delete_attr | |||
| ) | [inline] |
Definition at line 1529 of file pugxml.h.
01529 : 01530 _attr(attr), _delete_attr(delete_attr) {} //Initializing constructor. NF 3 Mar 2003
| pug::xml_attribute::xml_attribute | ( | const xml_attribute & | r | ) | [inline] |
Definition at line 1531 of file pugxml.h.
01531 : _attr(r._attr), _delete_attr(r._delete_attr) {} //Copy constructor.
| virtual pug::xml_attribute::~xml_attribute | ( | ) | [inline, virtual] |
Member Function Documentation
| void pug::xml_attribute::attach | ( | xml_attribute_struct * | v | ) | [inline] |
| xml_attribute& pug::xml_attribute::operator= | ( | const xml_attribute & | r | ) | [inline] |
| bool pug::xml_attribute::operator== | ( | const xml_attribute & | r | ) | [inline] |
| bool pug::xml_attribute::operator!= | ( | const xml_attribute & | r | ) | [inline] |
| pug::xml_attribute::operator xml_attribute_struct * | ( | ) | [inline] |
| pug::xml_attribute::operator std::string | ( | ) | [inline] |
Definition at line 1544 of file pugxml.h.
References _attr, has_value(), and pug::t_xml_attribute_struct::value.
01545 { 01546 std::string temp; 01547 if(has_value()) 01548 { 01549 #ifdef PUGOPT_NONSEG 01550 // temp.append(_attr->value,_attr->value_size); 01551 temp.assign(_attr->value,_attr->value_size); // NF 2 Mar 2003 01552 #else 01553 temp = _attr->value; 01554 #endif 01555 } 01556 return temp; 01557 }
Here is the call graph for this function:

| pug::xml_attribute::operator const TCHAR * | ( | ) | [inline] |
| pug::xml_attribute::operator int | ( | ) | [inline] |
Definition at line 1574 of file pugxml.h.
References _tcsncpy, _tcstol, and PUGDEF_ATTR_VALU_SIZE.
01575 { 01576 if(!has_value()) return 0; 01577 #ifdef PUGOPT_NONSEG 01578 TCHAR temp[PUGDEF_ATTR_VALU_SIZE]; 01579 unsigned int valulen = sizeof(temp)-1; 01580 const unsigned int maxlen = valulen ? min(valulen,_attr->value_size) : _attr->value_size; 01581 _tcsncpy(temp,_attr->value,maxlen); 01582 temp[maxlen] = 0; 01583 return (int)_tcstol( temp, NULL, 0 ); // rem: base = 0 so value can be Dec|Octal|Hex 01584 #else 01585 return (int)_tcstol( _attr->value, NULL, 0 ); // rem: base = 0 so value can be Dec|Octal|Hex 01586 #endif 01587 }
| pug::xml_attribute::operator long | ( | ) | [inline] |
Definition at line 1591 of file pugxml.h.
References _tcsncpy, _tcstol, and PUGDEF_ATTR_VALU_SIZE.
01592 { 01593 if(!has_value()) return 0; 01594 #ifdef PUGOPT_NONSEG 01595 TCHAR temp[PUGDEF_ATTR_VALU_SIZE]; 01596 unsigned int valulen = sizeof(temp)-1; 01597 const unsigned int maxlen = valulen ? min(valulen,_attr->value_size) : _attr->value_size; 01598 _tcsncpy(temp,_attr->value,maxlen); 01599 temp[maxlen] = 0; 01600 return _tcstol(temp,NULL,10); 01601 #else 01602 return _tcstol(_attr->value,NULL,10); 01603 #endif 01604 }
| pug::xml_attribute::operator double | ( | ) | [inline] |
Definition at line 1608 of file pugxml.h.
References _tcsncpy, _tcstod, and PUGDEF_ATTR_VALU_SIZE.
01609 { 01610 if(!has_value()) return 0.0; 01611 #ifdef PUGOPT_NONSEG 01612 TCHAR temp[PUGDEF_ATTR_VALU_SIZE]; 01613 unsigned int valulen = sizeof(temp)-1; 01614 const unsigned int maxlen = valulen ? min(valulen,_attr->value_size) : _attr->value_size; 01615 _tcsncpy(temp,_attr->value,maxlen); 01616 temp[maxlen] = 0; 01617 return _tcstod(temp,0); 01618 #else 01619 return _tcstod(_attr->value,0); 01620 #endif 01621 }
| pug::xml_attribute::operator bool | ( | ) | [inline] |
Definition at line 1625 of file pugxml.h.
References _T.
01626 { 01627 if(!has_value()) return false; 01628 if(*(_attr->value)) 01629 { 01630 return //Only look at first char: 01631 ( 01632 *(_attr->value) == _T('1') || //1* 01633 *(_attr->value) == _T('t') || //t* (true) 01634 *(_attr->value) == _T('T') || //T* (True|TRUE) 01635 *(_attr->value) == _T('y') || //y* (yes) 01636 *(_attr->value) == _T('Y') //Y* (Yes|YES) 01637 ) 01638 ? true : false; //Return true if matches above, else false. 01639 } 01640 return false; 01641 }
| xml_attribute& pug::xml_attribute::operator= | ( | const std::string & | rhs | ) | [inline] |
| xml_attribute& pug::xml_attribute::operator= | ( | const TCHAR * | rhs | ) | [inline] |
| xml_attribute& pug::xml_attribute::operator= | ( | const int | rhs | ) | [inline] |
| xml_attribute& pug::xml_attribute::operator= | ( | const long | rhs | ) | [inline] |
| xml_attribute& pug::xml_attribute::operator= | ( | const double | rhs | ) | [inline] |
| xml_attribute& pug::xml_attribute::operator= | ( | const bool | rhs | ) | [inline] |
| xml_attribute& pug::xml_attribute::operator>> | ( | std::string & | rhs | ) | [inline] |
| xml_attribute& pug::xml_attribute::operator>> | ( | long & | rhs | ) | [inline] |
| xml_attribute& pug::xml_attribute::operator>> | ( | double & | rhs | ) | [inline] |
| xml_attribute& pug::xml_attribute::operator>> | ( | bool & | rhs | ) | [inline] |
| bool pug::xml_attribute::empty | ( | ) | const [inline] |
| bool pug::xml_attribute::has_name | ( | ) | const [inline] |
| bool pug::xml_attribute::has_value | ( | ) | const [inline] |
Definition at line 1760 of file pugxml.h.
Referenced by claraty::Parameter_Parser::_fetch_var_value(), claraty::Parameter_Parser::_get_double(), claraty::Parameter_Parser::get_bool(), claraty::Parameter_Parser::get_string(), and operator std::string().
| bool pug::xml_attribute::has_name | ( | const TCHAR * | name | ) | const [inline] |
| bool pug::xml_attribute::has_value | ( | const TCHAR * | value | ) | const [inline] |
| const TCHAR* pug::xml_attribute::name | ( | ) | const [inline] |
| std::string pug::xml_attribute::getname | ( | ) | [inline] |
| bool pug::xml_attribute::name | ( | TCHAR * | new_name | ) | [inline] |
Definition at line 1801 of file pugxml.h.
References pug::strcpyinsitu().
01802 { 01803 if(!empty() && new_name) 01804 #ifdef PUGOPT_NONSEG 01805 return strcpyinsitu(&_attr->name,new_name,&_attr->name_insitu,_attr->name_size); 01806 #else 01807 return strcpyinsitu(&_attr->name,new_name,&_attr->name_insitu); 01808 #endif 01809 return false; 01810 }
Here is the call graph for this function:

| const TCHAR* pug::xml_attribute::value | ( | ) | [inline] |
Definition at line 1811 of file pugxml.h.
References _T.
Referenced by claraty::Parameter_Parser::_evaluate_expression(), claraty::Parameter_Parser::_fetch_var_value(), claraty::Parameter_Parser::_get_double(), and claraty::Parameter_Parser::evaluate_expression().
| std::string pug::xml_attribute::getvalue | ( | ) | [inline] |
| bool pug::xml_attribute::value | ( | const TCHAR * | new_value | ) | [inline] |
Definition at line 1816 of file pugxml.h.
References pug::strcpyinsitu().
01817 { 01818 if(!empty() && new_value) 01819 #ifdef PUGOPT_NONSEG 01820 return strcpyinsitu(&_attr->value,new_value,&_attr->value_insitu,_attr->value_size); 01821 #else 01822 return strcpyinsitu(&_attr->value,new_value,&_attr->value_insitu); 01823 #endif 01824 return false; 01825 }
Here is the call graph for this function:

Friends And Related Function Documentation
| long& operator<< | ( | long & | lhs, | |
| xml_attribute & | rhs | |||
| ) | [friend] |
| double& operator<< | ( | double & | lhs, | |
| xml_attribute & | rhs | |||
| ) | [friend] |
| bool& operator<< | ( | bool & | lhs, | |
| xml_attribute & | rhs | |||
| ) | [friend] |
| xml_attribute& operator<< | ( | xml_attribute & | lhs, | |
| const long | rhs | |||
| ) | [friend] |
| xml_attribute& operator<< | ( | xml_attribute & | lhs, | |
| const double & | rhs | |||
| ) | [friend] |
| xml_attribute& operator<< | ( | xml_attribute & | lhs, | |
| const bool & | rhs | |||
| ) | [friend] |
Member Data Documentation
xml_attribute_struct* pug::xml_attribute::_attr [protected] |
Definition at line 1523 of file pugxml.h.
Referenced by operator std::string(), operator!=(), operator=(), and operator==().
bool pug::xml_attribute::_delete_attr [protected] |
The documentation for this class was generated from the following file:
