projects
/
metaproxy-moved-to-github.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Work on session_shared - scan support, better error handling, Z39.50
[metaproxy-moved-to-github.git]
/
src
/
xmlutil.cpp
diff --git
a/src/xmlutil.cpp
b/src/xmlutil.cpp
index
5c95d83
..
0a333ea
100644
(file)
--- a/
src/xmlutil.cpp
+++ b/
src/xmlutil.cpp
@@
-1,9
+1,10
@@
-/* $Id: xmlutil.cpp,v 1.6 2006-06-09 14:12:13 adam Exp $
+/* $Id: xmlutil.cpp,v 1.8 2006-06-19 13:08:00 adam Exp $
Copyright (c) 2005-2006, Index Data.
Copyright (c) 2005-2006, Index Data.
-%LICENSE%
+ See the LICENSE file for details
*/
*/
+#include <string.h>
#include "xmlutil.hpp"
namespace mp = metaproxy_1;
#include "xmlutil.hpp"
namespace mp = metaproxy_1;
@@
-19,6
+20,17
@@
std::string mp_xml::get_text(const xmlNode *ptr)
return c;
}
return c;
}
+bool mp_xml::get_bool(const xmlNode *ptr, bool default_value)
+{
+ if (ptr && ptr->type == XML_TEXT_NODE && ptr->content)
+ {
+ if (!strcmp((const char *) ptr->content, "true"))
+ return true;
+ else
+ return false;
+ }
+ return default_value;
+}
bool mp_xml::is_element(const xmlNode *ptr,
const std::string &ns,
bool mp_xml::is_element(const xmlNode *ptr,
const std::string &ns,