- lowercase style parsing implemented (or put back?)

- alpha sorted preset file entries


git-svn-id: https://projectm.svn.sourceforge.net/svnroot/projectm/trunk@370 6778bc44-b910-0410-a7a0-be141de4315d
This commit is contained in:
w1z7ard
2007-09-03 01:11:56 +00:00
parent 1bf65b6a03
commit 60549a9cf9
3 changed files with 23 additions and 10 deletions

View File

@ -13,6 +13,8 @@
#include "Preset.hpp"
#include <iostream>
#include <sstream>
#include <set>
extern "C"
{
#include <errno.h>
@ -68,6 +70,7 @@ void PresetLoader::rescan()
}
struct dirent * dir_entry;
std::set<std::string> alphaSortedFileSet;
while ((dir_entry = readdir(m_dir)) != NULL)
{
@ -87,13 +90,15 @@ void PresetLoader::rescan()
// Create full path name
out << m_dirname << PATH_SEPARATOR << filename;
// std::cerr << "[PresetLoader]" << filename << std::endl;
// Add to our directory entry collection
m_entries.push_back(out.str());
alphaSortedFileSet.insert(out.str());
// the directory entry struct is freed elsewhere
}
// Push all entries in order from the file set to the file entries member (which is an indexed vector)
for (std::set<std::string>::iterator pos = alphaSortedFileSet.begin(); pos != alphaSortedFileSet.end();++pos)
m_entries.push_back(*pos);
}
std::auto_ptr<Preset> PresetLoader::loadPreset(unsigned int index, const PresetInputs & presetInputs, PresetOutputs & presetOutputs) const