From cbae03f02c2c6ffdf8476912743dbd967be8fad2 Mon Sep 17 00:00:00 2001 From: fangyunzhong Date: Tue, 13 Sep 2022 09:47:14 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E7=A0=81=E8=A7=84=E8=8C=83=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: fangyunzhong --- include/config_parser.h | 6 ++++-- include/file_manager.h | 6 ++++-- include/i_resource_compiler.h | 3 ++- include/increment_manager.h | 12 ++++++++---- include/key_manager.h | 3 ++- include/preview_manager.h | 3 ++- include/resource_module.h | 3 ++- include/solid_xml.h | 18 ++++++++++++------ include/sqlite_database.h | 3 ++- 9 files changed, 38 insertions(+), 19 deletions(-) diff --git a/include/config_parser.h b/include/config_parser.h index f10d4a1..aab30b2 100644 --- a/include/config_parser.h +++ b/include/config_parser.h @@ -40,10 +40,12 @@ public: ModuleType GetModuleType() const; uint32_t ParseRefence(); uint32_t Save(const std::string &filePath) const; - static void SetUseModule() { + static void SetUseModule() + { useModule_ = true; }; - static std::string GetConfigName() { + static std::string GetConfigName() + { return useModule_ ? MODULE_JSON : CONFIG_JSON; }; private: diff --git a/include/file_manager.h b/include/file_manager.h index 9b30368..7706208 100644 --- a/include/file_manager.h +++ b/include/file_manager.h @@ -28,10 +28,12 @@ namespace Restool { class FileManager : public Singleton { public: uint32_t ScanModules(const std::vector &inputs, const std::string &output); - const std::map> &GetResources() const { + const std::map> &GetResources() const + { return items_; }; - void SetModuleName(const std::string &moduleName) { + void SetModuleName(const std::string &moduleName) + { moduleName_ = moduleName; }; uint32_t ScanIncrement(const std::string &output); diff --git a/include/i_resource_compiler.h b/include/i_resource_compiler.h index 6667c5e..07425f9 100644 --- a/include/i_resource_compiler.h +++ b/include/i_resource_compiler.h @@ -32,7 +32,8 @@ public: const std::map> &GetResult() const; uint32_t Compile(const FileInfo &fileInfo); void SetModuleName(const std::string &moduleName); - void SetPreviewMode(bool enable) { + void SetPreviewMode(bool enable) + { previewMode_ = enable; }; uint32_t CompileForAppend(const FileInfo &fileInfo); diff --git a/include/increment_manager.h b/include/increment_manager.h index 6e39114..b38d1f7 100644 --- a/include/increment_manager.h +++ b/include/increment_manager.h @@ -44,16 +44,20 @@ public: virtual ~IncrementManager(); uint32_t Init(const std::string &cachePath, const std::vector &folder, const std::string &outputPath, const std::string &moduleName); - const std::map> &GetResourceItems() const { + const std::map> &GetResourceItems() const + { return items_; }; - const std::map> &GetScanDirs() const { + const std::map> &GetScanDirs() const + { return scanDirs_; }; - bool FirstIncrement() const { + bool FirstIncrement() const + { return firstIncrement_; }; - bool Enable() const { + bool Enable() const + { return enalbe_; }; diff --git a/include/key_manager.h b/include/key_manager.h index aa69260..639ccf4 100644 --- a/include/key_manager.h +++ b/include/key_manager.h @@ -28,7 +28,8 @@ public: virtual ~KeyManager() {}; bool LoadKey(const std::string &keysPath); bool SaveKey(const std::string &keysPath); - std::map> &GetKeys() { + std::map> &GetKeys() + { return keys_; }; private: diff --git a/include/preview_manager.h b/include/preview_manager.h index 9c49456..9cbe6ce 100644 --- a/include/preview_manager.h +++ b/include/preview_manager.h @@ -28,7 +28,8 @@ public: PreviewManager() {}; virtual ~PreviewManager(); uint32_t ScanModules(const std::vector &modulePaths, const std::string &output); - void SetPriority(int32_t priority) { + void SetPriority(int32_t priority) + { priority_ = priority; }; private: diff --git a/include/resource_module.h b/include/resource_module.h index 24a4974..ae01a1d 100644 --- a/include/resource_module.h +++ b/include/resource_module.h @@ -31,7 +31,8 @@ public: const std::map> &GetScanDirectorys() const; static uint32_t MergeResourceItem(std::map> &alls, const std::map> &other, bool tipError = false); - void SetPreviewMode(bool enable) { + void SetPreviewMode(bool enable) + { previewMode_ = enable; }; diff --git a/include/solid_xml.h b/include/solid_xml.h index 76583e4..4675f63 100644 --- a/include/solid_xml.h +++ b/include/solid_xml.h @@ -42,13 +42,16 @@ private: virtual bool LoadFrom(std::ifstream &in); virtual bool FlushIndex(const std::map> &oldKeys, std::map> &newKeys); - void SetName(int32_t index) { + void SetName(int32_t index) + { name_ = index; }; - void SetValue(int32_t index) { + void SetValue(int32_t index) + { value_ = index; }; - void SetNameSpace(int32_t index) { + void SetNameSpace(int32_t index) + { nameSpace_ = index; }; protected: @@ -65,13 +68,16 @@ private: bool LoadFrom(std::ifstream &in) override; bool FlushIndex(const std::map> &oldKeys, std::map> &newKeys) override; - void SetChild(int32_t index) { + void SetChild(int32_t index) + { child_ = index; }; - void SetBrother(int32_t index) { + void SetBrother(int32_t index) + { brother_ = index; }; - void AddAttribute(int32_t index) { + void AddAttribute(int32_t index) + { attributes_.push_back(index); }; private: diff --git a/include/sqlite_database.h b/include/sqlite_database.h index 17baba7..8ec06bb 100644 --- a/include/sqlite_database.h +++ b/include/sqlite_database.h @@ -30,7 +30,8 @@ public: bool OpenDatabase(); void CloseDatabase(); bool Insert(const ResourceItem &resourceItem); - void SetPriority(int32_t priority) { + void SetPriority(int32_t priority) + { priority_ = priority; }; private: