mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-09-21 20:06:40 +00:00
path improvements/fixes:
- replace more std::wstring with Native or VfsPath; wstring_from_utf8 -> NativePathFromString - replace sequences of Join(Path(), Basename+extension) with ChangeExtension in wsdl, CacheLoader - add Path::IsDirectory to replace .empty() / path_is_dir_sep(.back()). also changed behavior to reflect the fact that "" is the VFS root _directory_ - Path::Join now allows 2 identical path types (e.g. VfsPath) or one char* literal (prevents inadvertently introducing non-safe characters). to convert from wstring or wchar_t, use an explicit ctor (e.g. VfsPath(wchar_t_string)) This was SVN commit r9091.
This commit is contained in:
@@ -289,7 +289,7 @@ void CSimulation2Impl::DumpState()
|
||||
|
||||
std::wstringstream name;
|
||||
name << L"sim_log/" << getpid() << L"/" << std::setw(5) << std::setfill(L'0') << m_TurnNumber << L".txt";
|
||||
NativePath path = Path::Join(psLogDir(), name.str());
|
||||
NativePath path = Path::Join(psLogDir(), NativePath(name.str()));
|
||||
CreateDirectories(Path::Path(path), 0700);
|
||||
std::ofstream file (StringFromNativePath(path).c_str(), std::ofstream::out | std::ofstream::trunc);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user