library_entry::impl class
The library_entry::impl class provides the interface that library
implementations must implement to parse individual library entries.  Each
library_entry and library::const_iterator holds onto one of
these.
This must be overriden to perform a deep copy of the library. Almost always this should be implemented as follows:
virtual library_entry::impl* mylib::entry_type::clone() const { return new mylib::entry_type(*this); }
The function should be overriden to read the next entry from the library and return true unless the end of the library has been reached. The source of the data should be held within the
library_baseimplementation, and not this class. For example, if the library implementation reads from a file via anifstream, thelibrary_baseclass should contain theifstreamand this class should access it via lb:virtual bool mylib::entry_type::readentry( library_base& lb ) { ifstream& ifs = dynamic_cast< mylib& >( lb ).ifs; std::getline( ifs, this->entry ); }None of
library_entry's other functions should ever access the parentlibrary_baseclass.This function gets called whenever a
library::const_iteratoris constructed or incremented.
These should be overriden to return the name of the current entry. The
namefunction should return a name which is unique within the library (this may require the class name(s) and/or stage name be included); thebase_namefunction should return the name without either the class or stage name.These functions may be implemented to simply return a name that was parsed by
readentry; alternatively it might be implemented to parse some internal representation of the entry (such as a string containing the whole entry). It must not attempt to access the parentlibrary_basewhich may no longer exist. Thereadentryfunction will always have been called before this function gets called.