2016-10-22 17:06:27 +01:00
|
|
|
/*****************************************************************************
|
2020-07-21 15:04:34 +02:00
|
|
|
* Copyright (c) 2014-2020 OpenRCT2 developers
|
2016-10-22 17:06:27 +01: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 17:06:27 +01:00
|
|
|
*
|
2018-06-15 14:07:34 +02:00
|
|
|
* OpenRCT2 is licensed under the GNU General Public License version 3.
|
2016-10-22 17:06:27 +01:00
|
|
|
*****************************************************************************/
|
|
|
|
|
|
2018-06-22 23:14:18 +02:00
|
|
|
#include "TrackDesignRepository.h"
|
|
|
|
|
|
2018-04-10 14:19:23 +02:00
|
|
|
#include "../Context.h"
|
2018-06-22 23:14:18 +02:00
|
|
|
#include "../PlatformEnvironment.h"
|
2017-05-20 23:59:51 +02:00
|
|
|
#include "../config/Config.h"
|
2017-01-05 17:51:31 +00:00
|
|
|
#include "../core/Collections.hpp"
|
2016-10-22 17:06:27 +01:00
|
|
|
#include "../core/Console.hpp"
|
2017-01-05 12:55:41 +00:00
|
|
|
#include "../core/File.h"
|
2017-08-30 21:01:07 +01:00
|
|
|
#include "../core/FileIndex.hpp"
|
2020-11-07 13:42:04 +01:00
|
|
|
#include "../core/FileStream.h"
|
2016-10-22 17:06:27 +01:00
|
|
|
#include "../core/Path.hpp"
|
|
|
|
|
#include "../core/String.hpp"
|
2018-04-26 23:48:25 +01:00
|
|
|
#include "../localisation/LocalisationService.h"
|
2017-05-20 23:59:51 +02:00
|
|
|
#include "../object/ObjectRepository.h"
|
2020-06-20 02:32:52 +02:00
|
|
|
#include "../ride/RideData.h"
|
2020-08-03 20:42:54 -03:00
|
|
|
#include "../util/Util.h"
|
2017-09-18 17:05:28 +02:00
|
|
|
#include "TrackDesign.h"
|
2016-10-22 17:06:27 +01:00
|
|
|
|
2018-06-22 23:14:18 +02:00
|
|
|
#include <algorithm>
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <vector>
|
|
|
|
|
|
2017-06-11 12:53:37 +01:00
|
|
|
using namespace OpenRCT2;
|
|
|
|
|
|
2016-10-22 18:06:52 +01:00
|
|
|
struct TrackRepositoryItem
|
|
|
|
|
{
|
|
|
|
|
std::string Name;
|
|
|
|
|
std::string Path;
|
2020-02-22 19:06:57 +01:00
|
|
|
uint8_t RideType = RIDE_TYPE_NULL;
|
2016-10-22 18:06:52 +01:00
|
|
|
std::string ObjectEntry;
|
2018-06-20 17:28:51 +02:00
|
|
|
uint32_t Flags = 0;
|
2016-10-22 18:06:52 +01:00
|
|
|
};
|
2016-10-22 17:06:27 +01:00
|
|
|
|
2016-10-22 18:15:48 +01:00
|
|
|
enum TRACK_REPO_ITEM_FLAGS
|
|
|
|
|
{
|
|
|
|
|
TRIF_READ_ONLY = (1 << 0),
|
|
|
|
|
};
|
|
|
|
|
|
2018-06-22 23:14:18 +02:00
|
|
|
std::string GetNameFromTrackPath(const std::string& path)
|
2017-08-30 21:01:07 +01:00
|
|
|
{
|
|
|
|
|
std::string name = Path::GetFileNameWithoutExtension(path);
|
2018-06-22 23:14:18 +02:00
|
|
|
// The track name should be the file name until the first instance of a dot
|
2017-12-03 23:45:43 +01:00
|
|
|
name = name.substr(0, name.find_first_of('.'));
|
2017-08-30 21:01:07 +01:00
|
|
|
return name;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class TrackDesignFileIndex final : public FileIndex<TrackRepositoryItem>
|
|
|
|
|
{
|
|
|
|
|
private:
|
2018-06-20 17:28:51 +02:00
|
|
|
static constexpr uint32_t MAGIC_NUMBER = 0x58444954; // TIDX
|
2020-12-06 18:13:03 +00:00
|
|
|
static constexpr uint16_t VERSION = 4;
|
2017-08-30 21:01:07 +01:00
|
|
|
static constexpr auto PATTERN = "*.td4;*.td6";
|
|
|
|
|
|
|
|
|
|
public:
|
2018-06-22 23:14:18 +02:00
|
|
|
explicit TrackDesignFileIndex(const IPlatformEnvironment& env)
|
|
|
|
|
: FileIndex(
|
2019-11-04 14:02:30 +01:00
|
|
|
"track design index", MAGIC_NUMBER, VERSION, env.GetFilePath(PATHID::CACHE_TRACKS), std::string(PATTERN),
|
|
|
|
|
std::vector<std::string>({
|
|
|
|
|
env.GetDirectoryPath(DIRBASE::RCT1, DIRID::TRACK),
|
|
|
|
|
env.GetDirectoryPath(DIRBASE::RCT2, DIRID::TRACK),
|
|
|
|
|
env.GetDirectoryPath(DIRBASE::USER, DIRID::TRACK),
|
|
|
|
|
}))
|
2017-08-30 21:01:07 +01:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public:
|
2018-06-22 23:14:18 +02:00
|
|
|
std::tuple<bool, TrackRepositoryItem> Create(int32_t, const std::string& path) const override
|
2017-08-30 21:01:07 +01:00
|
|
|
{
|
|
|
|
|
auto td6 = track_design_open(path.c_str());
|
|
|
|
|
if (td6 != nullptr)
|
|
|
|
|
{
|
|
|
|
|
TrackRepositoryItem item;
|
|
|
|
|
item.Name = GetNameFromTrackPath(path);
|
|
|
|
|
item.Path = path;
|
2020-09-21 22:42:25 +02:00
|
|
|
item.RideType = td6->type;
|
2021-09-12 21:25:22 +02:00
|
|
|
item.ObjectEntry = std::string(td6->vehicle_object.Entry.name, 8);
|
2017-08-30 21:01:07 +01:00
|
|
|
item.Flags = 0;
|
|
|
|
|
if (IsTrackReadOnly(path))
|
|
|
|
|
{
|
|
|
|
|
item.Flags |= TRIF_READ_ONLY;
|
|
|
|
|
}
|
|
|
|
|
return std::make_tuple(true, item);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return std::make_tuple(true, TrackRepositoryItem());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected:
|
2020-12-06 18:13:03 +00:00
|
|
|
void Serialise(DataSerialiser& ds, TrackRepositoryItem& item) const override
|
2017-08-30 21:01:07 +01:00
|
|
|
{
|
2020-12-06 18:13:03 +00:00
|
|
|
ds << item.Name;
|
|
|
|
|
ds << item.Path;
|
|
|
|
|
ds << item.RideType;
|
|
|
|
|
ds << item.ObjectEntry;
|
|
|
|
|
ds << item.Flags;
|
2017-08-30 21:01:07 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
2018-06-22 23:14:18 +02:00
|
|
|
bool IsTrackReadOnly(const std::string& path) const
|
2017-08-30 21:01:07 +01:00
|
|
|
{
|
2018-06-22 23:14:18 +02:00
|
|
|
return String::StartsWith(path, SearchPaths[0]) || String::StartsWith(path, SearchPaths[1]);
|
2017-08-30 21:01:07 +01:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2017-01-13 12:12:50 +01:00
|
|
|
class TrackDesignRepository final : public ITrackDesignRepository
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
|
|
|
|
private:
|
2018-04-20 19:58:59 +01:00
|
|
|
std::shared_ptr<IPlatformEnvironment> const _env;
|
2017-08-30 21:01:07 +01:00
|
|
|
TrackDesignFileIndex const _fileIndex;
|
2016-10-22 18:06:52 +01:00
|
|
|
std::vector<TrackRepositoryItem> _items;
|
2016-10-22 17:06:27 +01:00
|
|
|
|
|
|
|
|
public:
|
2018-04-27 18:47:57 +01:00
|
|
|
explicit TrackDesignRepository(const std::shared_ptr<IPlatformEnvironment>& env)
|
2018-06-22 23:14:18 +02:00
|
|
|
: _env(env)
|
|
|
|
|
, _fileIndex(*env)
|
2016-12-12 01:30:27 +00:00
|
|
|
{
|
|
|
|
|
Guard::ArgumentNotNull(env);
|
|
|
|
|
}
|
|
|
|
|
|
2016-10-22 17:06:27 +01:00
|
|
|
size_t GetCount() const override
|
|
|
|
|
{
|
|
|
|
|
return _items.size();
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-20 23:59:51 +02:00
|
|
|
/**
|
|
|
|
|
*
|
2018-06-22 23:14:18 +02:00
|
|
|
* @param entry The entry name to count the track list of. Leave empty to count track list for the non-separated types (e.g.
|
|
|
|
|
* Hyper-Twister, Car Ride)
|
2017-05-20 23:59:51 +02:00
|
|
|
*/
|
2018-06-22 23:14:18 +02:00
|
|
|
size_t GetCountForObjectEntry(uint8_t rideType, const std::string& entry) const override
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
|
|
|
|
size_t count = 0;
|
2018-08-29 00:52:10 +02:00
|
|
|
const auto& repo = GetContext()->GetObjectRepository();
|
2017-05-20 23:59:51 +02:00
|
|
|
|
2018-06-22 23:14:18 +02:00
|
|
|
for (const auto& item : _items)
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
2017-05-20 23:59:51 +02:00
|
|
|
if (item.RideType != rideType)
|
2017-06-14 13:31:27 +02:00
|
|
|
{
|
2017-05-20 23:59:51 +02:00
|
|
|
continue;
|
2017-06-14 13:31:27 +02:00
|
|
|
}
|
2017-05-20 23:59:51 +02:00
|
|
|
|
|
|
|
|
bool entryIsNotSeparate = false;
|
|
|
|
|
if (entry.empty())
|
|
|
|
|
{
|
2020-11-05 21:19:43 +01:00
|
|
|
const ObjectRepositoryItem* ori = repo.FindObjectLegacy(item.ObjectEntry.c_str());
|
2017-05-20 23:59:51 +02:00
|
|
|
|
2021-02-26 10:01:00 +01:00
|
|
|
if (ori == nullptr || !GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
2017-05-20 23:59:51 +02:00
|
|
|
entryIsNotSeparate = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (entryIsNotSeparate || String::Equals(item.ObjectEntry, entry, true))
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
|
|
|
|
count++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return count;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-20 23:59:51 +02:00
|
|
|
/**
|
|
|
|
|
*
|
2018-06-22 23:14:18 +02:00
|
|
|
* @param entry The entry name to build a track list for. Leave empty to build track list for the non-separated types (e.g.
|
|
|
|
|
* Hyper-Twister, Car Ride)
|
2017-05-20 23:59:51 +02:00
|
|
|
*/
|
2018-06-22 23:14:18 +02:00
|
|
|
std::vector<track_design_file_ref> GetItemsForObjectEntry(uint8_t rideType, const std::string& entry) const override
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
|
|
|
|
std::vector<track_design_file_ref> refs;
|
2018-08-29 00:52:10 +02:00
|
|
|
const auto& repo = GetContext()->GetObjectRepository();
|
2017-05-20 23:59:51 +02:00
|
|
|
|
2018-06-22 23:14:18 +02:00
|
|
|
for (const auto& item : _items)
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
2017-05-20 23:59:51 +02:00
|
|
|
if (item.RideType != rideType)
|
2017-06-14 13:31:27 +02:00
|
|
|
{
|
2017-05-20 23:59:51 +02:00
|
|
|
continue;
|
2017-06-14 13:31:27 +02:00
|
|
|
}
|
2017-05-20 23:59:51 +02:00
|
|
|
|
|
|
|
|
bool entryIsNotSeparate = false;
|
|
|
|
|
if (entry.empty())
|
|
|
|
|
{
|
2020-11-05 21:19:43 +01:00
|
|
|
const ObjectRepositoryItem* ori = repo.FindObjectLegacy(item.ObjectEntry.c_str());
|
2017-05-20 23:59:51 +02:00
|
|
|
|
2021-02-26 10:01:00 +01:00
|
|
|
if (ori == nullptr || !GetRideTypeDescriptor(rideType).HasFlag(RIDE_TYPE_FLAG_LIST_VEHICLES_SEPARATELY))
|
2017-05-20 23:59:51 +02:00
|
|
|
entryIsNotSeparate = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (entryIsNotSeparate || String::Equals(item.ObjectEntry, entry, true))
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
|
|
|
|
track_design_file_ref ref;
|
2017-01-05 13:13:22 +00:00
|
|
|
ref.name = String::Duplicate(GetNameFromTrackPath(item.Path));
|
|
|
|
|
ref.path = String::Duplicate(item.Path);
|
2016-10-22 17:06:27 +01:00
|
|
|
refs.push_back(ref);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2018-01-19 00:32:53 +00:00
|
|
|
return refs;
|
2016-10-22 17:06:27 +01:00
|
|
|
}
|
|
|
|
|
|
2018-06-20 17:28:51 +02:00
|
|
|
void Scan(int32_t language) override
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
2016-10-23 01:12:17 +01:00
|
|
|
_items.clear();
|
2018-04-26 23:48:25 +01:00
|
|
|
auto trackDesigns = _fileIndex.LoadOrBuild(language);
|
2018-06-22 23:14:18 +02:00
|
|
|
for (const auto& td : trackDesigns)
|
2016-10-23 01:12:17 +01:00
|
|
|
{
|
2017-08-30 21:01:07 +01:00
|
|
|
_items.push_back(td);
|
2016-10-23 01:12:17 +01:00
|
|
|
}
|
2017-08-30 21:01:07 +01:00
|
|
|
|
|
|
|
|
SortItems();
|
2016-10-22 17:06:27 +01:00
|
|
|
}
|
|
|
|
|
|
2018-06-22 23:14:18 +02:00
|
|
|
bool Delete(const std::string& path) override
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
|
|
|
|
bool result = false;
|
2016-10-22 18:15:48 +01:00
|
|
|
size_t index = GetTrackIndex(path);
|
|
|
|
|
if (index != SIZE_MAX)
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
2018-06-22 23:14:18 +02:00
|
|
|
const TrackRepositoryItem* item = &_items[index];
|
2016-10-22 18:15:48 +01:00
|
|
|
if (!(item->Flags & TRIF_READ_ONLY))
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
2017-01-05 18:13:48 +00:00
|
|
|
if (File::Delete(path))
|
2016-10-22 18:15:48 +01:00
|
|
|
{
|
|
|
|
|
_items.erase(_items.begin() + index);
|
2016-10-23 00:42:22 +01:00
|
|
|
result = true;
|
2016-10-22 18:15:48 +01:00
|
|
|
}
|
2016-10-22 17:06:27 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-22 23:14:18 +02:00
|
|
|
std::string Rename(const std::string& path, const std::string& newName) override
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
2017-01-05 17:51:31 +00:00
|
|
|
std::string result;
|
2016-10-22 17:06:27 +01:00
|
|
|
size_t index = GetTrackIndex(path);
|
|
|
|
|
if (index != SIZE_MAX)
|
|
|
|
|
{
|
2018-06-22 23:14:18 +02:00
|
|
|
TrackRepositoryItem* item = &_items[index];
|
2016-10-22 22:35:12 +01:00
|
|
|
if (!(item->Flags & TRIF_READ_ONLY))
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
2017-01-05 17:51:31 +00:00
|
|
|
std::string directory = Path::GetDirectory(path);
|
|
|
|
|
std::string newPath = Path::Combine(directory, newName + Path::GetExtension(path));
|
2017-01-05 18:13:48 +00:00
|
|
|
if (File::Move(path, newPath))
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
2017-01-05 17:51:31 +00:00
|
|
|
item->Name = newName;
|
|
|
|
|
item->Path = newPath;
|
2016-10-22 18:15:48 +01:00
|
|
|
SortItems();
|
2017-01-05 17:51:31 +00:00
|
|
|
result = newPath;
|
2016-10-22 17:06:27 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-06 08:27:38 -03:00
|
|
|
std::string Install(const std::string& path, const std::string& name) override
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
2017-01-05 17:51:31 +00:00
|
|
|
std::string result;
|
2016-12-12 01:30:27 +00:00
|
|
|
std::string installDir = _env->GetDirectoryPath(DIRBASE::USER, DIRID::TRACK);
|
2016-10-22 17:06:27 +01:00
|
|
|
|
2020-10-06 08:27:38 -03:00
|
|
|
std::string newPath = Path::Combine(installDir, name + Path::GetExtension(path));
|
2017-01-05 18:13:48 +00:00
|
|
|
if (File::Copy(path, newPath, false))
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
2018-04-27 18:23:39 +01:00
|
|
|
auto language = LocalisationService_GetCurrentLanguage();
|
2020-10-06 08:27:38 -03:00
|
|
|
auto td = _fileIndex.Create(language, newPath);
|
2017-08-30 21:01:07 +01:00
|
|
|
if (std::get<0>(td))
|
|
|
|
|
{
|
2021-01-09 05:59:55 +09:00
|
|
|
_items.push_back(std::move(std::get<1>(td)));
|
2017-08-30 21:01:07 +01:00
|
|
|
SortItems();
|
|
|
|
|
result = path;
|
|
|
|
|
}
|
2016-10-22 17:06:27 +01:00
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
void SortItems()
|
|
|
|
|
{
|
2018-06-22 23:14:18 +02:00
|
|
|
std::sort(_items.begin(), _items.end(), [](const TrackRepositoryItem& a, const TrackRepositoryItem& b) -> bool {
|
|
|
|
|
if (a.RideType != b.RideType)
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
2018-06-22 23:14:18 +02:00
|
|
|
return a.RideType < b.RideType;
|
|
|
|
|
}
|
2020-08-03 20:42:54 -03:00
|
|
|
return strlogicalcmp(a.Name.c_str(), b.Name.c_str()) < 0;
|
2018-06-22 23:14:18 +02:00
|
|
|
});
|
2016-10-22 17:06:27 +01:00
|
|
|
}
|
|
|
|
|
|
2018-06-22 23:14:18 +02:00
|
|
|
size_t GetTrackIndex(const std::string& path) const
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
|
|
|
|
for (size_t i = 0; i < _items.size(); i++)
|
|
|
|
|
{
|
2017-01-05 17:51:31 +00:00
|
|
|
if (Path::Equals(_items[i].Path, path))
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return SIZE_MAX;
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-22 23:14:18 +02:00
|
|
|
TrackRepositoryItem* GetTrackItem(const std::string& path)
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
2018-06-22 23:14:18 +02:00
|
|
|
TrackRepositoryItem* result = nullptr;
|
2016-10-22 17:06:27 +01:00
|
|
|
size_t index = GetTrackIndex(path);
|
|
|
|
|
if (index != SIZE_MAX)
|
|
|
|
|
{
|
|
|
|
|
result = &_items[index];
|
|
|
|
|
}
|
|
|
|
|
return result;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2018-04-20 22:16:37 +01:00
|
|
|
std::unique_ptr<ITrackDesignRepository> CreateTrackDesignRepository(const std::shared_ptr<IPlatformEnvironment>& env)
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
2018-04-20 22:16:37 +01:00
|
|
|
return std::make_unique<TrackDesignRepository>(env);
|
2016-10-22 17:06:27 +01:00
|
|
|
}
|
|
|
|
|
|
2018-02-01 18:49:14 +01:00
|
|
|
void track_repository_scan()
|
2016-10-22 17:06:27 +01:00
|
|
|
{
|
2018-06-22 23:14:18 +02:00
|
|
|
ITrackDesignRepository* repo = GetContext()->GetTrackDesignRepository();
|
2018-04-26 23:48:25 +01:00
|
|
|
repo->Scan(LocalisationService_GetCurrentLanguage());
|
2016-10-22 17:06:27 +01:00
|
|
|
}
|
2018-02-01 18:49:14 +01:00
|
|
|
|
2018-06-22 23:14:18 +02:00
|
|
|
bool track_repository_delete(const utf8* path)
|
2018-02-01 18:49:14 +01:00
|
|
|
{
|
2018-06-22 23:14:18 +02:00
|
|
|
ITrackDesignRepository* repo = GetContext()->GetTrackDesignRepository();
|
2018-02-01 18:49:14 +01:00
|
|
|
return repo->Delete(path);
|
|
|
|
|
}
|
|
|
|
|
|
2018-06-22 23:14:18 +02:00
|
|
|
bool track_repository_rename(const utf8* path, const utf8* newName)
|
2018-02-01 18:49:14 +01:00
|
|
|
{
|
2018-06-22 23:14:18 +02:00
|
|
|
ITrackDesignRepository* repo = GetContext()->GetTrackDesignRepository();
|
2018-02-01 18:49:14 +01:00
|
|
|
std::string newPath = repo->Rename(path, newName);
|
|
|
|
|
return !newPath.empty();
|
|
|
|
|
}
|
|
|
|
|
|
2020-10-06 08:27:38 -03:00
|
|
|
bool track_repository_install(const utf8* srcPath, const utf8* name)
|
2018-02-01 18:49:14 +01:00
|
|
|
{
|
2018-06-22 23:14:18 +02:00
|
|
|
ITrackDesignRepository* repo = GetContext()->GetTrackDesignRepository();
|
2020-10-06 08:27:38 -03:00
|
|
|
std::string newPath = repo->Install(srcPath, name);
|
2018-02-01 18:49:14 +01:00
|
|
|
return !newPath.empty();
|
|
|
|
|
}
|