diff options
Diffstat (limited to 'python/openvino/runtime/common/utils/src/common.cpp')
| -rw-r--r-- | python/openvino/runtime/common/utils/src/common.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/python/openvino/runtime/common/utils/src/common.cpp b/python/openvino/runtime/common/utils/src/common.cpp new file mode 100644 index 0000000..fb238c7 --- /dev/null +++ b/python/openvino/runtime/common/utils/src/common.cpp @@ -0,0 +1,24 @@ +// Copyright (C) 2018-2022 Intel Corporation +// SPDX-License-Identifier: Apache-2.0 +// + +#include "samples/common.hpp" + +std::map<std::string, std::string> parseConfig(const std::string& configName, char comment) { + std::map<std::string, std::string> config = {}; + + std::ifstream file(configName); + if (!file.is_open()) { + return config; + } + + std::string key, value; + while (file >> key >> value) { + if (key.empty() || key[0] == comment) { + continue; + } + config[key] = value; + } + + return config; +} |
