diff options
author | Shauren <shauren.trinity@gmail.com> | 2020-07-01 00:34:51 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2020-07-01 00:34:51 +0200 |
commit | 4499f203a3ee9d6567b2af9011ee9e4378de0eab (patch) | |
tree | e2a2b2f58794edaa41886bc3ffb201a4f8c66361 /src/common/DataStores/DB2FileLoader.h | |
parent | 587bf750f74245f0f7bb3b88dc599738eacb0226 (diff) |
Core/DataStores: Fixed sending localized hotfixes and improved db2 loading error messages
Diffstat (limited to 'src/common/DataStores/DB2FileLoader.h')
-rw-r--r-- | src/common/DataStores/DB2FileLoader.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/common/DataStores/DB2FileLoader.h b/src/common/DataStores/DB2FileLoader.h index 6f0bca5ee5b..72a5f66768d 100644 --- a/src/common/DataStores/DB2FileLoader.h +++ b/src/common/DataStores/DB2FileLoader.h @@ -19,6 +19,7 @@ #define DB2_FILE_LOADER_H #include "Common.h" +#include <exception> #include <string> #include <vector> @@ -163,6 +164,17 @@ struct DB2RecordCopy }; #pragma pack(pop) +class TC_COMMON_API DB2FileLoadException : public std::exception +{ +public: + DB2FileLoadException(std::string msg) : _msg(std::move(msg)) { } + + char const* what() const noexcept override { return _msg.c_str(); } + +private: + std::string _msg; +}; + class TC_COMMON_API DB2FileLoader { public: @@ -170,8 +182,8 @@ public: ~DB2FileLoader(); // loadInfo argument is required when trying to read data from the file - bool LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* loadInfo); - bool Load(DB2FileSource* source, DB2FileLoadInfo const* loadInfo); + void LoadHeaders(DB2FileSource* source, DB2FileLoadInfo const* loadInfo); + void Load(DB2FileSource* source, DB2FileLoadInfo const* loadInfo); char* AutoProduceData(uint32& indexTableSize, char**& indexTable); char* AutoProduceStrings(char** indexTable, uint32 indexTableSize, LocaleConstant locale); void AutoProduceRecordCopies(uint32 records, char** indexTable, char* dataTable); |