diff options
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); |