From 719f60cfc641d85c2cd41598bdff209400ab1fab Mon Sep 17 00:00:00 2001 From: brain Date: Mon, 10 Jul 2006 22:11:53 +0000 Subject: Add FileReader::ContentSize and FileReader::Contents git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4314 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'src/modules.cpp') diff --git a/src/modules.cpp b/src/modules.cpp index 1e92e2bda..282e856c4 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -937,6 +937,25 @@ FileReader::FileReader() { } +std::string FileReader::Contents() +{ + std::string x = ""; + for (file_cache::iterator a = this->fc.begin(); a != this->fc.end(); a++) + { + x.append((std::string*)(*a)); + x.append("\r\n"); + } + return x; +} + +unsigned long FileReader::ContentSize() +{ + unsigned long n = 0; + for (file_cache::iterator a = this->fc.begin(); a != this->fc.end(); a++) + n += (((std::string*)(*a))->length() + 2); + return n; +} + void FileReader::LoadFile(const std::string &filename) { file_cache c; -- cgit v1.2.3