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