aboutsummaryrefslogtreecommitdiff
path: root/app/source/Cplt/Model/Assets.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-11-27 12:04:31 -0800
committerrtk0c <[email protected]>2022-11-27 12:04:31 -0800
commit182c8f8357739f905bbd721006480502435b6b43 (patch)
tree082613a474d863182e2ad8f2167f1643f26e67a3 /app/source/Cplt/Model/Assets.hpp
parentb01ed99a1cd0c863c8709930658513c04dd70f61 (diff)
Update brace style to match rest of my projectscplt-imgui
Diffstat (limited to 'app/source/Cplt/Model/Assets.hpp')
-rw-r--r--app/source/Cplt/Model/Assets.hpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/app/source/Cplt/Model/Assets.hpp b/app/source/Cplt/Model/Assets.hpp
index d2f8570..309d967 100644
--- a/app/source/Cplt/Model/Assets.hpp
+++ b/app/source/Cplt/Model/Assets.hpp
@@ -12,8 +12,7 @@
/// A structure representing a ready-to-be-loaded asset, locating on the disk.
/// Each asset should be identified by a unique uuid within the asset category (i.e. a workflow and a template can share the same uuid),
/// generated on insertion to an asset list if not given by the caller.
-struct SavedAsset
-{
+struct SavedAsset {
std::string Name;
/// UUID of this asset. This field is generated as a random UUID v4 upon insertion into an AssetList, if not already provided by the caller (indicated by !is_nil()).
uuids::uuid Uuid;
@@ -24,22 +23,19 @@ struct SavedAsset
void WriteToDataStream(OutputDataStream& stream) const;
};
-class Asset
-{
+class Asset {
public:
Asset();
virtual ~Asset() = default;
};
-enum class NameSelectionError
-{
+enum class NameSelectionError {
None,
Duplicated,
Empty,
};
-class AssetList
-{
+class AssetList {
private:
class Private;
std::unique_ptr<Private> mPrivate;
@@ -71,8 +67,7 @@ public:
int GetCacheSizeLimit() const;
void SetCacheSizeLimit(int limit);
- struct ListState
- {
+ struct ListState {
const SavedAsset* SelectedAsset = nullptr;
};
void DisplayIconsList(ListState& state);
@@ -105,25 +100,21 @@ protected:
};
template <class T>
-class AssetListTyped : public AssetList
-{
+class AssetListTyped : public AssetList {
public:
using AssetList::AssetList;
#pragma clang diagnostic push
#pragma ide diagnostic ignored "HidingNonVirtualFunction"
- std::unique_ptr<T> CreateAndLoad(SavedAsset asset)
- {
+ std::unique_ptr<T> CreateAndLoad(SavedAsset asset) {
return std::unique_ptr<T>(static_cast<T*>(AssetList::CreateAndLoad(asset).release()));
}
- std::unique_ptr<T> Load(std::string_view name) const
- {
+ std::unique_ptr<T> Load(std::string_view name) const {
return std::unique_ptr<T>(static_cast<T*>(AssetList::Load(name).release()));
}
- std::unique_ptr<T> Load(const SavedAsset& asset) const
- {
+ std::unique_ptr<T> Load(const SavedAsset& asset) const {
return std::unique_ptr<T>(static_cast<T*>(AssetList::Load(asset).release()));
}
#pragma clang diagnostic pop