Go to the documentation of this file.
152 std::vector<std::string>::const_iterator hdbIter = hdbPaths.begin();
153 for(; hdbIter != hdbPaths.end(); hdbIter++) {
160 std::vector<std::string> dir =
162 std::vector<std::string>::const_iterator dirIter = dir.begin();
163 for (; dirIter != dir.end(); dirIter++) {
164 std::string file = (*dirIter);
165 if (file.rfind(
".hdb", file.size()) != std::string::npos &&
166 file.rfind(
".hdb", file.size()) == (file.size() - 4)) {
175 std::string errorMessage =
"Error in '" + file +
195 "HDBRegistry::hdb(unsigned int)");
197 std::map<const std::string, CachedHDBManager*>::const_iterator
199 for (
unsigned int counter = 0; mapIterator !=
registry_.end();
201 if (counter == index) {
207 return *(*mapIterator).second;
220 "HDBRegistry::hdb(unsigned int)");
222 std::map<const std::string, CachedHDBManager*>::const_iterator iter =
225 for (
unsigned c = 0; iter !=
registry_.end(); iter++) {
226 if (c == index)
return (*iter).first;
254 "HDBRegistry::hdbErrorMessage(unsigned int)");
265 std::map<const std::string, CachedHDBManager*>::iterator it;
std::vector< std::string > errorMessages_
errors found during loading HDBs are strored in this vector
HDBRegistry()
HDB registry must be created with instance() method.
CachedHDBManager & hdb(const std::string fileName)
std::string hdbErrorMessage(unsigned int index)
static std::string absolutePathOf(const std::string &pathName)
bool hasHDB(const std::string &hdbFile)
#define assert(condition)
static bool fileIsDirectory(const std::string fileName)
static std::vector< std::string > hdbPaths(bool libraryPathsOnly=false)
static HDBRegistry * instance_
Unique instance of the class.
std::string errorMessage() const
std::string fileName() const
std::map< const std::string, CachedHDBManager * > registry_
all opened HDBs are stored in this map
static bool fileExists(const std::string fileName)
void addHDB(CachedHDBManager *hdbManager)
void loadFromSearchPaths()
static bool fileIsReadable(const std::string fileName)
std::string hdbPath(unsigned int index)
static std::vector< std::string > directoryContents(const std::string &directory, const bool absolutePaths=true)
static HDBRegistry & instance()
static CachedHDBManager & instance(const std::string &hdbFile)
void removeDeadHDBPaths()
Deletes nonexistent HDB paths from registry.