refactor: move Storage to Common

This commit is contained in:
Dexrn ZacAttack
2026-01-23 21:02:36 -08:00
parent 9b9fab98c4
commit d5c08bf10f
4 changed files with 22 additions and 7 deletions

View File

@@ -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})

View File

@@ -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

View File

@@ -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)

View File

@@ -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