From 182c8f8357739f905bbd721006480502435b6b43 Mon Sep 17 00:00:00 2001 From: rtk0c Date: Sun, 27 Nov 2022 12:04:31 -0800 Subject: Update brace style to match rest of my projects --- app/source/Cplt/Model/Assets.hpp | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) (limited to 'app/source/Cplt/Model/Assets.hpp') 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 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 AssetListTyped : public AssetList -{ +class AssetListTyped : public AssetList { public: using AssetList::AssetList; #pragma clang diagnostic push #pragma ide diagnostic ignored "HidingNonVirtualFunction" - std::unique_ptr CreateAndLoad(SavedAsset asset) - { + std::unique_ptr CreateAndLoad(SavedAsset asset) { return std::unique_ptr(static_cast(AssetList::CreateAndLoad(asset).release())); } - std::unique_ptr Load(std::string_view name) const - { + std::unique_ptr Load(std::string_view name) const { return std::unique_ptr(static_cast(AssetList::Load(name).release())); } - std::unique_ptr Load(const SavedAsset& asset) const - { + std::unique_ptr Load(const SavedAsset& asset) const { return std::unique_ptr(static_cast(AssetList::Load(asset).release())); } #pragma clang diagnostic pop -- cgit v1.2.3-70-g09d2