mirror of
https://github.com/amyinspace/MagicSetEditor2.git
synced 2026-06-13 05:57:00 -04:00
Cleaned up the reflection code a bit
* Renamed 'tag' variable to 'handler' * Removed addAlias stuff, instead check for matching names with if statements * Added after_reading function that is called by Reader after reading a complete object. This generalizes Packaged::validate, which is now also called via this mechanism. * Removed some backwards compatibility with <0.3.0 for templates
This commit is contained in:
@@ -25,11 +25,11 @@ class Writer {
|
||||
Writer(OutputStream& output, Version file_app_version);
|
||||
|
||||
/// Tell the reflection code we are not reading
|
||||
inline bool reading() const { return false; }
|
||||
inline bool scripting() const { return false; }
|
||||
inline bool isComplex() const { return true; }
|
||||
inline void addAlias(int, const Char*, const Char*) {}
|
||||
inline void handleIgnore(int, const Char*) {}
|
||||
static constexpr bool isReading = false;
|
||||
static constexpr bool isWriting = true;
|
||||
static constexpr bool isScripting = false;
|
||||
inline bool isCompound() const { return true; }
|
||||
inline Version formatVersion() const { return app_version; }
|
||||
|
||||
// --------------------------------------------------- : Handling objects
|
||||
/// Handle an object: write it under the given name
|
||||
@@ -145,7 +145,7 @@ void Writer::handle(const IndexMap<K,V>& m) {
|
||||
reflect_ ## Enum(const_cast<Enum&>(enum_), writer); \
|
||||
}
|
||||
|
||||
/// 'Tag' to be used when reflecting enumerations for Writer
|
||||
/// Handler to be used when reflecting enumerations for Writer
|
||||
class EnumWriter {
|
||||
public:
|
||||
inline EnumWriter(Writer& writer)
|
||||
|
||||
Reference in New Issue
Block a user