aboutsummaryrefslogtreecommitdiffstats
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorGravatar Peter Powell2013-10-05 04:55:11 +0100
committerGravatar Peter Powell2013-12-15 06:46:35 +0000
commit02830985a18950497003f3392cf8d6cc30c15c50 (patch)
tree77fb47c2a9274221bcaba0cd82d6c08daf207878 /src/configreader.cpp
parentm_cap Convert capability names in CAP REQ to lowercase before processing them (diff)
downloadinspircd++-02830985a18950497003f3392cf8d6cc30c15c50.tar.gz
inspircd++-02830985a18950497003f3392cf8d6cc30c15c50.tar.bz2
inspircd++-02830985a18950497003f3392cf8d6cc30c15c50.zip
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 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp33
1 files changed, 0 insertions, 33 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 7493d980c..341414e0d 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -734,11 +734,6 @@ void ServerConfig::ApplyModules(User* user)
}
}
-bool ServerConfig::StartsWithWindowsDriveLetter(const std::string &path)
-{
- return (path.length() > 2 && isalpha(path[0]) && path[1] == ':');
-}
-
ConfigTag* ServerConfig::ConfValue(const std::string &tag)
{
ConfigTagList found = config_data.equal_range(tag);
@@ -757,18 +752,6 @@ ConfigTagList ServerConfig::ConfTags(const std::string& tag)
return config_data.equal_range(tag);
}
-bool ServerConfig::FileExists(const char* file)
-{
- struct stat sb;
- if (stat(file, &sb) == -1)
- return false;
-
- if ((sb.st_mode & S_IFDIR) > 0)
- return false;
-
- return !access(file, F_OK);
-}
-
std::string ServerConfig::Escape(const std::string& str, bool xml)
{
std::string escaped;
@@ -793,22 +776,6 @@ std::string ServerConfig::Escape(const std::string& str, bool xml)
return escaped;
}
-std::string ServerConfig::ExpandPath(const std::string& base, const std::string& fragment)
-{
- // The fragment is an absolute path, don't modify it.
- if (fragment[0] == '/' || ServerConfig::StartsWithWindowsDriveLetter(fragment))
- return fragment;
-
- return base + '/' + fragment;
-}
-
-const char* ServerConfig::CleanFilename(const char* name)
-{
- const char* p = name + strlen(name);
- while ((p != name) && (*p != '/') && (*p != '\\')) p--;
- return (p != name ? ++p : p);
-}
-
void ConfigReaderThread::Run()
{
Config->Read();