clang-format: Update to match docs repo
Update the .clang-format file and run clang-format-6.0.
This .clang-format matches the example one in
https://github.com/openbmc/docs/blob/master/cpp-style-and-conventions.md#clang-formatting
Change-Id: Ia331c9a5b040e1a3c45a0ebf1b8d776d93b05ae5
Signed-off-by: Gunnar Mills <gmills@us.ibm.com>
diff --git a/config_parser.cpp b/config_parser.cpp
index 92c344f..c4af404 100644
--- a/config_parser.cpp
+++ b/config_parser.cpp
@@ -22,8 +22,8 @@
setFile(filePath);
}
-
-std::tuple<ReturnCode, KeyValueMap> Parser::getSection(const std::string& section)
+std::tuple<ReturnCode, KeyValueMap>
+ Parser::getSection(const std::string& section)
{
auto it = sections.find(section);
if (it == sections.end())
@@ -40,7 +40,7 @@
const std::string& key)
{
ValueList values;
- KeyValueMap keyValues {};
+ KeyValueMap keyValues{};
auto rc = ReturnCode::SUCCESS;
std::tie(rc, keyValues) = getSection(section);
@@ -63,7 +63,6 @@
return std::make_tuple(ReturnCode::SUCCESS, std::move(values));
}
-
bool Parser::isValueExist(const std::string& section, const std::string& key,
const std::string& value)
{
@@ -124,26 +123,17 @@
{
return;
}
- //clear all the section data.
+ // clear all the section data.
sections.clear();
parse(stream);
stream.close();
- }
+}
void Parser::parse(std::istream& in)
{
- static const std::regex commentRegex
- {
- R"x(\s*[;#])x"
- };
- static const std::regex sectionRegex
- {
- R"x(\s*\[([^\]]+)\])x"
- };
- static const std::regex valueRegex
- {
- R"x(\s*(\S[^ \t=]*)\s*=\s*(\S+)\s*$)x"
- };
+ static const std::regex commentRegex{R"x(\s*[;#])x"};
+ static const std::regex sectionRegex{R"x(\s*\[([^\]]+)\])x"};
+ static const std::regex valueRegex{R"x(\s*(\S[^ \t=]*)\s*=\s*(\S+)\s*$)x"};
std::string section;
std::smatch pieces;
for (std::string line; std::getline(in, line);)
@@ -169,6 +159,6 @@
}
}
-}//namespace config
-}//namespace network
-}//namespace phosphor
+} // namespace config
+} // namespace network
+} // namespace phosphor