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 /indra/llvfs | |
parent | 629ae69793f98c1c92c08b1d657e94306fb920e7 (diff) |
Eliminated countFilesInDir boostified getCurPath for OSX
Diffstat (limited to 'indra/llvfs')
-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 |
3 files changed, 2 insertions, 26 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(); |