diff options
author | Aura Linden <aura@lindenlab.com> | 2012-07-24 12:11:20 -0700 |
---|---|---|
committer | Aura Linden <aura@lindenlab.com> | 2012-07-24 12:11:20 -0700 |
commit | ed4b37906749dd7ba2da56af741f2c0826f222d1 (patch) | |
tree | a40eb4acce9747df9c7ff0150f60d543d6f02f59 | |
parent | 629ae69793f98c1c92c08b1d657e94306fb920e7 (diff) |
Eliminated countFilesInDir boostified getCurPath for OSX
-rw-r--r-- | indra/llvfs/lldir.h | 2 | ||||
-rw-r--r-- | indra/llvfs/lldir_mac.cpp | 25 | ||||
-rw-r--r-- | indra/llvfs/lldir_mac.h | 1 | ||||
-rw-r--r-- | indra/newview/tests/lldir_stub.cpp | 1 | ||||
-rw-r--r-- | indra/viewer_components/updater/tests/llupdaterservice_test.cpp | 4 |
5 files changed, 2 insertions, 31 deletions
diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h index 5ee8bdb542..a8b204e63e 100644 --- a/indra/llvfs/lldir.h +++ b/indra/llvfs/lldir.h @@ -73,8 +73,6 @@ class LLDir virtual S32 deleteFilesInDir(const std::string &dirname, const std::string &mask); // pure virtual functions - virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask) = 0; - virtual std::string getCurPath() = 0; virtual BOOL fileExists(const std::string &filename) const = 0; diff --git a/indra/llvfs/lldir_mac.cpp b/indra/llvfs/lldir_mac.cpp index 489bc3e4a7..f0b46ade6d 100644 --- a/indra/llvfs/lldir_mac.cpp +++ b/indra/llvfs/lldir_mac.cpp @@ -35,6 +35,7 @@ #include <sys/stat.h> #include <unistd.h> #include <glob.h> +#include <boost/filesystem.hpp> #include <Carbon/Carbon.h> @@ -239,34 +240,12 @@ void LLDir_Mac::initAppDirs(const std::string &app_name, //dumpCurrentDirectories(); } -U32 LLDir_Mac::countFilesInDir(const std::string &dirname, const std::string &mask) -{ - U32 file_count = 0; - glob_t g; - - std::string tmp_str; - tmp_str = dirname; - tmp_str += mask; - - if(glob(tmp_str.c_str(), GLOB_NOSORT, NULL, &g) == 0) - { - file_count = g.gl_pathc; - - globfree(&g); - } - - return (file_count); -} - std::string LLDir_Mac::getCurPath() { - char tmp_str[LL_MAX_PATH]; /* Flawfinder: ignore */ - getcwd(tmp_str, LL_MAX_PATH); - return tmp_str; + return boost::filesystem::path( boost::filesystem::current_path() ).string(); } - BOOL LLDir_Mac::fileExists(const std::string &filename) const { struct stat stat_data; diff --git a/indra/llvfs/lldir_mac.h b/indra/llvfs/lldir_mac.h index d190d70be4..9f1938ae23 100644 --- a/indra/llvfs/lldir_mac.h +++ b/indra/llvfs/lldir_mac.h @@ -45,7 +45,6 @@ public: const std::string& app_read_only_data_dir); virtual std::string getCurPath(); - virtual U32 countFilesInDir(const std::string &dirname, const std::string &mask); virtual BOOL fileExists(const std::string &filename) const; /*virtual*/ std::string getLLPluginLauncher(); diff --git a/indra/newview/tests/lldir_stub.cpp b/indra/newview/tests/lldir_stub.cpp index 18cf4e7419..288541b4fd 100644 --- a/indra/newview/tests/lldir_stub.cpp +++ b/indra/newview/tests/lldir_stub.cpp @@ -45,7 +45,6 @@ public: /*virtual*/ void initAppDirs(const std::string &app_name) {} /*virtual*/ std::string getCurPath() { return "CUR_PATH_FROM_LLDIR"; } - /*virtual*/ U32 countFilesInDir(const std::string &dirname, const std::string &mask) { return 42; } /*virtual*/ BOOL getNextFileInDir(const std::string &dirname, const std::string &mask, std::string &fname, BOOL wrap) { fname = fname + "_NEXT"; return false; } /*virtual*/ void getRandomFileInDir(const std::string &dirname, const std::string &mask, std::string &fname) { fname = "RANDOM_FILE"; } /*virtual*/ BOOL fileExists(const std::string &filename) const { return false; } diff --git a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp index e19d5724f1..6f67fd0da0 100644 --- a/indra/viewer_components/updater/tests/llupdaterservice_test.cpp +++ b/indra/viewer_components/updater/tests/llupdaterservice_test.cpp @@ -54,10 +54,6 @@ class LLDir_Mock : public LLDir { void initAppDirs(const std::string &app_name, const std::string& app_read_only_data_dir = "") {} - U32 countFilesInDir(const std::string &dirname, const std::string &mask) - { - return 0; - } void getRandomFileInDir(const std::string &dirname, const std::string &mask, |