+ getFileSize() method

This commit is contained in:
kelson42 2012-08-05 18:34:44 +00:00
parent e9740183c2
commit cef66b20e1
2 changed files with 14 additions and 0 deletions

View File

@ -422,4 +422,16 @@ namespace kiwix {
return true;
}
/* Return the file size, works also for splitted files */
unsigned int Reader::getFileSize() {
zim::File *file = this->getZimFileHandler();
zim::offset_type size = 0;
if (file != NULL) {
size = file->getFilesize();
}
return size;
}
}

View File

@ -30,6 +30,7 @@
#include <sstream>
#include <map>
#include "time.h"
#include "../pathTools.h"
using namespace std;
@ -63,6 +64,7 @@ namespace kiwix {
bool canCheckIntegrity();
bool isCorrupted();
bool parseUrl(const string &urlStr, char *ns, string &titleStr);
unsigned int getFileSize();
zim::File* getZimFileHandler();
protected: