24
24
25
25
#include " ScriptHandler.h"
26
26
27
- #include < infra/filesystem.hpp>
28
27
#include < vector>
29
28
30
29
#include " coding2utf16.h"
@@ -160,19 +159,19 @@ int ScriptHandler::fpath(const char *path, char *result, bool use_save_dir) {
160
159
const char *prefix_dir =
161
160
(use_save_dir && save_dir) ? save_dir : archive_path;
162
161
const int prefix_dir_size = strlen (prefix_dir);
163
- if (std ::fs::path (path).is_absolute () || path[0 ] == ' .' ) {
162
+ if (onscripter ::fs::path (path).is_absolute () || path[0 ] == ' .' ) {
164
163
strcpy (result, path);
165
164
} else if (strncmp (path, prefix_dir, prefix_dir_size) != 0 ) {
166
- strcpy (result, (std ::fs::path (prefix_dir) / path).string ().c_str ());
165
+ strcpy (result, (onscripter ::fs::path (prefix_dir) / path).string ().c_str ());
167
166
}
168
167
char *buf = result;
169
168
while (*buf != ' \0 ' ) {
170
169
if ((*buf == ' /' || *buf == ' \\ ' ) &&
171
- *buf != std ::fs::path::preferred_separator)
172
- *buf = std ::fs::path::preferred_separator;
170
+ *buf != onscripter ::fs::path::preferred_separator)
171
+ *buf = onscripter ::fs::path::preferred_separator;
173
172
buf++;
174
173
}
175
- strcpy (result, std ::fs::absolute (result).string ().c_str ());
174
+ strcpy (result, onscripter ::fs::absolute (result).string ().c_str ());
176
175
return 0 ;
177
176
}
178
177
@@ -1100,7 +1099,7 @@ int ScriptHandler::readScript(char *path) {
1100
1099
}
1101
1100
1102
1101
onscripter::Vector<onscripter::String> unencrypt;
1103
- std ::fs::path root_dir;
1102
+ onscripter ::fs::path root_dir;
1104
1103
if (archive_path && *archive_path) {
1105
1104
root_dir = archive_path;
1106
1105
} else {
@@ -1110,7 +1109,7 @@ int ScriptHandler::readScript(char *path) {
1110
1109
fclose (fp);
1111
1110
estimated_buffer_length = 1 ;
1112
1111
1113
- for (auto f : std ::fs::directory_iterator (root_dir)) {
1112
+ for (auto f : onscripter ::fs::directory_iterator (root_dir)) {
1114
1113
auto _fp = f.path ();
1115
1114
if (f.is_regular_file () && _fp.extension () == " .txt" ) {
1116
1115
auto str = _fp.filename ().string ();
0 commit comments