diff options
Diffstat (limited to 'project2/common/variables-modliteral.h')
-rw-r--r-- | project2/common/variables-modliteral.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/project2/common/variables-modliteral.h b/project2/common/variables-modliteral.h new file mode 100644 index 0000000..77a43cc --- /dev/null +++ b/project2/common/variables-modliteral.h @@ -0,0 +1,40 @@ +#ifndef VARIABLES_MODLITERAL_H +#define VARIABLES_MODLITERAL_H + +#include "variables.h" +#include <list> + +class VariableLiteral : public VariableImpl { + public: + VariableLiteral(const Glib::ustring & src, const VT_typeID format = DefaultType); + VariableLiteral(ScriptNodePtr); + virtual VariableType value() const; + class Part; + typedef boost::intrusive_ptr<Part> PartCPtr; + typedef std::list<PartCPtr> Vals; + + class Part : public IntrusivePtrBase { + public: + virtual void appendTo(Glib::ustring & str) const = 0; + virtual operator VariableType() const = 0; + }; + class TextPart : public Part { + public: + TextPart(const Glib::ustring & e); + void appendTo(Glib::ustring & str) const; + operator VariableType() const; + const Glib::ustring txt; + }; + class VarPart : public Part, public Variable { + public: + VarPart(ScriptNodePtr e); + void appendTo(Glib::ustring & str) const; + operator VariableType() const; + }; + private: + VariableType val; + Vals vals; +}; + +#endif + |