/* * annotation.h * * Created on: Aug 23, 2016 * Author: gregor */ #ifndef EXTRACTOR_ANNOTATION_H_ #define EXTRACTOR_ANNOTATION_H_ #include "typetreenode.h" enum BuiltinAnnotationType { NoReflection, ReadProperty, WriteProperty, ReadWriteProperty }; class Annotation : public gltb::ReferencedObject { public: Annotation(std::string annotationString) : annotationString(annotationString) { parseAnnotation(); } std::string getDescription() { return "annotation " + annotationString; } std::string getAnnotationName() { return annotationName; } const std::vector &getArguments() { return arguments; } bool isBuiltInAnnotation() { return isBuiltin; } BuiltinAnnotationType getBuiltinAnnotationType() { return builtinAnnotationType; } private: std::string annotationString; bool isBuiltin; BuiltinAnnotationType builtinAnnotationType; std::string annotationName; std::vector arguments; void parseAnnotation(); }; class AnnotationString : public TypeTreeNode { public: AnnotationString(CXCursor cursor) : TypeTreeNode(cursor) { parseAnnotationString(); } virtual std::string getDescription() const override { return "annotation " + getName(); } const std::vector> &getAnnotations() { return annotations; } private: std::vector> annotations; void parseAnnotationString(); }; #endif /* EXTRACTOR_ANNOTATION_H_ */