mirror of https://github.com/AxioDL/tinyxml2.git
one successful return type. simplify build on vs2015
This commit is contained in:
parent
df4ffc00d6
commit
8553625730
16
tinyxml2.cpp
16
tinyxml2.cpp
|
@ -1286,7 +1286,7 @@ void XMLAttribute::SetName( const char* n )
|
|||
XMLError XMLAttribute::QueryIntValue( int* value ) const
|
||||
{
|
||||
if ( XMLUtil::ToInt( Value(), value )) {
|
||||
return XML_NO_ERROR;
|
||||
return XML_SUCCESS;
|
||||
}
|
||||
return XML_WRONG_ATTRIBUTE_TYPE;
|
||||
}
|
||||
|
@ -1295,7 +1295,7 @@ XMLError XMLAttribute::QueryIntValue( int* value ) const
|
|||
XMLError XMLAttribute::QueryUnsignedValue( unsigned int* value ) const
|
||||
{
|
||||
if ( XMLUtil::ToUnsigned( Value(), value )) {
|
||||
return XML_NO_ERROR;
|
||||
return XML_SUCCESS;
|
||||
}
|
||||
return XML_WRONG_ATTRIBUTE_TYPE;
|
||||
}
|
||||
|
@ -1304,7 +1304,7 @@ XMLError XMLAttribute::QueryUnsignedValue( unsigned int* value ) const
|
|||
XMLError XMLAttribute::QueryBoolValue( bool* value ) const
|
||||
{
|
||||
if ( XMLUtil::ToBool( Value(), value )) {
|
||||
return XML_NO_ERROR;
|
||||
return XML_SUCCESS;
|
||||
}
|
||||
return XML_WRONG_ATTRIBUTE_TYPE;
|
||||
}
|
||||
|
@ -1313,7 +1313,7 @@ XMLError XMLAttribute::QueryBoolValue( bool* value ) const
|
|||
XMLError XMLAttribute::QueryFloatValue( float* value ) const
|
||||
{
|
||||
if ( XMLUtil::ToFloat( Value(), value )) {
|
||||
return XML_NO_ERROR;
|
||||
return XML_SUCCESS;
|
||||
}
|
||||
return XML_WRONG_ATTRIBUTE_TYPE;
|
||||
}
|
||||
|
@ -1322,7 +1322,7 @@ XMLError XMLAttribute::QueryFloatValue( float* value ) const
|
|||
XMLError XMLAttribute::QueryDoubleValue( double* value ) const
|
||||
{
|
||||
if ( XMLUtil::ToDouble( Value(), value )) {
|
||||
return XML_NO_ERROR;
|
||||
return XML_SUCCESS;
|
||||
}
|
||||
return XML_WRONG_ATTRIBUTE_TYPE;
|
||||
}
|
||||
|
@ -1771,7 +1771,7 @@ XMLDocument::XMLDocument( bool processEntities, Whitespace whitespace ) :
|
|||
XMLNode( 0 ),
|
||||
_writeBOM( false ),
|
||||
_processEntities( processEntities ),
|
||||
_errorID( XML_NO_ERROR ),
|
||||
_errorID(XML_SUCCESS),
|
||||
_whitespace( whitespace ),
|
||||
_errorStr1( 0 ),
|
||||
_errorStr2( 0 ),
|
||||
|
@ -1795,7 +1795,7 @@ void XMLDocument::Clear()
|
|||
#ifdef DEBUG
|
||||
const bool hadError = Error();
|
||||
#endif
|
||||
_errorID = XML_NO_ERROR;
|
||||
_errorID = XML_SUCCESS;
|
||||
_errorStr1 = 0;
|
||||
_errorStr2 = 0;
|
||||
|
||||
|
@ -2000,7 +2000,7 @@ XMLError XMLDocument::SaveFile( FILE* fp, bool compact )
|
|||
{
|
||||
// Clear any error from the last save, otherwise it will get reported
|
||||
// for *this* call.
|
||||
SetError( XML_NO_ERROR, 0, 0 );
|
||||
SetError(XML_SUCCESS, 0, 0);
|
||||
XMLPrinter stream( fp, compact );
|
||||
Print( &stream );
|
||||
return _errorID;
|
||||
|
|
|
@ -485,7 +485,6 @@ public:
|
|||
// WARNING: must match XMLDocument::_errorNames[]
|
||||
enum XMLError {
|
||||
XML_SUCCESS = 0,
|
||||
XML_NO_ERROR = 0,
|
||||
XML_NO_ATTRIBUTE,
|
||||
XML_WRONG_ATTRIBUTE_TYPE,
|
||||
XML_ERROR_FILE_NOT_FOUND,
|
||||
|
@ -1673,7 +1672,7 @@ public:
|
|||
|
||||
/// Return true if there was an error parsing the document.
|
||||
bool Error() const {
|
||||
return _errorID != XML_NO_ERROR;
|
||||
return _errorID != XML_SUCCESS;
|
||||
}
|
||||
/// Return the errorID.
|
||||
XMLError ErrorID() const {
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{E8FB2712-8666-4662-A5B8-2B5B0FB1A260}</ProjectGuid>
|
||||
<RootNamespace>test</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'" Label="Configuration">
|
||||
|
@ -133,29 +134,25 @@
|
|||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'">
|
||||
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'">
|
||||
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
|
||||
<IntDir>$(SolutionDir)$(Configuration)\</IntDir>
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'">
|
||||
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'">
|
||||
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
|
||||
<IntDir>$(SolutionDir)$(Configuration)\</IntDir>
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'">
|
||||
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'">
|
||||
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
|
||||
<IntDir>$(SolutionDir)$(Configuration)\</IntDir>
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'">
|
||||
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'">
|
||||
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
|
||||
<IntDir>$(SolutionDir)$(Configuration)\</IntDir>
|
||||
<OutDir>$(SolutionDir)$(Configuration)\</OutDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|x64'">
|
||||
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
|
||||
|
|
|
@ -38,6 +38,7 @@
|
|||
<ProjectGuid>{D1C528B6-AA02-4D29-9D61-DC08E317A70D}</ProjectGuid>
|
||||
<Keyword>Win32Proj</Keyword>
|
||||
<RootNamespace>tinyxml2</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'" Label="Configuration">
|
||||
|
@ -140,13 +141,9 @@
|
|||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Dll|Win32'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug-Lib|x64'">
|
||||
<LinkIncremental>true</LinkIncremental>
|
||||
|
@ -160,13 +157,9 @@
|
|||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Dll|Win32'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
<OutDir>$(SolutionDir)bin\$(Platform)-$(Configuration)\</OutDir>
|
||||
<IntDir>$(SolutionDir)temp\$(Platform)-$(Configuration)\</IntDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release-Lib|x64'">
|
||||
<LinkIncremental>false</LinkIncremental>
|
||||
|
|
10
xmltest.cpp
10
xmltest.cpp
|
@ -513,13 +513,13 @@ int main( int argc, const char ** argv )
|
|||
double dVal;
|
||||
|
||||
result = ele->QueryDoubleAttribute( "attr0", &dVal );
|
||||
XMLTest( "Query attribute: int as double", result, (int)XML_NO_ERROR );
|
||||
XMLTest( "Query attribute: int as double", result, (int)XML_SUCCESS);
|
||||
XMLTest( "Query attribute: int as double", (int)dVal, 1 );
|
||||
result = ele->QueryDoubleAttribute( "attr1", &dVal );
|
||||
XMLTest( "Query attribute: double as double", result, (int)XML_NO_ERROR );
|
||||
XMLTest( "Query attribute: double as double", result, (int)XML_SUCCESS);
|
||||
XMLTest( "Query attribute: double as double", (int)dVal, 2 );
|
||||
result = ele->QueryIntAttribute( "attr1", &iVal );
|
||||
XMLTest( "Query attribute: double as int", result, (int)XML_NO_ERROR );
|
||||
XMLTest( "Query attribute: double as int", result, (int)XML_SUCCESS);
|
||||
XMLTest( "Query attribute: double as int", iVal, 2 );
|
||||
result = ele->QueryIntAttribute( "attr2", &iVal );
|
||||
XMLTest( "Query attribute: not a number", result, (int)XML_WRONG_ATTRIBUTE_TYPE );
|
||||
|
@ -1003,7 +1003,7 @@ int main( int argc, const char ** argv )
|
|||
{
|
||||
// This shouldn't crash.
|
||||
XMLDocument doc;
|
||||
if(XML_NO_ERROR != doc.LoadFile( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ))
|
||||
if(XML_SUCCESS != doc.LoadFile( "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" ))
|
||||
{
|
||||
doc.PrintError();
|
||||
}
|
||||
|
@ -1256,7 +1256,7 @@ int main( int argc, const char ** argv )
|
|||
static const char* xml_bom_preservation = "\xef\xbb\xbf<element/>\n";
|
||||
{
|
||||
XMLDocument doc;
|
||||
XMLTest( "BOM preservation (parse)", XML_NO_ERROR, doc.Parse( xml_bom_preservation ), false );
|
||||
XMLTest( "BOM preservation (parse)", XML_SUCCESS, doc.Parse( xml_bom_preservation ), false );
|
||||
XMLPrinter printer;
|
||||
doc.Print( &printer );
|
||||
|
||||
|
|
Loading…
Reference in New Issue