48 const std::string str = *i;
49 const size_t len = str.size();
51 if (len > ext.length() &&
52 ext == str.substr(len - ext.length()))
54 const std::string file = path + str;
68 const std::string str = *i;
69 const size_t len = str.size();
70 if (len > ext.length() &&
71 ext == str.substr(len - ext.length()))
73 const std::string file = path + str;
83 const std::string &ext)
85 const std::string &path = dir;
90 const std::string &str = *it;
94 std::sort(list.begin(), list.end());
97 std::string
getPath(
const std::string &file)
107 #if defined __native_client__
108 std::string dataZip =
"/http/data.zip/";
109 if (path.substr(0, dataZip.length()) == dataZip)
110 path = path.replace(0, dataZip.length(),
"/http/data/");
127 if (fileContents ==
nullptr)
130 return std::string();
132 const std::string str = std::string(fileContents, contentsLength);
133 delete [] fileContents;
143 if (fileContents ==
nullptr)
149 std::istringstream iss(std::string(fileContents, contentsLength));
152 while (getline(iss, line))
153 lines.push_back(line);
155 delete [] fileContents;
void log(const char *const log_text,...)
#define FOR_EACH(type, iter, array)
std::string getPath(const std::string &file)
std::string getRealDir(std::string fileName)
std::string loadTextFileString(const std::string &fileName)
void freeList(List *const handle)
bool mountZip(std::string newDir, const Append append)
void searchAndAddArchives(const std::string &path, const std::string &ext, const Append append)
bool unmountZip(std::string oldDir)
void getFilesWithDir(std::string dirName, StringVect &list)
const char * loadFile(std::string filename, int &fileSize)
List * enumerateFiles(std::string dirName)
void searchAndRemoveArchives(const std::string &path, const std::string &ext)
bool loadTextFile(const std::string &fileName, StringVect &lines)
void getFilesInDir(const std::string &dir, StringVect &list, const std::string &ext)
std::string getPackageDir()
bool findLast(const std::string &str1, const std::string &str2)
std::string pathJoin(std::string str1, const std::string &str2)
StringVect::const_iterator StringVectCIter
std::vector< std::string > StringVect