2 * Copyright (c) 2012 - 2014 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 #ifndef __XML_PARSER_UTILS_H__
19 #define __XML_PARSER_UTILS_H__
22 #include <libxml/parser.h>
27 int get_content_int(const xmlNodePtr cur_node);
28 bool get_content_bool(const xmlNodePtr cur_node);
31 bool equal_prop(const xmlNodePtr cur_node, const char* prop, const char* str);
34 bool get_prop_number(const xmlNodePtr cur_node, const char* prop, T *ret) {
35 assert(cur_node != NULL);
37 bool succeeded = false;
39 xmlChar* key = xmlGetProp(cur_node, (const xmlChar*)prop);
41 if (ret && key != NULL) {
43 *ret = (T)atoi((const char*)key);
49 bool get_prop_bool(const xmlNodePtr cur_node, const char* prop, sclboolean *ret);
50 int dex_string_to_int(const char* str);
51 int get_content_dex_string_int(const xmlNodePtr cur_node);