diff options
| author | 2013-10-05 04:55:11 +0100 | |
|---|---|---|
| committer | 2013-12-15 06:46:35 +0000 | |
| commit | 02830985a18950497003f3392cf8d6cc30c15c50 (patch) | |
| tree | 77fb47c2a9274221bcaba0cd82d6c08daf207878 /src/modules.cpp | |
| parent | m_cap Convert capability names in CAP REQ to lowercase before processing them (diff) | |
| download | inspircd++-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/modules.cpp')
| -rw-r--r-- | src/modules.cpp | 45 |
1 files changed, 0 insertions, 45 deletions
diff --git a/src/modules.cpp b/src/modules.cpp index 487bc4ea0..92f619743 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -25,7 +25,6 @@ #include <iostream> -#include <fstream> #include "inspircd.h" #include "xline.h" #include "socket.h" @@ -708,47 +707,3 @@ Module* ModuleManager::Find(const std::string &name) else return modfind->second; } - -FileReader::FileReader(const std::string& filename) -{ - Load(filename); -} - -void FileReader::Load(const std::string& filename) -{ - // If the file is stored in the file cache then we used that version instead. - std::string realName = ServerInstance->Config->Paths.PrependConfig(filename); - ConfigFileCache::iterator it = ServerInstance->Config->Files.find(realName); - if (it != ServerInstance->Config->Files.end()) - { - this->lines = it->second; - } - else - { - lines.clear(); - - std::ifstream stream(realName.c_str()); - if (!stream.is_open()) - throw CoreException(filename + " does not exist or is not readable!"); - - std::string line; - while (std::getline(stream, line)) - { - lines.push_back(line); - totalSize += line.size() + 2; - } - - stream.close(); - } -} - -std::string FileReader::GetString() -{ - std::string buffer; - for (file_cache::iterator it = this->lines.begin(); it != this->lines.end(); ++it) - { - buffer.append(*it); - buffer.append("\r\n"); - } - return buffer; -} |
