1 // StringContent.h 2 // * PURPOSE 3 // Implements IPersistent to store element content in 4 // a BString and automatically strip leading/trailing 5 // whitespace. Doesn't handle child elements; export 6 // is not implemented (triggers an error). 7 // 8 // * HISTORY 9 // e.moon 7dec99 Begun 10 11 #ifndef __StringContent_H__ 12 #define __StringContent_H__ 13 14 #include <MediaDefs.h> 15 16 #include "XML.h" 17 #include "cortex_defs.h" 18 19 __BEGIN_CORTEX_NAMESPACE 20 21 class StringContent : 22 public IPersistent { 23 24 public: // content access 25 BString content; 26 27 public: // *** dtor, default ctors 28 virtual ~StringContent() {} 29 StringContent() {} 30 StringContent( 31 const char* c) : content(c) {} 32 33 public: // *** IPersistent 34 35 // EXPORT 36 37 virtual void xmlExportBegin( 38 ExportContext& context) const; 39 40 virtual void xmlExportAttributes( 41 ExportContext& context) const; 42 43 virtual void xmlExportContent( 44 ExportContext& context) const; 45 46 virtual void xmlExportEnd( 47 ExportContext& context) const; 48 49 // IMPORT 50 51 virtual void xmlImportBegin( 52 ImportContext& context); 53 54 virtual void xmlImportAttribute( 55 const char* key, 56 const char* value, 57 ImportContext& context); 58 59 virtual void xmlImportContent( 60 const char* data, 61 uint32 length, 62 ImportContext& context); 63 64 virtual void xmlImportChild( 65 IPersistent* child, 66 ImportContext& context); 67 68 virtual void xmlImportComplete( 69 ImportContext& context); 70 }; 71 72 __END_CORTEX_NAMESPACE 73 #endif /*__StringContent_H__ */ 74