// TextDataset.h #ifndef dset__TextDataset_H #define dset__TextDataset_H // David Adams // May 2005 // // A text dataset holds a collection of text objets. // There is one content block with one ID for each text object. // // GenericDataset // fulltype = TextDataset // ... // #include "dataset_util/Text.h" #include "dataset_base/GenericDataset.h" namespace dset { class TextDataset : public GenericDataset { public: // typedefs typedef std::vector TextList; private: // data TextList m_texts; public: // local functions // Constructor. // Text names must be relative and may not repeat. // If absent, and empty object is recorded. explicit TextDataset(std::string clab, std::string snames =""); // Promoter. explicit TextDataset(const GenericDataset& gdst); public: // inherited functions // Merge another dataset. // Content label must be the same. // Text names may not overlap. int merge(const Dataset& dst, std::string dir =""); // Create the extra XML describing the included text objects. const XmlElement* create_extra_xml() const; // Web page. // Overide to add support for text objects. // baseurl = URL for this dataset // repurl = URL for the repository holding constituents // entry: // blank to show entire dataset Text web_page(std::string baseurl, std::string repurl, std::string entry) const; public: // local definitions // Text objects. const TextList& texts() const { return m_texts; } }; } // end namespace dset #endif