You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
771 B
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#pragma once
#include "stdafx.h"
#include <string>
#include <chrono>
#include <filesystem>
#include <optional>
#include "IActionStorage.h"
#include "StorageFactory.h"
/**
* CSigmaStore ¸ºÔðSigmaDoc µÄ´æ´¢ºÍ¼ÓÔØ
*/
class CSigmaStore
{
public:
~CSigmaStore();
static CSigmaStore& GetInstance()
{
static CSigmaStore store(StorageFactory::GetInstance().CreateDefaultStorage());
return store;
}
CSigmaStore(const CSigmaStore& other) = delete;
CSigmaStore(CSigmaStore&& other) noexcept = delete;
bool Exist(const CString& path);
bool Load(CSigmaDoc* pDoc, const CString& path);
bool Save(CSigmaDoc* pDoc);
void Clear(const CString& path);
private:
CSigmaStore(std::shared_ptr<IActionStorage> storage);
class Impl;
std::unique_ptr<Impl> m_impl;
};