Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
43
Src/Plugins/Library/ml_downloads/ParseUtil.cpp
Normal file
43
Src/Plugins/Library/ml_downloads/ParseUtil.cpp
Normal file
|
@ -0,0 +1,43 @@
|
|||
#include "ParseUtil.h"
|
||||
|
||||
bool PropertyIsTrue( const XMLNode *item, const wchar_t *property )
|
||||
{
|
||||
if ( !item )
|
||||
return false;
|
||||
|
||||
const wchar_t *value = item->GetProperty( property );
|
||||
if ( !value )
|
||||
return false;
|
||||
|
||||
return !_wcsicmp( value, L"true" );
|
||||
}
|
||||
|
||||
bool PropertyIsFalse( const XMLNode *item, const wchar_t *property )
|
||||
{
|
||||
if ( !item )
|
||||
return false;
|
||||
|
||||
const wchar_t *value = item->GetProperty( property );
|
||||
if ( !value )
|
||||
return false;
|
||||
|
||||
return !_wcsicmp( value, L"false" );
|
||||
}
|
||||
|
||||
const wchar_t *GetContent( const XMLNode *item, const wchar_t *tag )
|
||||
{
|
||||
const XMLNode *curNode = item->Get( tag );
|
||||
if ( curNode )
|
||||
return curNode->GetContent();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
const wchar_t *GetProperty( const XMLNode *item, const wchar_t *tag, const wchar_t *property )
|
||||
{
|
||||
const XMLNode *curNode = item->Get( tag );
|
||||
if ( curNode )
|
||||
return curNode->GetProperty( property );
|
||||
else
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue