X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Floader%2FParsedSource.h;h=e10b287aa661fbd9b5b9cdfac71c593d0714dc47;hb=ac3755adc509404528ef7de58695bf8e3bfb7dcd;hp=8401777f54e0f43ebac98a6ed2e3286a268ec87f;hpb=09e8cfd4d7b2d187fed0870ebdb2e9e3f77fe4b9;p=l2e.git diff --git a/src/loader/ParsedSource.h b/src/loader/ParsedSource.h index 8401777..e10b287 100644 --- a/src/loader/ParsedSource.h +++ b/src/loader/ParsedSource.h @@ -51,6 +51,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; @@ -206,6 +209,9 @@ public: const std::map &Definitions() const { return definitions; } const std::set &Exports() const { return exports; } +public: + void WriteHeader(std::ostream &) const; + private: std::map declarations; std::map definitions;