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