diff options
author | Aki <please@ignore.pl> | 2022-04-12 18:33:34 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2022-04-12 18:33:34 +0200 |
commit | 9c1439b0e5e1c90723c0f2f6e22a24a935623542 (patch) | |
tree | f1999c9dc2e62c576fcc14f326992514ea20e016 /StarsEx/DataLoader.h | |
parent | 220f110e298a211d0f508ed33bae0fa9e9bf4689 (diff) | |
download | starshatter-9c1439b0e5e1c90723c0f2f6e22a24a935623542.zip starshatter-9c1439b0e5e1c90723c0f2f6e22a24a935623542.tar.gz starshatter-9c1439b0e5e1c90723c0f2f6e22a24a935623542.tar.bz2 |
Changed error returning in DataLoader
This is to allow meaningful return values for identification of unique
sources.
Diffstat (limited to 'StarsEx/DataLoader.h')
-rw-r--r-- | StarsEx/DataLoader.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/StarsEx/DataLoader.h b/StarsEx/DataLoader.h index 92cdd11..6d83e2f 100644 --- a/StarsEx/DataLoader.h +++ b/StarsEx/DataLoader.h @@ -29,10 +29,9 @@ class DataLoader public: using Group = DataSource::Group; + static constexpr int FAILED {-1}; static const char* TYPENAME() { return "DataLoader"; } - enum { DATAFILE_OK, DATAFILE_INVALID, DATAFILE_NOTEXIST }; - DataLoader(); virtual ~DataLoader(); @@ -40,6 +39,8 @@ public: static void Initialize(); static void Close(); + const char* LastError() const; + void Reset(); void UseFileSystem(bool use=true); void UseVideo(Video* v); @@ -83,6 +84,8 @@ private: Video* video; bool enable_media; + Text last_error; + List<DataArchive> archives; List<DataSource> sources; DataSource* work_directory_source; |