// file : XSCRT/Writer.hpp // author : Boris Kolpackov #ifndef XSCRT_WRITER_HPP #define XSCRT_WRITER_HPP #include #include #include "ace/XML_Utils/XSCRT/XML.hpp" namespace XSCRT { template class Writer { public: Writer (XML::Element& e) : attr__ (0) { push_ (e); } protected: // This c-tor should never be called. // Writer () { abort (); } public: void push_ (XML::Element const& e) { stack_.push (e); } void pop_ () { stack_.pop (); } XML::Element& top_ () { return stack_.top (); } public: XML::Attribute* attr_ () { return attr__; } void attr_ (XML::Attribute* a) { attr__ = a; } private: std::stack > stack_; XML::Attribute* attr__; private: Writer (Writer const&); void operator= (Writer const&); }; } #endif // XSCRT_WRITER_HPP