diff options
author | Martin Braun <martin.braun@ettus.com> | 2020-03-02 15:25:13 -0800 |
---|---|---|
committer | atrnati <54334261+atrnati@users.noreply.github.com> | 2020-03-03 08:51:32 -0600 |
commit | 876d4150aa3da531ddd687b48afada6e43f79146 (patch) | |
tree | fd72a71419f4cd800d4e500cfcaded4dfc8dc367 /host/lib/utils/config_parser.cpp | |
parent | 1393553d623bdf4ba40d5435c9719b6ce990d9ac (diff) | |
download | uhd-876d4150aa3da531ddd687b48afada6e43f79146.tar.gz uhd-876d4150aa3da531ddd687b48afada6e43f79146.tar.bz2 uhd-876d4150aa3da531ddd687b48afada6e43f79146.zip |
uhd: Apply clang-format against all .cpp and .hpp files in host/
Note: template_lvbitx.{cpp,hpp} need to be excluded from the list of
files that clang-format gets applied against.
Diffstat (limited to 'host/lib/utils/config_parser.cpp')
-rw-r--r-- | host/lib/utils/config_parser.cpp | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/host/lib/utils/config_parser.cpp b/host/lib/utils/config_parser.cpp index c46671623..bf0cdf5ff 100644 --- a/host/lib/utils/config_parser.cpp +++ b/host/lib/utils/config_parser.cpp @@ -5,36 +5,30 @@ // #include <uhdlib/utils/config_parser.hpp> -#include <boost/format.hpp> #include <boost/filesystem.hpp> +#include <boost/format.hpp> #include <boost/property_tree/ini_parser.hpp> using namespace uhd; -config_parser::config_parser(const std::string &path) +config_parser::config_parser(const std::string& path) { if (not path.empty()) { try { boost::property_tree::ini_parser::read_ini(path, _pt); - } catch (const boost::property_tree::ini_parser_error &) { - throw uhd::runtime_error(str( - boost::format("Unable to parse file %s") - % path - )); + } catch (const boost::property_tree::ini_parser_error&) { + throw uhd::runtime_error( + str(boost::format("Unable to parse file %s") % path)); } } } -void config_parser::read_file(const std::string &path) +void config_parser::read_file(const std::string& path) { config_parser new_config(path); for (const auto& section : new_config.sections()) { for (const auto& key : new_config.options(section)) { - set<std::string>( - section, - key, - new_config.get<std::string>(section, key) - ); + set<std::string>(section, key, new_config.get<std::string>(section, key)); } } } @@ -43,17 +37,16 @@ std::vector<std::string> config_parser::sections() { try { return _options(_pt); - } catch (const boost::property_tree::ptree_bad_path &) { + } catch (const boost::property_tree::ptree_bad_path&) { return std::vector<std::string>{}; } } -std::vector<std::string> config_parser::options(const std::string §ion) +std::vector<std::string> config_parser::options(const std::string& section) { try { return _options(_pt.get_child(section)); - } catch (const boost::property_tree::ptree_bad_path &) { + } catch (const boost::property_tree::ptree_bad_path&) { return std::vector<std::string>{}; } } - |