| 1022 | @return TIXML_SUCCESS, TIXML_WRONG_TYPE, or TIXML_NO_ATTRIBUTE |
| 1023 | */ |
| 1024 | template< typename T > int QueryValueAttribute( const std::string& name, T* outValue ) const |
| 1025 | { |
| 1026 | const TiXmlAttribute* node = attributeSet.Find( name ); |
| 1027 | if ( !node ) |
| 1028 | return TIXML_NO_ATTRIBUTE; |
| 1029 | |
| 1030 | std::stringstream sstream( node->ValueStr() ); |
| 1031 | sstream >> *outValue; |
| 1032 | if ( !sstream.fail() ) |
| 1033 | return TIXML_SUCCESS; |
| 1034 | return TIXML_WRONG_TYPE; |
| 1035 | } |
| 1036 | |
| 1037 | int QueryValueAttribute( const std::string& name, std::string* outValue ) const |
| 1038 | { |