1 // Copyright 2009 The Archiveopteryx Developers <info@aox.org> 2 3 #ifndef DOCBLOCK_H 4 #define DOCBLOCK_H 5 6 #include "estring.h" 7 #include "dict.h" 8 9 class File; 10 class Class; 11 class Function; 12 class Intro; 13 14 15 class DocBlock 16 : public Garbage 17 { 18 public: 19 DocBlock( File *, uint, const EString &, Function * ); 20 DocBlock( File *, uint, const EString &, Class * ); 21 DocBlock( File *, uint, const EString &, Intro * ); 22 23 bool isClass() const; 24 bool isEnum() const; 25 26 EString text() const; 27 28 void generate(); 29 30 enum State { 31 Plain, 32 Argument, 33 Introduces 34 }; 35 36 private: 37 void whitespace( uint &, uint & ); 38 void word( uint &, uint, uint ); 39 void overload( uint, uint ); 40 void plainWord( const EString &, uint ); 41 void checkEndState( uint ); 42 void setState( State, const EString &, uint ); 43 void generateFunctionPreamble(); 44 void generateClassPreamble(); 45 void generateIntroPreamble(); 46 47 private: 48 File * file; 49 uint line; 50 Class * c; 51 Function * f; 52 Intro * i; 53 EString t; 54 State s; 55 Dict<void> arguments; 56 bool isReimp; 57 bool introduces; 58 }; 59 60 61 #endif 62