aboutsummaryrefslogtreecommitdiff
path: root/Src/Plugins/Library/ml_wire/ParseUtil.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Plugins/Library/ml_wire/ParseUtil.cpp')
-rw-r--r--Src/Plugins/Library/ml_wire/ParseUtil.cpp43
1 files changed, 43 insertions, 0 deletions
diff --git a/Src/Plugins/Library/ml_wire/ParseUtil.cpp b/Src/Plugins/Library/ml_wire/ParseUtil.cpp
new file mode 100644
index 00000000..0a5c8d57
--- /dev/null
+++ b/Src/Plugins/Library/ml_wire/ParseUtil.cpp
@@ -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;
+} \ No newline at end of file