From c43917edd1017110ccc5dba4566fd8a1b78c76fe Mon Sep 17 00:00:00 2001 From: Arthur Britto Date: Thu, 5 Apr 2012 23:15:34 -0700 Subject: [PATCH] Fix tabs. --- src/ParseSection.cpp | 49 ++++++++++++++++++++++---------------------- 1 file changed, 24 insertions(+), 25 deletions(-) diff --git a/src/ParseSection.cpp b/src/ParseSection.cpp index 08fcd4cbe6..2258da1dbd 100644 --- a/src/ParseSection.cpp +++ b/src/ParseSection.cpp @@ -29,27 +29,27 @@ section ParseSection(const std::string strInput, const bool bTrim) // Parse each line. BOOST_FOREACH(std::string& strValue, vLines) { - if (strValue.empty() || strValue[0] == '#') - { - // Blank line or comment, do nothing. - } - else if (strValue[0] == '[' && strValue[strValue.length()-1] == ']') { - // New section. + if (strValue.empty() || strValue[0] == '#') + { + // Blank line or comment, do nothing. + } + else if (strValue[0] == '[' && strValue[strValue.length()-1] == ']') { + // New section. - strSection = strValue.substr(1, strValue.length()-2); - secResult[strSection] = section::mapped_type(); - } - else - { - // Another line in a section. - if (bTrim) - { - boost::algorithm::trim_right_if(strValue, boost::algorithm::is_space()); - boost::algorithm::trim_left_if(strValue, boost::algorithm::is_space()); - } + strSection = strValue.substr(1, strValue.length()-2); + secResult[strSection] = section::mapped_type(); + } + else + { + // Another line in a section. + if (bTrim) + { + boost::algorithm::trim_right_if(strValue, boost::algorithm::is_space()); + boost::algorithm::trim_left_if(strValue, boost::algorithm::is_space()); + } - secResult[strSection].push_back(strValue); - } + secResult[strSection].push_back(strValue); + } } return secResult; @@ -60,11 +60,11 @@ void PrintSection(section secInput) std::cerr << "PrintSection>" << std::endl; BOOST_FOREACH(section::value_type& pairSection, secInput) { - std::cerr << "[" << pairSection.first << "]" << std::endl; - BOOST_FOREACH(std::string& value, pairSection.second) - { - std::cerr << value << std::endl; - } + std::cerr << "[" << pairSection.first << "]" << std::endl; + BOOST_FOREACH(std::string& value, pairSection.second) + { + std::cerr << value << std::endl; + } } std::cerr << "PrintSection<" << std::endl; } @@ -109,5 +109,4 @@ bool sectionSingleB(section& secSource, std::string strSection, std::string& str return bSingle; } - // vim:ts=4