From 4b86554a0354d78efeb40e551eaccaac0fecd1d1 Mon Sep 17 00:00:00 2001 From: crupest Date: Tue, 25 Sep 2018 13:08:40 +0800 Subject: Change the structure of project. --- CruUI/base.h | 107 ----------------------------------------------------------- 1 file changed, 107 deletions(-) delete mode 100644 CruUI/base.h (limited to 'CruUI/base.h') diff --git a/CruUI/base.h b/CruUI/base.h deleted file mode 100644 index 7ef78014..00000000 --- a/CruUI/base.h +++ /dev/null @@ -1,107 +0,0 @@ -#pragma once - -// ReSharper disable once CppUnusedIncludeDirective -#include "global_macros.h" - - -#ifdef CRU_DEBUG -#include -#include -#else -#include -#include -#endif - -#include - -#include -#include -#include -#include -#include -#include - -namespace cru -{ - template struct is_shared_ptr : std::false_type {}; - template struct is_shared_ptr> : std::true_type {}; - template constexpr bool is_shared_ptr_v = is_shared_ptr::value; - - enum class FlowControl - { - Continue, - Break - }; - -#ifdef CRU_DEBUG - using String = std::wstring; - using MultiByteString = std::string; -#else - using String = folly::basic_fbstring; - using MultiByteString = folly::fbstring; -#endif - - using StringView = std::wstring_view; - using MultiByteStringView = std::string_view; - - template - using Function = folly::Function; - - template - using FunctionPtr = std::shared_ptr>; - - using Action = Function; - using ActionPtr = FunctionPtr; - - template - Type CreatePtr(Args&&... args) - { - static_assert(is_shared_ptr_v); - return std::make_shared(std::forward(args)...); - } - - inline ActionPtr CreateActionPtr(Action&& action) - { - return std::make_shared(std::move(action)); - } - -#ifdef CRU_DEBUG - template - using Vector = std::vector; -#else - template - using Vector = folly::fbvector; -#endif - - using FloatSecond = std::chrono::duration; - - class Object - { - public: - Object() = default; - Object(const Object&) = default; - Object& operator = (const Object&) = default; - Object(Object&&) = default; - Object& operator = (Object&&) = default; - virtual ~Object() = default; - }; - - struct Interface - { - virtual ~Interface() = default; - }; - - [[noreturn]] inline void UnreachableCode() - { - throw std::logic_error("Unreachable code."); - } - - struct ICancelable : virtual Interface - { - virtual void Cancel() = 0; - }; - - using CancelablePtr = std::shared_ptr; - - MultiByteString ToUtf8String(const StringView& string); -} -- cgit v1.2.3