split majority of helpers and rewrite a few heinous functions

This commit is contained in:
Andrzej Rybczak
2012-08-29 11:46:17 +02:00
parent 4cb0e2232a
commit b1c301dc1c
31 changed files with 427 additions and 373 deletions

View File

@@ -104,7 +104,7 @@ namespace
if (equal == std::string::npos)
return "";
std::string result = s.substr(0, equal);
Trim(result);
trim(result);
return result;
}
@@ -445,7 +445,7 @@ void Configuration::Read()
if (!cl.empty() && cl[0] != '#')
{
name = GetOptionName(cl);
v = GetLineValue(cl);
v = getEnclosedString(cl, '"', '"', 0);
if (name == "ncmpcpp_directory")
{
@@ -1078,11 +1078,12 @@ void Configuration::GenerateColumns()
{
columns.clear();
std::string width;
while (!(width = GetLineValue(song_list_columns_format, '(', ')', 1)).empty())
size_t pos = 0;
while (!(width = getEnclosedString(song_list_columns_format, '(', ')', &pos)).empty())
{
Column col;
col.color = IntoColor(GetLineValue(song_list_columns_format, '[', ']', 1));
std::string tag_type = GetLineValue(song_list_columns_format, '{', '}', 1);
col.color = IntoColor(getEnclosedString(song_list_columns_format, '[', ']', &pos));
std::string tag_type = getEnclosedString(song_list_columns_format, '{', '}', &pos);
col.fixed = *width.rbegin() == 'f';