X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FParsedSource.h;h=64baaaa4d3cb99cec172e65acbdcb14f7e69fd72;hb=2a1d9169e1f6c2dfe0f93ed40d5fb68d3da342af;hp=98ecd8423c401652f235c01a5ed7d68d40b1379b;hpb=ba714f2fe9064dd49b4c4a387502579b38a73223;p=l2e.git diff --git a/src/loader/ParsedSource.h b/src/loader/ParsedSource.h index 98ecd84..64baaaa 100644 --- a/src/loader/ParsedSource.h +++ b/src/loader/ParsedSource.h @@ -8,6 +8,8 @@ #ifndef LOADER_PARSEDSOURCE_H_ #define LOADER_PARSEDSOURCE_H_ +#include "fwd.h" + #include #include #include @@ -16,9 +18,6 @@ namespace loader { -class PropertyList; -class Value; - class Literal { public: @@ -36,7 +35,7 @@ public: public: explicit Literal(const std::vector &); - explicit Literal(const std::vector &); + Literal(const std::string &, const std::vector &); explicit Literal(bool); Literal(int r, int g, int b, int a = 255); explicit Literal(int number); @@ -51,6 +50,9 @@ private: public: Type GetType() const { return type; } + bool IsArray() const { return GetType() == ARRAY_VALUES || GetType() == ARRAY_PROPS; } + bool IsObject() const { return GetType() == OBJECT; } + int ArraySize() const { return GetType() == ARRAY_VALUES ? GetValues().size() : GetPropertyLists().size(); } const std::vector &GetValues() const; const std::vector &GetPropertyLists() const; @@ -68,7 +70,7 @@ public: private: PropertyList *props; - std::string str; + std::string typeName, str; std::vector values; std::vector propertyLists; int i1, i2, i3, i4;