2023-08-27 12:30:12 +08:00
|
|
|
#pragma once
|
2024-08-17 20:43:27 +08:00
|
|
|
#include <VTAll.hpp>
|
|
|
|
|
2023-08-27 12:30:12 +08:00
|
|
|
#include "AccessibleValue.hpp"
|
|
|
|
#include "TerminalHelper.hpp"
|
|
|
|
#include "StructFormatter.hpp"
|
|
|
|
#include "CmdHelper.hpp"
|
|
|
|
|
|
|
|
#include <cstdio>
|
|
|
|
#include <iostream>
|
|
|
|
|
|
|
|
namespace Unvirt::Context {
|
|
|
|
|
|
|
|
class UnvirtContext {
|
|
|
|
public:
|
|
|
|
UnvirtContext();
|
|
|
|
~UnvirtContext();
|
2024-08-17 20:43:27 +08:00
|
|
|
YYCC_DEL_CLS_COPY_MOVE(UnvirtContext);
|
2023-08-27 12:30:12 +08:00
|
|
|
|
|
|
|
void Run();
|
|
|
|
|
|
|
|
protected:
|
2023-10-28 18:17:53 +08:00
|
|
|
enum class SearchPart {
|
|
|
|
None, Object, Manager
|
2023-08-27 12:30:12 +08:00
|
|
|
};
|
2023-10-28 18:17:53 +08:00
|
|
|
void PrintCommonInfo(const char* u8_fmt, ...);
|
2023-08-27 12:30:12 +08:00
|
|
|
void PrintCommonError(const char* u8_fmt, ...);
|
|
|
|
|
2023-08-27 14:21:44 +08:00
|
|
|
void ProcLoad(const CmdHelper::ArgumentsMap* amap);
|
|
|
|
void ProcUnLoad(const CmdHelper::ArgumentsMap* amap);
|
2023-08-28 22:20:46 +08:00
|
|
|
void ProcSave(const CmdHelper::ArgumentsMap* amap);
|
2023-08-27 14:21:44 +08:00
|
|
|
void ProcInfo(const CmdHelper::ArgumentsMap* amap);
|
|
|
|
void ProcLs(const CmdHelper::ArgumentsMap* amap);
|
|
|
|
void ProcData(const CmdHelper::ArgumentsMap* amap);
|
|
|
|
void ProcChunk(const CmdHelper::ArgumentsMap* amap);
|
2023-10-28 18:17:53 +08:00
|
|
|
void ProcSearch(const CmdHelper::ArgumentsMap* amap);
|
2023-08-27 14:21:44 +08:00
|
|
|
void ProcItems(const CmdHelper::ArgumentsMap* amap);
|
2023-10-28 18:17:53 +08:00
|
|
|
void ProcStyle(const CmdHelper::ArgumentsMap* amap);
|
2023-08-27 14:21:44 +08:00
|
|
|
void ProcEncoding(const CmdHelper::ArgumentsMap* amap);
|
|
|
|
void ProcTemp(const CmdHelper::ArgumentsMap* amap);
|
2023-09-12 17:03:06 +08:00
|
|
|
void ProcRsc(const CmdHelper::ArgumentsMap* amap, bool isClear);
|
2023-09-20 20:44:03 +08:00
|
|
|
void ProcTest(const CmdHelper::ArgumentsMap* amap);
|
2023-08-27 22:14:02 +08:00
|
|
|
void ProcHelp(const CmdHelper::ArgumentsMap* amap);
|
2023-08-27 14:21:44 +08:00
|
|
|
void ProcExit(const CmdHelper::ArgumentsMap* amap);
|
2023-08-27 12:30:12 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
bool HasOpenedFile();
|
|
|
|
void ClearDocument();
|
2023-09-17 10:38:46 +08:00
|
|
|
void PrintContextMsg(LibCmo::CKSTRING msg);
|
2023-08-27 12:30:12 +08:00
|
|
|
|
|
|
|
CmdHelper::CommandRoot m_Root;
|
|
|
|
CmdHelper::HelpDocument* m_Help;
|
|
|
|
CmdHelper::CmdSplitter m_Splitter;
|
|
|
|
|
|
|
|
size_t m_PageLen;
|
2023-10-28 18:17:53 +08:00
|
|
|
bool m_ListStyleIsFull;
|
|
|
|
SearchPart m_SearchPart;
|
|
|
|
LibCmo::XContainer::XArray<size_t> m_SearchIdxResult;
|
|
|
|
|
2023-08-27 12:30:12 +08:00
|
|
|
bool m_OrderExit;
|
|
|
|
LibCmo::CK2::CKContext* m_Ctx;
|
|
|
|
LibCmo::CK2::CKFileReader* m_FileReader;
|
2023-09-30 14:24:37 +08:00
|
|
|
bool m_IsShallowRead;
|
2023-08-27 12:30:12 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}
|