Skip to content

Commit

Permalink
2.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
psemiletov committed May 5, 2019
1 parent 55cf184 commit 550c51c
Show file tree
Hide file tree
Showing 3 changed files with 259 additions and 263 deletions.
39 changes: 19 additions & 20 deletions libretta_pairfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,38 +107,37 @@ string CPairFile::get_string (const string &key,
CPairFile::CPairFile (const string &fname, bool from_data)
{
if (from_data)
{
stringstream st (fname);
string line;
{
stringstream st (fname);
string line;

while (getline (st, line))
{
if (line.empty())
while (getline (st, line))
{
if (line.empty())
continue;

// cout << "line: " << line << endl;
// cout << "line: " << line << endl;

size_t pos = line.find ("=");
size_t pos = line.find ("=");

//cout << "pos: " << pos << endl;

if (pos == string::npos)
continue;
if (pos == string::npos)
continue;

if (pos > line.size())
continue;
if (pos > line.size())
continue;

string a = line.substr (0, pos);
string b = line.substr (pos + 1, line.size() - pos);
string a = line.substr (0, pos);
string b = line.substr (pos + 1, line.size() - pos);

//cout << a << ":" << b << endl;
//cout << a << ":" << b << endl;

values[a] = b;
}
values[a] = b;
}

return;
}

return; //end "from data"
}

file_name = fname;

Expand Down
4 changes: 2 additions & 2 deletions libretta_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ vector <string> files_get_list (const string &path, const string &ext) //ext wit

vector <string> result;

directory = opendir(path.c_str());
directory = opendir (path.c_str());
if (! directory)
{
closedir (directory);
Expand All @@ -77,7 +77,7 @@ vector <string> files_get_list (const string &path, const string &ext) //ext wit
// std::cout << dir_entry->d_name << std::endl;
string t = dir_entry->d_name;
if (t.rfind (ext) != string::npos)
result.push_back (path + "/" + t);
result.push_back (path + "/" + t);
}

closedir (directory);
Expand Down
Loading

0 comments on commit 550c51c

Please sign in to comment.