#pragma once #include #include class BaseValue { public: enum Kind { KD_Numeric, KD_Text, KD_DateTime, /// An unspecified type, otherwise known as "any" in some contexts. InvalidKind, KindCount = InvalidKind, }; private: Kind mKind; public: static const char* FormatKind(Kind kind); static std::unique_ptr CreateByKind(Kind kind); BaseValue(Kind kind); virtual ~BaseValue() = default; BaseValue(const BaseValue&) = delete; BaseValue& operator=(const BaseValue&) = delete; BaseValue(BaseValue&&) = default; BaseValue& operator=(BaseValue&&) = default; Kind GetKind() const; // TODO get constant editor /// The functions \c ReadFrom, \c WriteTo will only be valid to call if this function returns true. virtual bool SupportsConstant() const; virtual void ReadFrom(std::istream& stream); virtual void WriteTo(std::ostream& stream); };