[2] | 1 | #ifndef morpheo_behavioural_XML_h |
---|
| 2 | #define morpheo_behavioural_XML_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id$ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #include <stdint.h> |
---|
| 12 | #include <iostream> |
---|
| 13 | #include <math.h> |
---|
| 14 | #include <list> |
---|
| 15 | #include "Include/ToString.h" |
---|
| 16 | |
---|
| 17 | using namespace std; |
---|
| 18 | |
---|
| 19 | namespace morpheo { |
---|
| 20 | namespace behavioural { |
---|
| 21 | |
---|
| 22 | // Virtual Class - Interface of each component |
---|
| 23 | class XML |
---|
| 24 | { |
---|
| 25 | // -----[ fields ]---------------------------------------------------- |
---|
[31] | 26 | private : const string _name ; |
---|
| 27 | private : string _filename_extension; |
---|
| 28 | private : string _body ; |
---|
| 29 | private : list<string> _list_balise_name ; |
---|
[3] | 30 | |
---|
[2] | 31 | // -----[ methods ]--------------------------------------------------- |
---|
[3] | 32 | public : XML (string name); |
---|
[2] | 33 | public : ~XML (void); |
---|
| 34 | |
---|
| 35 | public : bool balise_open (string name); // no attribut |
---|
| 36 | public : bool balise_open_begin (string name); |
---|
| 37 | public : bool balise_open_end (void); |
---|
| 38 | public : bool balise_close (void); |
---|
| 39 | public : bool singleton (string name); // no attribut |
---|
| 40 | public : bool singleton_begin (string name); |
---|
| 41 | public : bool singleton_end (void); |
---|
| 42 | public : bool attribut (string name, string value); |
---|
[29] | 43 | public : bool insert_XML (XML xml ); |
---|
[2] | 44 | |
---|
[31] | 45 | public : void filename_extension (string extension); |
---|
[3] | 46 | public : void generate_file (void); |
---|
| 47 | public : void generate_file (string encoding); |
---|
| 48 | public : string get_body (void); |
---|
| 49 | public : string get_body (uint32_t depth); |
---|
| 50 | |
---|
[2] | 51 | public : bool comment (string text); |
---|
| 52 | public : bool text (string text); |
---|
| 53 | |
---|
| 54 | private : string indent (uint32_t depth ); |
---|
| 55 | private : string indent (void); |
---|
| 56 | private : uint32_t depth (void); |
---|
| 57 | |
---|
| 58 | private : void header (string encoding); |
---|
| 59 | }; |
---|
| 60 | }; // end namespace behavioural |
---|
| 61 | }; // end namespace morpheo |
---|
| 62 | |
---|
| 63 | #endif |
---|