mirror of https://github.com/OpenRCT2/OpenRCT2.git
Merge pull request #4995 from IntelOrca/refactor/track-design-repository-stdstring
Refactor track design repository to use std::string
This commit is contained in:
commit
44d9464d6b
|
@ -26,22 +26,22 @@ extern "C"
|
||||||
|
|
||||||
namespace File
|
namespace File
|
||||||
{
|
{
|
||||||
bool Copy(const utf8 * srcPath, const utf8 * dstPath, bool overwrite)
|
bool Copy(const std::string &srcPath, const std::string &dstPath, bool overwrite)
|
||||||
{
|
{
|
||||||
return platform_file_copy(srcPath, dstPath, overwrite);
|
return platform_file_copy(srcPath.c_str(), dstPath.c_str(), overwrite);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Delete(const utf8 * path)
|
bool Delete(const std::string &path)
|
||||||
{
|
{
|
||||||
return platform_file_delete(path);
|
return platform_file_delete(path.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Move(const utf8 * srcPath, const utf8 * dstPath)
|
bool Move(const std::string &srcPath, const std::string &dstPath)
|
||||||
{
|
{
|
||||||
return platform_file_move(srcPath, dstPath);
|
return platform_file_move(srcPath.c_str(), dstPath.c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
void * ReadAllBytes(const utf8 * path, size_t * length)
|
void * ReadAllBytes(const std::string &path, size_t * length)
|
||||||
{
|
{
|
||||||
void * result = nullptr;
|
void * result = nullptr;
|
||||||
|
|
||||||
|
|
|
@ -16,12 +16,13 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
|
|
||||||
namespace File
|
namespace File
|
||||||
{
|
{
|
||||||
bool Copy(const utf8 * srcPath, const utf8 * dstPath, bool overwrite);
|
bool Copy(const std::string &srcPath, const std::string &dstPath, bool overwrite);
|
||||||
bool Delete(const utf8 * path);
|
bool Delete(const std::string &path);
|
||||||
bool Move(const utf8 * srcPath, const utf8 * dstPath);
|
bool Move(const std::string &srcPath, const std::string &dstPath);
|
||||||
void * ReadAllBytes(const utf8 * path, size_t * length);
|
void * ReadAllBytes(const std::string &path, size_t * length);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <stack>
|
#include <stack>
|
||||||
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "FileScanner.h"
|
#include "FileScanner.h"
|
||||||
#include "Memory.hpp"
|
#include "Memory.hpp"
|
||||||
|
@ -45,10 +46,10 @@ extern "C"
|
||||||
#include "../platform/platform.h"
|
#include "../platform/platform.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
enum DIRECTORY_CHILD_TYPE
|
enum class DIRECTORY_CHILD_TYPE
|
||||||
{
|
{
|
||||||
DCT_DIRECTORY,
|
DIRECTORY,
|
||||||
DCT_FILE,
|
FILE,
|
||||||
};
|
};
|
||||||
|
|
||||||
struct DirectoryChild
|
struct DirectoryChild
|
||||||
|
@ -75,10 +76,9 @@ private:
|
||||||
};
|
};
|
||||||
|
|
||||||
// Options
|
// Options
|
||||||
utf8 * _rootPath;
|
std::string _rootPath;
|
||||||
utf8 * * _patterns;
|
std::vector<std::string> _patterns;
|
||||||
size_t _numPatterns;
|
bool _recurse;
|
||||||
bool _recurse;
|
|
||||||
|
|
||||||
// State
|
// State
|
||||||
bool _started;
|
bool _started;
|
||||||
|
@ -89,12 +89,11 @@ private:
|
||||||
utf8 * _currentPath;
|
utf8 * _currentPath;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FileScannerBase(const utf8 * pattern, bool recurse)
|
FileScannerBase(const std::string &pattern, bool recurse)
|
||||||
{
|
{
|
||||||
_rootPath = Memory::Allocate<utf8>(MAX_PATH);
|
_rootPath = Path::GetDirectory(pattern);
|
||||||
Path::GetDirectory(_rootPath, MAX_PATH, pattern);
|
|
||||||
_recurse = recurse;
|
_recurse = recurse;
|
||||||
_numPatterns = GetPatterns(&_patterns, Path::GetFileName(pattern));
|
_patterns = GetPatterns(Path::GetFileName(pattern));
|
||||||
|
|
||||||
_currentPath = Memory::Allocate<utf8>(MAX_PATH);
|
_currentPath = Memory::Allocate<utf8>(MAX_PATH);
|
||||||
_currentFileInfo = Memory::Allocate<FileInfo>();
|
_currentFileInfo = Memory::Allocate<FileInfo>();
|
||||||
|
@ -104,12 +103,6 @@ public:
|
||||||
|
|
||||||
~FileScannerBase() override
|
~FileScannerBase() override
|
||||||
{
|
{
|
||||||
Memory::Free(_rootPath);
|
|
||||||
for (size_t i = 0; i < _numPatterns; i++)
|
|
||||||
{
|
|
||||||
Memory::Free(_patterns[i]);
|
|
||||||
}
|
|
||||||
Memory::Free(_patterns);
|
|
||||||
Memory::Free(_currentPath);
|
Memory::Free(_currentPath);
|
||||||
Memory::Free(_currentFileInfo);
|
Memory::Free(_currentFileInfo);
|
||||||
}
|
}
|
||||||
|
@ -127,7 +120,7 @@ public:
|
||||||
const utf8 * GetPathRelative() const override
|
const utf8 * GetPathRelative() const override
|
||||||
{
|
{
|
||||||
// +1 to remove the path separator
|
// +1 to remove the path separator
|
||||||
return _currentPath + String::SizeOf(_rootPath) + 1;
|
return _currentPath + _rootPath.size() + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Reset() override
|
void Reset() override
|
||||||
|
@ -156,7 +149,7 @@ public:
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
const DirectoryChild * child = &state->Listing[state->Index];
|
const DirectoryChild * child = &state->Listing[state->Index];
|
||||||
if (child->Type == DCT_DIRECTORY)
|
if (child->Type == DIRECTORY_CHILD_TYPE::DIRECTORY)
|
||||||
{
|
{
|
||||||
utf8 childPath[MAX_PATH];
|
utf8 childPath[MAX_PATH];
|
||||||
String::Set(childPath, sizeof(childPath), state->Path.c_str());
|
String::Set(childPath, sizeof(childPath), state->Path.c_str());
|
||||||
|
@ -164,7 +157,7 @@ public:
|
||||||
|
|
||||||
PushState(childPath);
|
PushState(childPath);
|
||||||
}
|
}
|
||||||
else if (PatternMatch(child->Name.c_str()))
|
else if (PatternMatch(child->Name))
|
||||||
{
|
{
|
||||||
String::Set(_currentPath, MAX_PATH, state->Path.c_str());
|
String::Set(_currentPath, MAX_PATH, state->Path.c_str());
|
||||||
Path::Append(_currentPath, MAX_PATH, child->Name.c_str());
|
Path::Append(_currentPath, MAX_PATH, child->Name.c_str());
|
||||||
|
@ -180,20 +173,20 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void PushState(const utf8 * directory)
|
void PushState(const std::string &directory)
|
||||||
{
|
{
|
||||||
DirectoryState newState;
|
DirectoryState newState;
|
||||||
newState.Path = std::string(directory);
|
newState.Path = directory;
|
||||||
newState.Index = -1;
|
newState.Index = -1;
|
||||||
GetDirectoryChildren(newState.Listing, directory);
|
GetDirectoryChildren(newState.Listing, directory);
|
||||||
_directoryStack.push(newState);
|
_directoryStack.push(newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool PatternMatch(const utf8 * fileName)
|
bool PatternMatch(const std::string &fileName)
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < _numPatterns; i++)
|
for (const auto &pattern : _patterns)
|
||||||
{
|
{
|
||||||
if (MatchWildcard(fileName, _patterns[i]))
|
if (MatchWildcard(fileName.c_str(), pattern.c_str()))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -201,11 +194,11 @@ private:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static size_t GetPatterns(utf8 * * * outPatterns, const utf8 * delimitedPatterns)
|
static std::vector<std::string> GetPatterns(const std::string &delimitedPatterns)
|
||||||
{
|
{
|
||||||
std::vector<utf8 *> patterns;
|
std::vector<std::string> patterns;
|
||||||
|
|
||||||
const utf8 * start = delimitedPatterns;
|
const utf8 * start = delimitedPatterns.c_str();
|
||||||
const utf8 * ch = start;
|
const utf8 * ch = start;
|
||||||
utf8 c;
|
utf8 c;
|
||||||
do
|
do
|
||||||
|
@ -216,9 +209,7 @@ private:
|
||||||
size_t length = (size_t)(ch - start);
|
size_t length = (size_t)(ch - start);
|
||||||
if (length > 0)
|
if (length > 0)
|
||||||
{
|
{
|
||||||
utf8 * newPattern = Memory::Allocate<utf8>(length + 1);
|
std::string newPattern = std::string(start, length);
|
||||||
Memory::Copy(newPattern, start, length);
|
|
||||||
newPattern[length] = '\0';
|
|
||||||
patterns.push_back(newPattern);
|
patterns.push_back(newPattern);
|
||||||
}
|
}
|
||||||
start = ch + 1;
|
start = ch + 1;
|
||||||
|
@ -227,12 +218,12 @@ private:
|
||||||
}
|
}
|
||||||
while (c != '\0');
|
while (c != '\0');
|
||||||
|
|
||||||
*outPatterns = Memory::DuplicateArray(patterns.data(), patterns.size());
|
patterns.shrink_to_fit();
|
||||||
return patterns.size();
|
return patterns;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void GetDirectoryChildren(std::vector<DirectoryChild> &children, const utf8 * path) abstract;
|
virtual void GetDirectoryChildren(std::vector<DirectoryChild> &children, const std::string &path) abstract;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -241,21 +232,16 @@ protected:
|
||||||
class FileScannerWindows final : public FileScannerBase
|
class FileScannerWindows final : public FileScannerBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FileScannerWindows(const utf8 * pattern, bool recurse)
|
FileScannerWindows(const std::string &pattern, bool recurse)
|
||||||
: FileScannerBase(pattern, recurse)
|
: FileScannerBase(pattern, recurse)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void GetDirectoryChildren(std::vector<DirectoryChild> &children, const utf8 * path) override
|
void GetDirectoryChildren(std::vector<DirectoryChild> &children, const std::string &path) override
|
||||||
{
|
{
|
||||||
size_t pathLength = String::SizeOf(path);
|
std::string pattern = path + "\\*";
|
||||||
utf8 * pattern = Memory::Duplicate(path, pathLength + 3);
|
wchar_t * wPattern = utf8_to_widechar(pattern.c_str());
|
||||||
pattern[pathLength + 0] = '\\';
|
|
||||||
pattern[pathLength + 1] = '*';
|
|
||||||
pattern[pathLength + 2] = '\0';
|
|
||||||
|
|
||||||
wchar_t * wPattern = utf8_to_widechar(pattern);
|
|
||||||
|
|
||||||
WIN32_FIND_DATAW findData;
|
WIN32_FIND_DATAW findData;
|
||||||
HANDLE hFile = FindFirstFileW(wPattern, &findData);
|
HANDLE hFile = FindFirstFileW(wPattern, &findData);
|
||||||
|
@ -274,7 +260,6 @@ protected:
|
||||||
FindClose(hFile);
|
FindClose(hFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
Memory::Free(pattern);
|
|
||||||
Memory::Free(wPattern);
|
Memory::Free(wPattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -289,11 +274,11 @@ private:
|
||||||
|
|
||||||
if (child->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
if (child->dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
|
||||||
{
|
{
|
||||||
result.Type = DCT_DIRECTORY;
|
result.Type = DIRECTORY_CHILD_TYPE::DIRECTORY;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result.Type = DCT_FILE;
|
result.Type = DIRECTORY_CHILD_TYPE::FILE;
|
||||||
result.Size = ((uint64)child->nFileSizeHigh << 32ULL) | (uint64)child->nFileSizeLow;
|
result.Size = ((uint64)child->nFileSizeHigh << 32ULL) | (uint64)child->nFileSizeLow;
|
||||||
result.LastModified = ((uint64)child->ftLastWriteTime.dwHighDateTime << 32ULL) | (uint64)child->ftLastWriteTime.dwLowDateTime;
|
result.LastModified = ((uint64)child->ftLastWriteTime.dwHighDateTime << 32ULL) | (uint64)child->ftLastWriteTime.dwLowDateTime;
|
||||||
}
|
}
|
||||||
|
@ -308,16 +293,16 @@ private:
|
||||||
class FileScannerUnix final : public FileScannerBase
|
class FileScannerUnix final : public FileScannerBase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FileScannerUnix(const utf8 * pattern, bool recurse)
|
FileScannerUnix(const std::string &pattern, bool recurse)
|
||||||
: FileScannerBase(pattern, recurse)
|
: FileScannerBase(pattern, recurse)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void GetDirectoryChildren(std::vector<DirectoryChild> &children, const utf8 * path) override
|
void GetDirectoryChildren(std::vector<DirectoryChild> &children, const std::string &path) override
|
||||||
{
|
{
|
||||||
struct dirent * * namelist;
|
struct dirent * * namelist;
|
||||||
int count = scandir(path, &namelist, FilterFunc, alphasort);
|
int count = scandir(path.c_str(), &namelist, FilterFunc, alphasort);
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
for (int i = 0; i < count; i++)
|
for (int i = 0; i < count; i++)
|
||||||
|
@ -326,7 +311,7 @@ protected:
|
||||||
if (!String::Equals(node->d_name, ".") &&
|
if (!String::Equals(node->d_name, ".") &&
|
||||||
!String::Equals(node->d_name, ".."))
|
!String::Equals(node->d_name, ".."))
|
||||||
{
|
{
|
||||||
DirectoryChild child = CreateChild(path, node);
|
DirectoryChild child = CreateChild(path.c_str(), node);
|
||||||
children.push_back(child);
|
children.push_back(child);
|
||||||
}
|
}
|
||||||
free(namelist[i]);
|
free(namelist[i]);
|
||||||
|
@ -347,11 +332,11 @@ private:
|
||||||
result.Name = std::string(node->d_name);
|
result.Name = std::string(node->d_name);
|
||||||
if (node->d_type & DT_DIR)
|
if (node->d_type & DT_DIR)
|
||||||
{
|
{
|
||||||
result.Type = DCT_DIRECTORY;
|
result.Type = DIRECTORY_CHILD_TYPE::DIRECTORY;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
result.Type = DCT_FILE;
|
result.Type = DIRECTORY_CHILD_TYPE::FILE;
|
||||||
|
|
||||||
// Get the full path of the file
|
// Get the full path of the file
|
||||||
size_t pathSize = String::SizeOf(directory) + 1 + String::SizeOf(node->d_name) + 1;
|
size_t pathSize = String::SizeOf(directory) + 1 + String::SizeOf(node->d_name) + 1;
|
||||||
|
@ -375,7 +360,7 @@ private:
|
||||||
|
|
||||||
#endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
#endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))
|
||||||
|
|
||||||
IFileScanner * Path::ScanDirectory(const utf8 * pattern, bool recurse)
|
IFileScanner * Path::ScanDirectory(const std::string &pattern, bool recurse)
|
||||||
{
|
{
|
||||||
#ifdef __WINDOWS__
|
#ifdef __WINDOWS__
|
||||||
return new FileScannerWindows(pattern, recurse);
|
return new FileScannerWindows(pattern, recurse);
|
||||||
|
@ -384,7 +369,7 @@ IFileScanner * Path::ScanDirectory(const utf8 * pattern, bool recurse)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Path::QueryDirectory(QueryDirectoryResult * result, const utf8 * pattern)
|
void Path::QueryDirectory(QueryDirectoryResult * result, const std::string &pattern)
|
||||||
{
|
{
|
||||||
IFileScanner * scanner = Path::ScanDirectory(pattern, true);
|
IFileScanner * scanner = Path::ScanDirectory(pattern, true);
|
||||||
while (scanner->Next())
|
while (scanner->Next())
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
#include "../common.h"
|
#include "../common.h"
|
||||||
|
|
||||||
struct FileInfo
|
struct FileInfo
|
||||||
|
@ -54,7 +55,7 @@ namespace Path
|
||||||
* @param recurse Whether to scan sub directories or not.
|
* @param recurse Whether to scan sub directories or not.
|
||||||
* @returns A new FileScanner, this must be deleted when no longer needed.
|
* @returns A new FileScanner, this must be deleted when no longer needed.
|
||||||
*/
|
*/
|
||||||
IFileScanner * ScanDirectory(const utf8 * pattern, bool recurse);
|
IFileScanner * ScanDirectory(const std::string &pattern, bool recurse);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Scans a directory and all sub directories
|
* Scans a directory and all sub directories
|
||||||
|
@ -62,5 +63,5 @@ namespace Path
|
||||||
* @param pattern The path followed by a semi-colon delimited list of wildcard patterns.
|
* @param pattern The path followed by a semi-colon delimited list of wildcard patterns.
|
||||||
* @returns An aggregated result of all scanned files.
|
* @returns An aggregated result of all scanned files.
|
||||||
*/
|
*/
|
||||||
void QueryDirectory(QueryDirectoryResult * result, const utf8 * pattern);
|
void QueryDirectory(QueryDirectoryResult * result, const std::string &pattern);
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,19 @@ namespace Path
|
||||||
return safe_strcat_path(buffer, src, bufferSize);
|
return safe_strcat_path(buffer, src, bufferSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string Combine(const std::string &a, const std::string &b)
|
||||||
|
{
|
||||||
|
utf8 buffer[MAX_PATH];
|
||||||
|
String::Set(buffer, sizeof(buffer), a.c_str());
|
||||||
|
Path::Append(buffer, sizeof(buffer), b.c_str());
|
||||||
|
return std::string(buffer);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string GetDirectory(const std::string &path)
|
||||||
|
{
|
||||||
|
return GetDirectory(path.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
utf8 * GetDirectory(const utf8 * path)
|
utf8 * GetDirectory(const utf8 * path)
|
||||||
{
|
{
|
||||||
size_t maxSize = String::SizeOf(path) + 1;
|
size_t maxSize = String::SizeOf(path) + 1;
|
||||||
|
@ -58,6 +71,11 @@ namespace Path
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GetFileName(const std::string &path)
|
||||||
|
{
|
||||||
|
return GetFileName(path.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
const utf8 * GetFileName(const utf8 * path)
|
const utf8 * GetFileName(const utf8 * path)
|
||||||
{
|
{
|
||||||
const utf8 * lastPathSeperator = nullptr;
|
const utf8 * lastPathSeperator = nullptr;
|
||||||
|
@ -81,6 +99,14 @@ namespace Path
|
||||||
lastPathSeperator + 1;
|
lastPathSeperator + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string GetFileNameWithoutExtension(const std::string &path)
|
||||||
|
{
|
||||||
|
utf8 * cstr = GetFileNameWithoutExtension(path.c_str());
|
||||||
|
std::string result = String::ToStd(cstr);
|
||||||
|
Memory::Free(cstr);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
utf8 * GetFileNameWithoutExtension(const utf8 * path)
|
utf8 * GetFileNameWithoutExtension(const utf8 * path)
|
||||||
{
|
{
|
||||||
size_t maxSize = String::SizeOf(path) + 1;
|
size_t maxSize = String::SizeOf(path) + 1;
|
||||||
|
@ -116,6 +142,11 @@ namespace Path
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const std::string GetExtension(const std::string &path)
|
||||||
|
{
|
||||||
|
return GetExtension(path.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
const utf8 * GetExtension(const utf8 * path)
|
const utf8 * GetExtension(const utf8 * path)
|
||||||
{
|
{
|
||||||
const utf8 * lastDot = nullptr;
|
const utf8 * lastDot = nullptr;
|
||||||
|
@ -171,6 +202,11 @@ namespace Path
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool Equals(const std::string &a, const std::string &b)
|
||||||
|
{
|
||||||
|
return String::Equals(a.c_str(), b.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
bool Equals(const utf8 * a, const utf8 * b)
|
bool Equals(const utf8 * a, const utf8 * b)
|
||||||
{
|
{
|
||||||
bool ignoreCase = false;
|
bool ignoreCase = false;
|
||||||
|
|
|
@ -16,20 +16,24 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
extern "C"
|
#include <string>
|
||||||
{
|
#include "../common.h"
|
||||||
#include "../common.h"
|
|
||||||
}
|
|
||||||
|
|
||||||
namespace Path
|
namespace Path
|
||||||
{
|
{
|
||||||
utf8 * Append(utf8 * buffer, size_t bufferSize, const utf8 * src);
|
utf8 * Append(utf8 * buffer, size_t bufferSize, const utf8 * src);
|
||||||
|
std::string Combine(const std::string &a, const std::string &b);
|
||||||
|
std::string GetDirectory(const std::string &path);
|
||||||
utf8 * GetDirectory(const utf8 * path);
|
utf8 * GetDirectory(const utf8 * path);
|
||||||
utf8 * GetDirectory(utf8 * buffer, size_t bufferSize, const utf8 * path);
|
utf8 * GetDirectory(utf8 * buffer, size_t bufferSize, const utf8 * path);
|
||||||
|
std::string GetFileName(const std::string &path);
|
||||||
const utf8 * GetFileName(const utf8 * path);
|
const utf8 * GetFileName(const utf8 * path);
|
||||||
|
std::string GetFileNameWithoutExtension(const std::string &path);
|
||||||
utf8 * GetFileNameWithoutExtension(const utf8 * path);
|
utf8 * GetFileNameWithoutExtension(const utf8 * path);
|
||||||
utf8 * GetFileNameWithoutExtension(utf8 * buffer, size_t bufferSize, const utf8 * path);
|
utf8 * GetFileNameWithoutExtension(utf8 * buffer, size_t bufferSize, const utf8 * path);
|
||||||
|
const std::string GetExtension(const std::string &path);
|
||||||
const utf8 * GetExtension(const utf8 * path);
|
const utf8 * GetExtension(const utf8 * path);
|
||||||
utf8 * GetAbsolute(utf8 * buffer, size_t bufferSize, const utf8 * relativePath);
|
utf8 * GetAbsolute(utf8 * buffer, size_t bufferSize, const utf8 * relativePath);
|
||||||
|
bool Equals(const std::string &a, const std::string &b);
|
||||||
bool Equals(const utf8 * a, const utf8 * b);
|
bool Equals(const utf8 * a, const utf8 * b);
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,6 +50,31 @@ namespace String
|
||||||
return str == nullptr || str[0] == '\0';
|
return str == nullptr || str[0] == '\0';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sint32 Compare(const std::string &a, const std::string &b, bool ignoreCase)
|
||||||
|
{
|
||||||
|
return Compare(a.c_str(), b.c_str(), ignoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
|
sint32 Compare(const utf8 * a, const utf8 * b, bool ignoreCase)
|
||||||
|
{
|
||||||
|
if (a == b) return true;
|
||||||
|
if (a == nullptr || b == nullptr) return false;
|
||||||
|
|
||||||
|
if (ignoreCase)
|
||||||
|
{
|
||||||
|
return _stricmp(a, b);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return strcmp(a, b);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bool Equals(const std::string &a, const std::string &b, bool ignoreCase)
|
||||||
|
{
|
||||||
|
return Equals(a.c_str(), b.c_str(), ignoreCase);
|
||||||
|
}
|
||||||
|
|
||||||
bool Equals(const utf8 * a, const utf8 * b, bool ignoreCase)
|
bool Equals(const utf8 * a, const utf8 * b, bool ignoreCase)
|
||||||
{
|
{
|
||||||
if (a == b) return true;
|
if (a == b) return true;
|
||||||
|
@ -247,6 +272,11 @@ namespace String
|
||||||
return buffer;
|
return buffer;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
utf8 * Duplicate(const std::string &src)
|
||||||
|
{
|
||||||
|
return String::Duplicate(src.c_str());
|
||||||
|
}
|
||||||
|
|
||||||
utf8 * Duplicate(const utf8 * src)
|
utf8 * Duplicate(const utf8 * src)
|
||||||
{
|
{
|
||||||
utf8 * result = nullptr;
|
utf8 * result = nullptr;
|
||||||
|
|
|
@ -27,6 +27,9 @@ namespace String
|
||||||
std::string StdFormat(const utf8 * format, ...);
|
std::string StdFormat(const utf8 * format, ...);
|
||||||
|
|
||||||
bool IsNullOrEmpty(const utf8 * str);
|
bool IsNullOrEmpty(const utf8 * str);
|
||||||
|
sint32 Compare(const std::string &a, const std::string &b, bool ignoreCase = false);
|
||||||
|
sint32 Compare(const utf8 * a, const utf8 * b, bool ignoreCase = false);
|
||||||
|
bool Equals(const std::string &a, const std::string &b, bool ignoreCase = false);
|
||||||
bool Equals(const utf8 * a, const utf8 * b, bool ignoreCase = false);
|
bool Equals(const utf8 * a, const utf8 * b, bool ignoreCase = false);
|
||||||
bool StartsWith(const utf8 * str, const utf8 * match, bool ignoreCase = false);
|
bool StartsWith(const utf8 * str, const utf8 * match, bool ignoreCase = false);
|
||||||
size_t LastIndexOf(const utf8 * str, utf8 match);
|
size_t LastIndexOf(const utf8 * str, utf8 match);
|
||||||
|
@ -48,6 +51,7 @@ namespace String
|
||||||
utf8 * Format(const utf8 * format, ...);
|
utf8 * Format(const utf8 * format, ...);
|
||||||
utf8 * Format_VA(const utf8 * format, va_list args);
|
utf8 * Format_VA(const utf8 * format, va_list args);
|
||||||
utf8 * AppendFormat(utf8 * buffer, size_t bufferSize, const utf8 * format, ...);
|
utf8 * AppendFormat(utf8 * buffer, size_t bufferSize, const utf8 * format, ...);
|
||||||
|
utf8 * Duplicate(const std::string &src);
|
||||||
utf8 * Duplicate(const utf8 * src);
|
utf8 * Duplicate(const utf8 * src);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
#include "../core/Collections.hpp"
|
||||||
#include "../core/Console.hpp"
|
#include "../core/Console.hpp"
|
||||||
#include "../core/File.h"
|
#include "../core/File.h"
|
||||||
#include "../core/FileScanner.h"
|
#include "../core/FileScanner.h"
|
||||||
|
@ -65,6 +66,8 @@ enum TRACK_REPO_ITEM_FLAGS
|
||||||
class TrackDesignRepository : public ITrackDesignRepository
|
class TrackDesignRepository : public ITrackDesignRepository
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
|
static constexpr const utf8 * TD_FILE_PATTERN = "*.td4;*.td6";
|
||||||
|
|
||||||
IPlatformEnvironment * _env;
|
IPlatformEnvironment * _env;
|
||||||
|
|
||||||
std::vector<TrackRepositoryItem> _items;
|
std::vector<TrackRepositoryItem> _items;
|
||||||
|
@ -87,13 +90,13 @@ public:
|
||||||
return _items.size();
|
return _items.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t GetCountForObjectEntry(uint8 rideType, const utf8 * entry) const override
|
size_t GetCountForObjectEntry(uint8 rideType, const std::string &entry) const override
|
||||||
{
|
{
|
||||||
size_t count = 0;
|
size_t count = 0;
|
||||||
for (const auto item : _items)
|
for (const auto item : _items)
|
||||||
{
|
{
|
||||||
if (item.RideType == rideType &&
|
if (item.RideType == rideType &&
|
||||||
(entry == nullptr || String::Equals(item.ObjectEntry.c_str(), entry, true)))
|
(entry.empty() || String::Equals(item.ObjectEntry, entry, true)))
|
||||||
{
|
{
|
||||||
count++;
|
count++;
|
||||||
}
|
}
|
||||||
|
@ -101,26 +104,22 @@ public:
|
||||||
return count;
|
return count;
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t GetItemsForObjectEntry(track_design_file_ref * * outRefs, uint8 rideType, const utf8 * entry) const override
|
size_t GetItemsForObjectEntry(track_design_file_ref * * outRefs, uint8 rideType, const std::string &entry) const override
|
||||||
{
|
{
|
||||||
std::vector<track_design_file_ref> refs;
|
std::vector<track_design_file_ref> refs;
|
||||||
for (const auto item : _items)
|
for (const auto item : _items)
|
||||||
{
|
{
|
||||||
if (item.RideType == rideType &&
|
if (item.RideType == rideType &&
|
||||||
(entry == nullptr || String::Equals(item.ObjectEntry.c_str(), entry, true)))
|
(entry.empty() || String::Equals(item.ObjectEntry, entry, true)))
|
||||||
{
|
{
|
||||||
track_design_file_ref ref;
|
track_design_file_ref ref;
|
||||||
ref.name = GetNameFromTrackPath(item.Path.c_str());
|
ref.name = String::Duplicate(GetNameFromTrackPath(item.Path));
|
||||||
ref.path = String::Duplicate(item.Path.c_str());
|
ref.path = String::Duplicate(item.Path);
|
||||||
refs.push_back(ref);
|
refs.push_back(ref);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
*outRefs = nullptr;
|
*outRefs = Collections::ToArray(refs);
|
||||||
if (refs.size() != 0)
|
|
||||||
{
|
|
||||||
*outRefs = Memory::DuplicateArray(refs.data(), refs.size());
|
|
||||||
}
|
|
||||||
return refs.size();
|
return refs.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -143,7 +142,7 @@ public:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Delete(const utf8 * path) override
|
bool Delete(const std::string &path) override
|
||||||
{
|
{
|
||||||
bool result = false;
|
bool result = false;
|
||||||
size_t index = GetTrackIndex(path);
|
size_t index = GetTrackIndex(path);
|
||||||
|
@ -162,57 +161,41 @@ public:
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const utf8 * Rename(const utf8 * path, const utf8 * newName) override
|
std::string Rename(const std::string &path, const std::string &newName) override
|
||||||
{
|
{
|
||||||
const utf8 * result = nullptr;
|
std::string result;
|
||||||
size_t index = GetTrackIndex(path);
|
size_t index = GetTrackIndex(path);
|
||||||
if (index != SIZE_MAX)
|
if (index != SIZE_MAX)
|
||||||
{
|
{
|
||||||
TrackRepositoryItem * item = &_items[index];
|
TrackRepositoryItem * item = &_items[index];
|
||||||
if (!(item->Flags & TRIF_READ_ONLY))
|
if (!(item->Flags & TRIF_READ_ONLY))
|
||||||
{
|
{
|
||||||
utf8 newPath[MAX_PATH];
|
std::string directory = Path::GetDirectory(path);
|
||||||
Path::GetDirectory(newPath, sizeof(newPath), path);
|
std::string newPath = Path::Combine(directory, newName + Path::GetExtension(path));
|
||||||
Path::Append(newPath, sizeof(newPath), newName);
|
|
||||||
String::Append(newPath, sizeof(newPath), Path::GetExtension(path));
|
|
||||||
|
|
||||||
if (File::Move(path, newPath))
|
if (File::Move(path, newPath))
|
||||||
{
|
{
|
||||||
item->Name = std::string(newName);
|
item->Name = newName;
|
||||||
item->Path = std::string(newPath);
|
item->Path = newPath;
|
||||||
SortItems();
|
SortItems();
|
||||||
|
result = newPath;
|
||||||
item = GetTrackItem(newPath);
|
|
||||||
if (item != nullptr)
|
|
||||||
{
|
|
||||||
result = item->Path.c_str();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
const utf8 * Install(const utf8 * path) override
|
std::string Install(const std::string &path) override
|
||||||
{
|
{
|
||||||
const utf8 * result = nullptr;
|
std::string result;
|
||||||
const utf8 * fileName = Path::GetFileName(path);
|
std::string fileName = Path::GetFileName(path);
|
||||||
std::string installDir = _env->GetDirectoryPath(DIRBASE::USER, DIRID::TRACK);
|
std::string installDir = _env->GetDirectoryPath(DIRBASE::USER, DIRID::TRACK);
|
||||||
|
|
||||||
utf8 newPath[MAX_PATH];
|
std::string newPath = Path::Combine(installDir, fileName);
|
||||||
String::Set(newPath, sizeof(newPath), installDir.c_str());
|
|
||||||
Path::Append(newPath, sizeof(newPath), fileName);
|
|
||||||
|
|
||||||
if (File::Copy(path, newPath, false))
|
if (File::Copy(path, newPath, false))
|
||||||
{
|
{
|
||||||
AddTrack(path);
|
AddTrack(path);
|
||||||
SortItems();
|
SortItems();
|
||||||
|
result = path;
|
||||||
const TrackRepositoryItem * item = GetTrackItem(path);
|
|
||||||
if (item != nullptr)
|
|
||||||
{
|
|
||||||
result = item->Path.c_str();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
@ -220,18 +203,13 @@ public:
|
||||||
private:
|
private:
|
||||||
void Query(const std::string &directory)
|
void Query(const std::string &directory)
|
||||||
{
|
{
|
||||||
utf8 pattern[MAX_PATH];
|
std::string pattern = Path::Combine(directory, TD_FILE_PATTERN);
|
||||||
String::Set(pattern, sizeof(pattern), directory.c_str());
|
|
||||||
Path::Append(pattern, sizeof(pattern), "*.td4;*.td6");
|
|
||||||
Path::QueryDirectory(&_directoryQueryResult, pattern);
|
Path::QueryDirectory(&_directoryQueryResult, pattern);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Scan(const std::string &directory, uint32 flags = 0)
|
void Scan(const std::string &directory, uint32 flags = 0)
|
||||||
{
|
{
|
||||||
utf8 pattern[MAX_PATH];
|
std::string pattern = Path::Combine(directory, TD_FILE_PATTERN);
|
||||||
String::Set(pattern, sizeof(pattern), directory.c_str());
|
|
||||||
Path::Append(pattern, sizeof(pattern), "*.td4;*.td6");
|
|
||||||
|
|
||||||
IFileScanner * scanner = Path::ScanDirectory(pattern, true);
|
IFileScanner * scanner = Path::ScanDirectory(pattern, true);
|
||||||
while (scanner->Next())
|
while (scanner->Next())
|
||||||
{
|
{
|
||||||
|
@ -241,14 +219,14 @@ private:
|
||||||
delete scanner;
|
delete scanner;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddTrack(const utf8 * path, uint32 flags = 0)
|
void AddTrack(const std::string path, uint32 flags = 0)
|
||||||
{
|
{
|
||||||
rct_track_td6 * td6 = track_design_open(path);
|
rct_track_td6 * td6 = track_design_open(path.c_str());
|
||||||
if (td6 != nullptr)
|
if (td6 != nullptr)
|
||||||
{
|
{
|
||||||
TrackRepositoryItem item;
|
TrackRepositoryItem item;
|
||||||
item.Name = std::string(GetNameFromTrackPath(path));
|
item.Name = GetNameFromTrackPath(path);
|
||||||
item.Path = std::string(path);
|
item.Path = path;
|
||||||
item.RideType = td6->type;
|
item.RideType = td6->type;
|
||||||
item.ObjectEntry = std::string(td6->vehicle_object.name, 8);
|
item.ObjectEntry = std::string(td6->vehicle_object.name, 8);
|
||||||
item.Flags = flags;
|
item.Flags = flags;
|
||||||
|
@ -266,10 +244,7 @@ private:
|
||||||
{
|
{
|
||||||
return a.RideType < b.RideType;
|
return a.RideType < b.RideType;
|
||||||
}
|
}
|
||||||
|
return String::Compare(a.Name, b.Name) < 0;
|
||||||
const utf8 * nameA = a.Name.c_str();
|
|
||||||
const utf8 * nameB = b.Name.c_str();
|
|
||||||
return _stricmp(nameA, nameB) < 0;
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,11 +320,11 @@ private:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t GetTrackIndex(const utf8 * path) const
|
size_t GetTrackIndex(const std::string &path) const
|
||||||
{
|
{
|
||||||
for (size_t i = 0; i < _items.size(); i++)
|
for (size_t i = 0; i < _items.size(); i++)
|
||||||
{
|
{
|
||||||
if (Path::Equals(_items[i].Path.c_str(), path))
|
if (Path::Equals(_items[i].Path, path))
|
||||||
{
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
@ -357,7 +332,7 @@ private:
|
||||||
return SIZE_MAX;
|
return SIZE_MAX;
|
||||||
}
|
}
|
||||||
|
|
||||||
TrackRepositoryItem * GetTrackItem(const utf8 * path)
|
TrackRepositoryItem * GetTrackItem(const std::string &path)
|
||||||
{
|
{
|
||||||
TrackRepositoryItem * result = nullptr;
|
TrackRepositoryItem * result = nullptr;
|
||||||
size_t index = GetTrackIndex(path);
|
size_t index = GetTrackIndex(path);
|
||||||
|
@ -369,12 +344,9 @@ private:
|
||||||
}
|
}
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static utf8 * GetNameFromTrackPath(const utf8 * path)
|
static std::string GetNameFromTrackPath(const std::string &path)
|
||||||
{
|
{
|
||||||
utf8 * name = Memory::Allocate<utf8>(MAX_PATH);
|
return Path::GetFileNameWithoutExtension(path);
|
||||||
Path::GetFileNameWithoutExtension(name, MAX_PATH, path);
|
|
||||||
name = Memory::ReallocateArray(name, String::SizeOf(name) + 1);
|
|
||||||
return name;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -402,13 +374,13 @@ extern "C"
|
||||||
size_t track_repository_get_count_for_ride(uint8 rideType, const utf8 * entry)
|
size_t track_repository_get_count_for_ride(uint8 rideType, const utf8 * entry)
|
||||||
{
|
{
|
||||||
ITrackDesignRepository * repo = GetTrackDesignRepository();
|
ITrackDesignRepository * repo = GetTrackDesignRepository();
|
||||||
return repo->GetCountForObjectEntry(rideType, entry);
|
return repo->GetCountForObjectEntry(rideType, String::ToStd(entry));
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t track_repository_get_items_for_ride(track_design_file_ref * * outRefs, uint8 rideType, const utf8 * entry)
|
size_t track_repository_get_items_for_ride(track_design_file_ref * * outRefs, uint8 rideType, const utf8 * entry)
|
||||||
{
|
{
|
||||||
ITrackDesignRepository * repo = GetTrackDesignRepository();
|
ITrackDesignRepository * repo = GetTrackDesignRepository();
|
||||||
return repo->GetItemsForObjectEntry(outRefs, rideType, entry);
|
return repo->GetItemsForObjectEntry(outRefs, rideType, String::ToStd(entry));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool track_repository_delete(const utf8 * path)
|
bool track_repository_delete(const utf8 * path)
|
||||||
|
@ -417,20 +389,22 @@ extern "C"
|
||||||
return repo->Delete(path);
|
return repo->Delete(path);
|
||||||
}
|
}
|
||||||
|
|
||||||
const utf8 * track_repository_rename(const utf8 * path, const utf8 * newName)
|
bool track_repository_rename(const utf8 * path, const utf8 * newName)
|
||||||
{
|
{
|
||||||
ITrackDesignRepository * repo = GetTrackDesignRepository();
|
ITrackDesignRepository * repo = GetTrackDesignRepository();
|
||||||
return repo->Rename(path, newName);
|
std::string newPath = repo->Rename(path, newName);
|
||||||
|
return !newPath.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
const utf8 * track_repository_install(const utf8 * srcPath)
|
bool track_repository_install(const utf8 * srcPath)
|
||||||
{
|
{
|
||||||
ITrackDesignRepository * repo = GetTrackDesignRepository();
|
ITrackDesignRepository * repo = GetTrackDesignRepository();
|
||||||
return repo->Install(srcPath);
|
std::string newPath = repo->Install(srcPath);
|
||||||
|
return !newPath.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
utf8 * track_repository_get_name_from_path(const utf8 * path)
|
utf8 * track_repository_get_name_from_path(const utf8 * path)
|
||||||
{
|
{
|
||||||
return TrackDesignRepository::GetNameFromTrackPath(path);
|
return String::Duplicate(TrackDesignRepository::GetNameFromTrackPath(path));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,6 +26,8 @@ typedef struct track_design_file_ref
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
interface IPlatformEnvironment;
|
interface IPlatformEnvironment;
|
||||||
|
|
||||||
interface ITrackDesignRepository
|
interface ITrackDesignRepository
|
||||||
|
@ -33,15 +35,15 @@ interface ITrackDesignRepository
|
||||||
virtual ~ITrackDesignRepository() = default;
|
virtual ~ITrackDesignRepository() = default;
|
||||||
|
|
||||||
virtual size_t GetCount() const abstract;
|
virtual size_t GetCount() const abstract;
|
||||||
virtual size_t GetCountForObjectEntry(uint8 rideType, const utf8 * entry) const abstract;
|
virtual size_t GetCountForObjectEntry(uint8 rideType, const std::string &entry) const abstract;
|
||||||
virtual size_t GetItemsForObjectEntry(track_design_file_ref * * outRefs,
|
virtual size_t GetItemsForObjectEntry(track_design_file_ref * * outRefs,
|
||||||
uint8 rideType,
|
uint8 rideType,
|
||||||
const utf8 * entry) const abstract;
|
const std::string &entry) const abstract;
|
||||||
|
|
||||||
virtual void Scan() abstract;
|
virtual void Scan() abstract;
|
||||||
virtual bool Delete(const utf8 * path) abstract;
|
virtual bool Delete(const std::string &path) abstract;
|
||||||
virtual const utf8 * Rename(const utf8 * path, const utf8 * newName) abstract;
|
virtual std::string Rename(const std::string &path, const std::string &newName) abstract;
|
||||||
virtual const utf8 * Install(const utf8 * path) abstract;
|
virtual std::string Install(const std::string &path) abstract;
|
||||||
};
|
};
|
||||||
|
|
||||||
ITrackDesignRepository * CreateTrackDesignRepository(IPlatformEnvironment * env);
|
ITrackDesignRepository * CreateTrackDesignRepository(IPlatformEnvironment * env);
|
||||||
|
@ -53,13 +55,13 @@ ITrackDesignRepository * GetTrackDesignRepository();
|
||||||
extern "C"
|
extern "C"
|
||||||
{
|
{
|
||||||
#endif
|
#endif
|
||||||
void track_repository_scan();
|
void track_repository_scan();
|
||||||
size_t track_repository_get_count_for_ride(uint8 rideType, const utf8 * entry);
|
size_t track_repository_get_count_for_ride(uint8 rideType, const utf8 * entry);
|
||||||
size_t track_repository_get_items_for_ride(track_design_file_ref * * outRefs, uint8 rideType, const utf8 * entry);
|
size_t track_repository_get_items_for_ride(track_design_file_ref * * outRefs, uint8 rideType, const utf8 * entry);
|
||||||
utf8 * track_repository_get_name_from_path(const utf8 *path);
|
utf8 * track_repository_get_name_from_path(const utf8 *path);
|
||||||
bool track_repository_delete(const utf8 *path);
|
bool track_repository_delete(const utf8 *path);
|
||||||
const utf8 * track_repository_rename(const utf8 *path, const utf8 *newName);
|
bool track_repository_rename(const utf8 *path, const utf8 *newName);
|
||||||
const utf8 * track_repository_install(const utf8 *srcPath);
|
bool track_repository_install(const utf8 *srcPath);
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue