2016-10-22 18:06:27 +02:00
|
|
|
/*****************************************************************************
|
2023-01-01 11:58:01 +01:00
|
|
|
* Copyright (c) 2014-2023 OpenRCT2 developers
|
2016-10-22 18:06:27 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* For a complete list of all authors, please refer to contributors.md
|
|
|
|
* Interested in contributing? Visit https://github.com/OpenRCT2/OpenRCT2
|
2016-10-22 18:06:27 +02:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2016-10-22 18:06:27 +02:00
|
|
|
*****************************************************************************/
|
|
|
|
|
2016-11-13 14:08:41 +01:00
|
|
|
#pragma once
|
|
|
|
|
2016-10-22 18:06:27 +02:00
|
|
|
#include "../common.h"
|
2022-01-25 16:41:45 +01:00
|
|
|
#include "../core/String.hpp"
|
2022-08-13 21:49:19 +02:00
|
|
|
#include "RideTypes.h"
|
2017-06-14 13:31:27 +02:00
|
|
|
|
2018-06-22 23:14:18 +02:00
|
|
|
#include <memory>
|
2022-07-26 18:12:46 +02:00
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
2016-10-22 18:06:27 +02:00
|
|
|
|
2022-07-26 18:12:46 +02:00
|
|
|
struct TrackDesignFileRef
|
2016-10-22 18:06:27 +02:00
|
|
|
{
|
2022-07-26 18:12:46 +02:00
|
|
|
u8string name;
|
|
|
|
u8string path;
|
2018-02-14 09:42:26 +01:00
|
|
|
};
|
2016-10-22 18:06:27 +02:00
|
|
|
|
2017-06-11 13:53:37 +02:00
|
|
|
namespace OpenRCT2
|
|
|
|
{
|
2020-07-30 23:19:53 +02:00
|
|
|
struct IPlatformEnvironment;
|
2017-06-11 13:53:37 +02:00
|
|
|
}
|
2016-12-12 02:30:27 +01:00
|
|
|
|
2020-07-30 23:19:53 +02:00
|
|
|
struct ITrackDesignRepository
|
2016-10-22 18:06:27 +02:00
|
|
|
{
|
|
|
|
virtual ~ITrackDesignRepository() = default;
|
|
|
|
|
2021-08-23 20:09:43 +02:00
|
|
|
[[nodiscard]] virtual size_t GetCount() const abstract;
|
2022-08-13 21:49:19 +02:00
|
|
|
[[nodiscard]] virtual size_t GetCountForObjectEntry(ride_type_t rideType, const std::string& entry) const abstract;
|
2022-07-26 18:12:46 +02:00
|
|
|
[[nodiscard]] virtual std::vector<TrackDesignFileRef> GetItemsForObjectEntry(
|
2022-08-13 21:49:19 +02:00
|
|
|
ride_type_t rideType, const std::string& entry) const abstract;
|
2016-10-22 18:06:27 +02:00
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
virtual void Scan(int32_t language) abstract;
|
2018-06-22 23:14:18 +02:00
|
|
|
virtual bool Delete(const std::string& path) abstract;
|
|
|
|
virtual std::string Rename(const std::string& path, const std::string& newName) abstract;
|
2020-10-06 13:27:38 +02:00
|
|
|
virtual std::string Install(const std::string& path, const std::string& name) abstract;
|
2016-10-22 18:06:27 +02:00
|
|
|
};
|
|
|
|
|
2021-08-23 20:09:43 +02:00
|
|
|
[[nodiscard]] std::unique_ptr<ITrackDesignRepository> CreateTrackDesignRepository(
|
|
|
|
const std::shared_ptr<OpenRCT2::IPlatformEnvironment>& env);
|
|
|
|
[[nodiscard]] std::string GetNameFromTrackPath(const std::string& path);
|
2016-10-22 18:06:27 +02:00
|
|
|
|
2023-01-17 01:32:54 +01:00
|
|
|
void TrackRepositoryScan();
|
|
|
|
bool TrackRepositoryDelete(const u8string& path);
|
|
|
|
bool TrackRepositoryRename(const u8string& path, const u8string& newName);
|
|
|
|
bool TrackRepositoryInstall(const u8string& srcPath, const u8string& name);
|