]> git.localhorst.tv Git - l2e.git/blobdiff - src/loader/ParsedSource.h
set correct literal status in Value constructor
[l2e.git] / src / loader / ParsedSource.h
index d5347e55c201d5e02a9492369acdc519ec6740cc..6351ae43f90855b8786c57f2c2d23447817ef0bd 100644 (file)
@@ -78,7 +78,12 @@ public:
        explicit Value(const std::string &identifier)
        : literal(0), identifier(identifier), isLiteral(false) { }
        explicit Value(Literal *literal)
-       : literal(literal), isLiteral(false) { }
+       : literal(literal), isLiteral(true) { }
+
+public:
+       bool IsLiteral() const { return isLiteral; }
+       const Literal &GetLiteral() const;
+       const std::string &GetIdentifier() const;
 
 private:
        Literal *literal;
@@ -98,6 +103,13 @@ public:
                props[name] = value;
        }
 
+       typedef std::map<std::string, Value *>::iterator Iterator;
+       typedef std::map<std::string, Value *>::const_iterator ConstIterator;
+       Iterator Begin() { return props.begin(); }
+       ConstIterator Begin() const { return props.begin(); }
+       Iterator End() { return props.end(); }
+       ConstIterator End() const { return props.end(); }
+
 private:
        std::map<std::string, Value *> props;