summaryrefslogtreecommitdiff
path: root/indra/llfilesystem
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2025-09-29 16:29:19 +0800
committerErik Kundiman <erik@megapahit.org>2025-10-01 16:56:56 +0800
commita954d290674db08ecaf3c1e6484a0cb6647b88b5 (patch)
tree3b672bac3e7d6807cd485ad5f041f69a5c729f46 /indra/llfilesystem
parente6eaa7e29990431b5207dbb4f8ae5560cf884acb (diff)
parenta6d4c1d394eef2cea41f6c6bcd751fec746ec17d (diff)
Merge tag 'Second_Life_Release#a6d4c1d3-2025.07' into 2025.07
Diffstat (limited to 'indra/llfilesystem')
-rw-r--r--indra/llfilesystem/lldir.cpp4
-rw-r--r--indra/llfilesystem/lldir_mac.cpp3
-rw-r--r--indra/llfilesystem/lldir_win32.cpp12
-rw-r--r--indra/llfilesystem/lldir_win32.h2
-rw-r--r--indra/llfilesystem/lldirguard.h7
-rw-r--r--indra/llfilesystem/lldiriterator.cpp2
-rw-r--r--indra/llfilesystem/lldiskcache.cpp8
-rw-r--r--indra/llfilesystem/llfilesystem.cpp4
-rw-r--r--indra/llfilesystem/tests/lldir_test.cpp2
9 files changed, 25 insertions, 19 deletions
diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp
index 918bb0d117..33760d28ae 100644
--- a/indra/llfilesystem/lldir.cpp
+++ b/indra/llfilesystem/lldir.cpp
@@ -103,7 +103,7 @@ std::vector<std::string> LLDir::getFilesInDir(const std::string &dirname)
//Returns a vector of fullpath filenames.
#ifdef LL_WINDOWS // or BOOST_WINDOWS_API
- boost::filesystem::path p(utf8str_to_utf16str(dirname));
+ boost::filesystem::path p(ll_convert<std::wstring>(dirname));
#else
boost::filesystem::path p(dirname);
#endif
@@ -201,7 +201,7 @@ U32 LLDir::deleteDirAndContents(const std::string& dir_name)
try
{
#ifdef LL_WINDOWS // or BOOST_WINDOWS_API
- boost::filesystem::path dir_path(utf8str_to_utf16str(dir_name));
+ boost::filesystem::path dir_path(ll_convert<std::wstring>(dir_name));
#else
boost::filesystem::path dir_path(dir_name);
#endif
diff --git a/indra/llfilesystem/lldir_mac.cpp b/indra/llfilesystem/lldir_mac.cpp
index b25c654e31..785bd034e8 100644
--- a/indra/llfilesystem/lldir_mac.cpp
+++ b/indra/llfilesystem/lldir_mac.cpp
@@ -149,6 +149,9 @@ LLDir_Mac::LLDir_Mac()
mWorkingDir = getCurPath();
+/*
+ mLLPluginDir = mAppRODataDir + mDirDelimiter + "SLPlugin.app" + mDirDelimiter + "Contents" + mDirDelimiter + "Frameworks";
+*/
mLLPluginDir = mAppRODataDir + mDirDelimiter + "llplugin";
}
}
diff --git a/indra/llfilesystem/lldir_win32.cpp b/indra/llfilesystem/lldir_win32.cpp
index a607c70b44..58c080c982 100644
--- a/indra/llfilesystem/lldir_win32.cpp
+++ b/indra/llfilesystem/lldir_win32.cpp
@@ -172,7 +172,7 @@ LLDir_Win32::LLDir_Win32()
{
w_str[wcslen(w_str)-1] = '\0'; /* Flawfinder: ignore */ // remove trailing slash
}
- mTempDir = utf16str_to_utf8str(llutf16string(w_str));
+ mTempDir = ll_convert<std::string>(std::wstring(w_str));
if (mOSUserDir.empty())
{
@@ -225,14 +225,14 @@ LLDir_Win32::LLDir_Win32()
// Set working directory, for LLDir::getWorkingDir()
GetCurrentDirectory(MAX_PATH, w_str);
- mWorkingDir = utf16str_to_utf8str(llutf16string(w_str));
+ mWorkingDir = ll_convert<std::string>(std::wstring(w_str));
// Set the executable directory
S32 size = GetModuleFileName(NULL, w_str, MAX_PATH);
if (size)
{
w_str[size] = '\0';
- mExecutablePathAndName = utf16str_to_utf8str(llutf16string(w_str));
+ mExecutablePathAndName = ll_convert<std::string>(std::wstring(w_str));
auto path_end = mExecutablePathAndName.find_last_of('\\');
if (path_end != std::string::npos)
{
@@ -347,8 +347,8 @@ U32 LLDir_Win32::countFilesInDir(const std::string &dirname, const std::string &
WIN32_FIND_DATA FileData;
- llutf16string pathname = utf8str_to_utf16str(dirname);
- pathname += utf8str_to_utf16str(mask);
+ std::wstring pathname = ll_convert<std::wstring>(dirname);
+ pathname += ll_convert<std::wstring>(mask);
if ((count_search_h = FindFirstFile(pathname.c_str(), &FileData)) != INVALID_HANDLE_VALUE)
{
@@ -370,7 +370,7 @@ std::string LLDir_Win32::getCurPath()
WCHAR w_str[MAX_PATH];
GetCurrentDirectory(MAX_PATH, w_str);
- return utf16str_to_utf8str(llutf16string(w_str));
+ return ll_convert<std::string>(std::wstring(w_str));
}
diff --git a/indra/llfilesystem/lldir_win32.h b/indra/llfilesystem/lldir_win32.h
index ab2726f1a0..21a3f1213b 100644
--- a/indra/llfilesystem/lldir_win32.h
+++ b/indra/llfilesystem/lldir_win32.h
@@ -51,7 +51,7 @@ public:
private:
void* mDirSearch_h{ nullptr };
- llutf16string mCurrentDir;
+ std::wstring mCurrentDir;
};
#endif // LL_LLDIR_WIN32_H
diff --git a/indra/llfilesystem/lldirguard.h b/indra/llfilesystem/lldirguard.h
index fcb179bbc8..c6ce13efb4 100644
--- a/indra/llfilesystem/lldirguard.h
+++ b/indra/llfilesystem/lldirguard.h
@@ -31,6 +31,9 @@
#include "llerror.h"
#if LL_WINDOWS
+
+#include "llwin32headers.h"
+
class LLDirectoryGuard
{
public:
@@ -46,8 +49,8 @@ public:
(wcsncmp(mOrigDir,mFinalDir,mOrigDirLen)!=0))
{
// Dir has changed
- std::string mOrigDirUtf8 = utf16str_to_utf8str(llutf16string(mOrigDir));
- std::string mFinalDirUtf8 = utf16str_to_utf8str(llutf16string(mFinalDir));
+ std::string mOrigDirUtf8 = ll_convert<std::string>(std::wstring(mOrigDir));
+ std::string mFinalDirUtf8 = ll_convert<std::string>(std::wstring(mFinalDir));
LL_INFOS() << "Resetting working dir from " << mFinalDirUtf8 << " to " << mOrigDirUtf8 << LL_ENDL;
SetCurrentDirectory(mOrigDir);
}
diff --git a/indra/llfilesystem/lldiriterator.cpp b/indra/llfilesystem/lldiriterator.cpp
index cd99c79357..a6eb4adf7f 100644
--- a/indra/llfilesystem/lldiriterator.cpp
+++ b/indra/llfilesystem/lldiriterator.cpp
@@ -52,7 +52,7 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask)
: mIsValid(false)
{
#ifdef LL_WINDOWS // or BOOST_WINDOWS_API
- fs::path dir_path(utf8str_to_utf16str(dirname));
+ fs::path dir_path(ll_convert<std::wstring>(dirname));
#else
fs::path dir_path(dirname);
#endif
diff --git a/indra/llfilesystem/lldiskcache.cpp b/indra/llfilesystem/lldiskcache.cpp
index d9b223fb49..82e9e18918 100644
--- a/indra/llfilesystem/lldiskcache.cpp
+++ b/indra/llfilesystem/lldiskcache.cpp
@@ -103,7 +103,7 @@ void LLDiskCache::purge()
std::vector<file_info_t> file_info;
#if LL_WINDOWS
- std::wstring cache_path(utf8str_to_utf16str(sCacheDir));
+ std::wstring cache_path(ll_convert<std::wstring>(sCacheDir));
#else
std::string cache_path(sCacheDir);
#endif
@@ -240,7 +240,7 @@ void LLDiskCache::clearCache()
*/
boost::system::error_code ec;
#if LL_WINDOWS
- std::wstring cache_path(utf8str_to_utf16str(sCacheDir));
+ std::wstring cache_path(ll_convert<std::wstring>(sCacheDir));
#else
std::string cache_path(sCacheDir);
#endif
@@ -279,7 +279,7 @@ void LLDiskCache::removeOldVFSFiles()
boost::system::error_code ec;
#if LL_WINDOWS
- std::wstring cache_path(utf8str_to_utf16str(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "")));
+ std::wstring cache_path(ll_convert<std::wstring>(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, "")));
#else
std::string cache_path(gDirUtilp->getExpandedFilename(LL_PATH_CACHE, ""));
#endif
@@ -327,7 +327,7 @@ uintmax_t LLDiskCache::dirFileSize(const std::string& dir)
*/
boost::system::error_code ec;
#if LL_WINDOWS
- std::wstring dir_path(utf8str_to_utf16str(dir));
+ std::wstring dir_path(ll_convert<std::wstring>(dir));
#else
std::string dir_path(dir);
#endif
diff --git a/indra/llfilesystem/llfilesystem.cpp b/indra/llfilesystem/llfilesystem.cpp
index c8ce9531c2..5ce5244107 100644
--- a/indra/llfilesystem/llfilesystem.cpp
+++ b/indra/llfilesystem/llfilesystem.cpp
@@ -316,7 +316,7 @@ void LLFileSystem::updateFileAccessTime(const std::string& file_path)
boost::system::error_code ec;
#if LL_WINDOWS
// file last write time
- const std::time_t last_write_time = boost::filesystem::last_write_time(utf8str_to_utf16str(file_path), ec);
+ const std::time_t last_write_time = boost::filesystem::last_write_time(ll_convert<std::wstring>(file_path), ec);
if (ec.failed())
{
LL_WARNS() << "Failed to read last write time for cache file " << file_path << ": " << ec.message() << LL_ENDL;
@@ -330,7 +330,7 @@ void LLFileSystem::updateFileAccessTime(const std::string& file_path)
// before the last one
if (delta_time > time_threshold)
{
- boost::filesystem::last_write_time(utf8str_to_utf16str(file_path), cur_time, ec);
+ boost::filesystem::last_write_time(ll_convert<std::wstring>(file_path), cur_time, ec);
}
#else
// file last write time
diff --git a/indra/llfilesystem/tests/lldir_test.cpp b/indra/llfilesystem/tests/lldir_test.cpp
index 6e191ad096..d7d57fa86f 100644
--- a/indra/llfilesystem/tests/lldir_test.cpp
+++ b/indra/llfilesystem/tests/lldir_test.cpp
@@ -435,7 +435,7 @@ namespace tut
for (counter=0, foundUnused=false; !foundUnused; counter++ )
{
char counterStr[3];
- sprintf(counterStr, "%02d", counter);
+ snprintf(counterStr, sizeof(counterStr), "%02d", counter);
uniqueDir = dirbase + counterStr;
foundUnused = ! ( LLFile::isdir(uniqueDir) || LLFile::isfile(uniqueDir) );
}