ui-gxmlcpp 1.4.6
Buffer.hpp
Go to the documentation of this file.
1
10#ifndef UI_GXML_BUFFER_HPP
11#define UI_GXML_BUFFER_HPP
12
13// STDC++
14#include <string>
15
16// C libraries
17#include <libxml/tree.h>
18
19// C++ libraries
21#include <ui-gxmlcpp/Util.hpp>
22
23namespace UI {
24namespace GXML {
25
27class Buffer: private UI::Util::auto_base<xmlBuffer>
28{
29public:
32 {
33 Mem_
34 };
37
38 Buffer();
39 ~Buffer();
40
42 void concat(std::string const & text);
44 char const * getBuf() const;
46 int getSize() const;
47
48 using UI::Util::auto_base<xmlBuffer>::get;
49};
50
52class OutputBuffer: private Buffer
53{
54public:
56
59 using Buffer::concat;
60#ifdef LIBXML2_NEW_BUFFER
63 char const * getBuf() const;
65 int getSize() const;
66#else
67 using Buffer::getBuf;
68 using Buffer::getSize;
69#endif
70
72 xmlOutputBuffer * get() const;
74 xmlOutputBuffer * operator->() const;
75
76private:
77#ifdef LIBXML2_NEW_BUFFER
78 xmlOutputBuffer * outbuf_;
79#else
80 xmlOutputBuffer outbuf_;
81#endif
82};
83
84}}
85#endif
Abstraction for libxml2's xmlBuffer.
Definition Buffer.hpp:28
char const * getBuf() const
Get buffer content address.
Definition Buffer.cpp:56
void concat(std::string const &text)
Append text.
Definition Buffer.cpp:48
CodeException< ErrorCode > Exception
Exceptions for this class.
Definition Buffer.hpp:36
ErrorCode
Error codes for exceptions.
Definition Buffer.hpp:32
int getSize() const
Get buffer content size.
Definition Buffer.cpp:61
Adding code facility to Exception.
Definition Exception.hpp:35
OutputBuffer holder class.
Definition Buffer.hpp:53
char const * getBuf() const
Get buffer content address.
Definition Buffer.cpp:56
xmlOutputBuffer * get() const
Get underlying pointer.
Definition Buffer.cpp:106
int getSize() const
Get buffer content size.
Definition Buffer.cpp:61
xmlOutputBuffer * operator->() const
Smart dereferencing.
Definition Buffer.cpp:111
Namespace for all Schlund+Partner Code.
Definition Buffer.cpp:30