lemon/lemon_writer.h
changeset 1661 e31b5799b884
parent 1492 0d58f0301923
child 1690 7db44a7ab939
equal deleted inserted replaced
2:bbef6de884c5 3:fba3ade77b11
   129       /// Constructor for SectionWriter. It attach this writer to
   129       /// Constructor for SectionWriter. It attach this writer to
   130       /// the given LemonWriter.
   130       /// the given LemonWriter.
   131       SectionWriter(LemonWriter& writer) {
   131       SectionWriter(LemonWriter& writer) {
   132 	writer.attach(*this);
   132 	writer.attach(*this);
   133       }
   133       }
       
   134       
       
   135       virtual ~SectionWriter() {}
   134 
   136 
   135       /// \brief The header of section.
   137       /// \brief The header of section.
   136       ///
   138       ///
   137       /// It gives back the header of the section.
   139       /// It gives back the header of the section.
   138       virtual std::string header() = 0;
   140       virtual std::string header() = 0;
   248     };
   250     };
   249 
   251 
   250 
   252 
   251     class ValueWriterBase {
   253     class ValueWriterBase {
   252     public:
   254     public:
       
   255       virtual ~ValueWriterBase() {}
   253       virtual void write(std::ostream&) = 0;
   256       virtual void write(std::ostream&) = 0;
   254     };
   257     };
   255 
   258 
   256     template <typename _Value, typename _Writer>
   259     template <typename _Value, typename _Writer>
   257     class ValueWriter : public ValueWriterBase {
   260     class ValueWriter : public ValueWriterBase {
   273 
   276 
   274     template <typename _Item>
   277     template <typename _Item>
   275     class IdWriterBase {
   278     class IdWriterBase {
   276     public:
   279     public:
   277       typedef _Item Item;
   280       typedef _Item Item;
       
   281       virtual ~IdWriterBase() {}
   278       virtual void write(std::ostream&, const Item&) const = 0;
   282       virtual void write(std::ostream&, const Item&) const = 0;
   279       virtual bool isIdWriter() const = 0;
   283       virtual bool isIdWriter() const = 0;
   280     };
   284     };
   281 
   285 
   282     template <typename _Item, typename _BoxedIdWriter>
   286     template <typename _Item, typename _BoxedIdWriter>