comparison src/core/filesystem.cpp @ 63:3d2decf093bb

*: fix many clang warnings
author Paper <mrpapersonic@gmail.com>
date Sun, 01 Oct 2023 06:39:47 -0400
parents 4c6dd5999b39
children fe719c109dbc
comparison
equal deleted inserted replaced
62:4c6dd5999b39 63:3d2decf093bb
21 #include "core/strings.h" 21 #include "core/strings.h"
22 #include <limits.h> 22 #include <limits.h>
23 23
24 namespace Filesystem { 24 namespace Filesystem {
25 25
26 Path::Path() { _path = ""; } 26 Path::Path() {
27 Path::Path(const std::string& path) { _path = path; } 27 _path = "";
28 Path::Path(const Path& path) { _path = path.GetPath(); } 28 }
29 Path::Path(const std::string& path) {
30 _path = path;
31 }
32 Path::Path(const Path& path) {
33 _path = path.GetPath();
34 }
29 35
30 bool Path::CreateDirectories() const { 36 bool Path::CreateDirectories() const {
31 std::string temp = ""; 37 std::string temp = "";
32 size_t start; 38 size_t start;
33 size_t end = 0; 39 size_t end = 0;
88 94
89 Path GetDotPath(void) { 95 Path GetDotPath(void) {
90 std::string ret = ""; 96 std::string ret = "";
91 #ifdef WIN32 97 #ifdef WIN32
92 std::wstring buf(MAX_PATH, '\0'); 98 std::wstring buf(MAX_PATH, '\0');
93 if (SHGetFolderPathAndSubDirW(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, CONFIG_WDIR, &buf.front()) == S_OK) { 99 if (SHGetFolderPathAndSubDirW(NULL, CSIDL_APPDATA | CSIDL_FLAG_CREATE, NULL, 0, CONFIG_WDIR, &buf.front()) ==
100 S_OK) {
94 buf.resize(buf.find('\0')); 101 buf.resize(buf.find('\0'));
95 ret += Strings::ToUtf8String(buf); 102 ret += Strings::ToUtf8String(buf);
96 } 103 }
97 #elif defined(MACOSX) 104 #elif defined(MACOSX)
98 ret += osx::GetApplicationSupportDirectory(); 105 ret += osx::GetApplicationSupportDirectory();