Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / src / inference_engine / xml_parse_utils.h
1 // Copyright (C) 2018-2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4
5 #pragma once
6
7 #include <cstdlib>
8 #include "pugixml.hpp"
9 #include "ie_common.h"
10 #include "ie_api.h"
11 #include <string>
12 #include <ie_precision.hpp>
13
14 #define FOREACH_CHILD(c, p, tag) for (auto c = p.child(tag); !c.empty(); c = c.next_sibling(tag))
15
16 namespace XMLParseUtils {
17
18 INFERENCE_ENGINE_API_CPP(int) GetIntAttr(const pugi::xml_node &node, const char *str);
19
20 INFERENCE_ENGINE_API_CPP(int) GetIntAttr(const pugi::xml_node &node, const char *str, int defVal);
21
22 INFERENCE_ENGINE_API_CPP(uint64_t) GetUInt64Attr(const pugi::xml_node &node, const char *str);
23
24 INFERENCE_ENGINE_API_CPP(uint64_t) GetUInt64Attr(const pugi::xml_node &node, const char *str, uint64_t defVal);
25
26 INFERENCE_ENGINE_API_CPP(unsigned int) GetUIntAttr(const pugi::xml_node &node, const char *str);
27
28 INFERENCE_ENGINE_API_CPP(unsigned int) GetUIntAttr(const pugi::xml_node &node, const char *str, unsigned int defVal);
29
30 INFERENCE_ENGINE_API_CPP(std::string) GetStrAttr(const pugi::xml_node &node, const char *str);
31
32 INFERENCE_ENGINE_API_CPP(std::string) GetStrAttr(const pugi::xml_node &node, const char *str, const char *def);
33
34 INFERENCE_ENGINE_API_CPP(float) GetFloatAttr(const pugi::xml_node &node, const char *str);
35
36 INFERENCE_ENGINE_API_CPP(float) GetFloatAttr(const pugi::xml_node &node, const char *str, float defVal);
37
38 INFERENCE_ENGINE_API_CPP(InferenceEngine::Precision) GetPrecisionAttr(const pugi::xml_node &node, const char *str);
39
40 INFERENCE_ENGINE_API_CPP(InferenceEngine::Precision)
41 GetPrecisionAttr(const pugi::xml_node &node, const char *str, InferenceEngine::Precision def);
42
43 INFERENCE_ENGINE_API_CPP(int) GetIntChild(const pugi::xml_node &node, const char *str, int defVal);
44
45 INFERENCE_ENGINE_API_CPP(std::string) NameFromFilePath(const char *filepath);
46
47 }  // namespace XMLParseUtils