| 70 | } |
| 71 | |
| 72 | int Paths::AddPath(const char* path) { |
| 73 | RemovePath(path); |
| 74 | string withTrailing = SanitizePath(AssemblePath(string(path), string())); |
| 75 | if (num_paths < kMaxPaths) { |
| 76 | FormatString(paths[num_paths], kPathSize, "%s", withTrailing.c_str()); |
| 77 | mod_path_ids[num_paths] = CoreGameModID; |
| 78 | ++num_paths; |
| 79 | return num_paths - 1; |
| 80 | } else { |
| 81 | LOGE << "All preallocated filesystem paths are utilized, this isn't intended to occur, contact developer." << endl; |
| 82 | |
| 83 | LOGE << "Printing all currently registered paths, are there duplicates, empty or invalid entries?" << endl; |
| 84 | for (int i = 0; i < kMaxPaths; i++) { |
| 85 | LOGE << i << ":" << paths[i] << endl; |
| 86 | } |
| 87 | |
| 88 | LOG_ASSERT(false); |
| 89 | |
| 90 | return -1; |
| 91 | } |
| 92 | } |
| 93 | |
| 94 | bool Paths::AddModPath(const char* path, ModID modid) { |
| 95 | string withTrailing = SanitizePath(AssemblePath(string(path), string())); |
no test coverage detected