summaryrefslogtreecommitdiff
path: root/include/configreader.h
diff options
context:
space:
mode:
authorPeter Powell <petpow@saberuk.com>2013-10-05 04:55:11 +0100
committerPeter Powell <petpow@saberuk.com>2013-12-15 06:46:35 +0000
commit02830985a18950497003f3392cf8d6cc30c15c50 (patch)
tree77fb47c2a9274221bcaba0cd82d6c08daf207878 /include/configreader.h
parent357d190074ee58809b31ea0c08543566168bddf6 (diff)
Move stuff around a bit:
- Create FileSystem class: * Move ServerConfig::CleanFilename to FileSystem::GetFileName and rewrite. * Move ServerConfig::ExpandPath to FileSystem. * Move ServerConfig::FileExists to FileSystem. * Move ServerConfig::StartsWithWindowsDriveLetter to FileSystem. - Move FileReader to fileutils.cpp and fix documentation. - Move UserManager::DoBackgroundUserStuff to usermanager.cpp.
Diffstat (limited to 'include/configreader.h')
-rw-r--r--include/configreader.h30
1 files changed, 4 insertions, 26 deletions
diff --git a/include/configreader.h b/include/configreader.h
index 0fbf234c3..a46f9cf95 100644
--- a/include/configreader.h
+++ b/include/configreader.h
@@ -225,10 +225,10 @@ class CoreExport ServerConfig
, Log(LOG_PATH)
, Module(MOD_PATH) { }
- std::string PrependConfig(const std::string& fn) const { return ServerConfig::ExpandPath(Config, fn); }
- std::string PrependData(const std::string& fn) const { return ServerConfig::ExpandPath(Data, fn); }
- std::string PrependLog(const std::string& fn) const { return ServerConfig::ExpandPath(Log, fn); }
- std::string PrependModule(const std::string& fn) const { return ServerConfig::ExpandPath(Module, fn); }
+ std::string PrependConfig(const std::string& fn) const { return FileSystem::ExpandPath(Config, fn); }
+ std::string PrependData(const std::string& fn) const { return FileSystem::ExpandPath(Data, fn); }
+ std::string PrependLog(const std::string& fn) const { return FileSystem::ExpandPath(Log, fn); }
+ std::string PrependModule(const std::string& fn) const { return FileSystem::ExpandPath(Module, fn); }
};
/** Get a configuration tag
@@ -551,30 +551,8 @@ class CoreExport ServerConfig
void Fill();
- /** Returns true if the given string starts with a windows drive letter
- */
- static bool StartsWithWindowsDriveLetter(const std::string& path);
-
bool ApplyDisabledCommands(const std::string& data);
- /** Clean a filename, stripping the directories (and drives) from string.
- * @param name Directory to tidy
- * @return The cleaned filename
- */
- static const char* CleanFilename(const char* name);
-
- /** Check if a file exists.
- * @param file The full path to a file
- * @return True if the file exists and is readable.
- */
- static bool FileExists(const char* file);
-
- /** Expands a path fragment to a full path.
- * @param base The base path to expand from
- * @param fragment The path fragment to expand on top of base.
- */
- static std::string ExpandPath(const std::string& base, const std::string& fragment);
-
/** Escapes a value for storage in a configuration key.
* @param str The string to escape.
* @param xml Are we using the XML config format?