From d5c08bf10fdb377c6349b8df211f365fb77181c5 Mon Sep 17 00:00:00 2001 From: Dexrn ZacAttack Date: Fri, 23 Jan 2026 21:02:36 -0800 Subject: [PATCH] refactor: move Storage to Common --- projects/WinDurango.Common/CMakeLists.txt | 3 ++- .../Interfaces/Storage/Directory.h} | 13 +++++++++---- projects/WinDurango.WinRT/CMakeLists.txt | 4 ++-- .../include/WinDurango.WinRT/stub.h | 9 +++++++++ 4 files changed, 22 insertions(+), 7 deletions(-) rename projects/{WinDurango.WinRT/include/WinDurango.WinRT/Storage/AbstractStorage.h => WinDurango.Common/include/WinDurango.Common/Interfaces/Storage/Directory.h} (65%) create mode 100644 projects/WinDurango.WinRT/include/WinDurango.WinRT/stub.h diff --git a/projects/WinDurango.Common/CMakeLists.txt b/projects/WinDurango.Common/CMakeLists.txt index bd90b47..0d5127d 100644 --- a/projects/WinDurango.Common/CMakeLists.txt +++ b/projects/WinDurango.Common/CMakeLists.txt @@ -1,7 +1,7 @@ cmake_minimum_required(VERSION 4.0) project(WinDurango.Common VERSION 1.0.0) -set(VERSION_SUFFIX "-dev.4") # used for non-stable versions, otherwise blank +set(VERSION_SUFFIX "-dev.5") # used for non-stable versions, otherwise blank set(CMAKE_CXX_STANDARD 17) @@ -9,6 +9,7 @@ set(FILES include/WinDurango.Common/WinDurango.h src/WinDurango.cpp include/WinDurango.Common/Config.h + include/WinDurango.Common/Interfaces/Storage/Directory.h ) add_library(WinDurango.Common SHARED ${FILES}) diff --git a/projects/WinDurango.WinRT/include/WinDurango.WinRT/Storage/AbstractStorage.h b/projects/WinDurango.Common/include/WinDurango.Common/Interfaces/Storage/Directory.h similarity index 65% rename from projects/WinDurango.WinRT/include/WinDurango.WinRT/Storage/AbstractStorage.h rename to projects/WinDurango.Common/include/WinDurango.Common/Interfaces/Storage/Directory.h index fecb08c..9c80ec1 100644 --- a/projects/WinDurango.WinRT/include/WinDurango.WinRT/Storage/AbstractStorage.h +++ b/projects/WinDurango.Common/include/WinDurango.Common/Interfaces/Storage/Directory.h @@ -4,14 +4,19 @@ #ifndef WINDURANGO_ABSTRACTSTORAGE_H #define WINDURANGO_ABSTRACTSTORAGE_H -namespace wd::winrt { +namespace wd::common::interfaces::storage { + // TODO should we have separate project for interfaces? + /** Interface for storage management, to be impl'd for uwp and crossplat */ - class AbstractStorage { + class Directory { public: - // todo can't make these static, what to do? + Directory(std::filesystem::path root); // todo impl + virtual void CreateFile(std::filesystem::path path) = 0; // todo maybe return stream type, todo can we use this in uwp context??? I forgor virtual void CreateDirectory(std::filesystem::path path) = 0; + + std::filesystem::path _root; }; -} // wd::winrt +} // wd::common::interfaces::storage #endif // WINDURANGO_ABSTRACTSTORAGE_H \ No newline at end of file diff --git a/projects/WinDurango.WinRT/CMakeLists.txt b/projects/WinDurango.WinRT/CMakeLists.txt index 1bf0b55..c20f3f1 100644 --- a/projects/WinDurango.WinRT/CMakeLists.txt +++ b/projects/WinDurango.WinRT/CMakeLists.txt @@ -1,12 +1,12 @@ cmake_minimum_required(VERSION 4.0) project(WinDurango.WinRT VERSION 1.0.0) -set(VERSION_SUFFIX "-dev.0") # used for non-stable versions, otherwise blank +set(VERSION_SUFFIX "-dev.1") # used for non-stable versions, otherwise blank set(CMAKE_CXX_STANDARD 17) set(FILES - "include/WinDurango.WinRT/Storage/AbstractStorage.h" + "include/WinDurango.WinRT/stub.h" ) set(WINRT_USE_CROSS_PLATFORM OFF) diff --git a/projects/WinDurango.WinRT/include/WinDurango.WinRT/stub.h b/projects/WinDurango.WinRT/include/WinDurango.WinRT/stub.h new file mode 100644 index 0000000..fef65fd --- /dev/null +++ b/projects/WinDurango.WinRT/include/WinDurango.WinRT/stub.h @@ -0,0 +1,9 @@ +// +// Created by DexrnZacAttack on 1/23/26 using zPc-i2. +// +#ifndef WINDURANGO_STUB_H +#define WINDURANGO_STUB_H + +// cant reload cmake without this + +#endif // WINDURANGO_STUB_H \ No newline at end of file