blob: 13c64d9b61b4f7ac74fe00d83bef5b7404f66fa5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
// file : XSCRT/Writer.hpp
// author : Boris Kolpackov <boris@dre.vanderbilt.edu>
#ifndef XSCRT_WRITER_HPP
#define XSCRT_WRITER_HPP
#include <stack>
#include <string>
#include "ace/XML_Utils/XSCRT/XML.hpp"
namespace XSCRT
{
template <typename C>
class Writer
{
public:
Writer (XML::Element<C>& e)
: attr__ (0)
{
push_ (e);
}
protected:
// This c-tor should never be called.
//
Writer ()
{
abort ();
}
public:
void
push_ (XML::Element<C> const& e)
{
stack_.push (e);
}
void
pop_ ()
{
stack_.pop ();
}
XML::Element<C>&
top_ ()
{
return stack_.top ();
}
public:
XML::Attribute<C>*
attr_ ()
{
return attr__;
}
void
attr_ (XML::Attribute<C>* a)
{
attr__ = a;
}
private:
std::stack<XML::Element<C> > stack_;
XML::Attribute<C>* attr__;
private:
Writer (Writer const&);
void
operator= (Writer const&);
};
}
#endif // XSCRT_WRITER_HPP
|