Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: trunk/dev/MSDK/MCore/Sources/MFileTools.cpp
- ===================================================================
- --- trunk/dev/MSDK/MCore/Sources/MFileTools.cpp (revision 102)
- +++ trunk/dev/MSDK/MCore/Sources/MFileTools.cpp (working copy)
- @@ -35,6 +35,9 @@
- #include <sys/stat.h>
- #include <stdarg.h>
- +#include <algorithm> // For sorting the file lists.
- +#include <string.h>
- +
- #ifdef WIN32
- #include <direct.h>
- #define mkdir _mkdir
- @@ -45,6 +48,13 @@
- static MFileOpenHook* s_fileOpenHook = 0;
- +// Helper function for helping sort filenames.
- +bool case_insensitive_lt(const string& left, const string& right)
- +{
- + // Return true if left should come earlier than right.
- + int casecmp = strcasecmp(left.c_str(), right.c_str());
- + return (casecmp >= 0)? true : false;
- +}
- bool copyFile(const char * inFilename, const char * outFilename)
- {
- @@ -281,6 +291,10 @@
- }
- closedir(pdir);
- +
- + // Sort the directory list alphabetically.
- + sort(files->begin(), files->end());
- +
- return true;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement