Code

Extensions. Fix for Bug #668895 (Extensions with <check> tags fail to load).
[inkscape.git] / src / io / stringstream.h
1 #ifndef __INKSCAPE_IO_STRINGSTREAM_H__
2 #define __INKSCAPE_IO_STRINGSTREAM_H__
4 #include <glibmm.h>
6 #include "inkscapestream.h"
9 namespace Inkscape
10 {
11 namespace IO
12 {
15 //#########################################################################
16 //# S T R I N G    I N P U T    S T R E A M
17 //#########################################################################
19 /**
20  * This class is for reading character from a Glib::ustring
21  *
22  */
23 class StringInputStream : public InputStream
24 {
26 public:
28     StringInputStream(Glib::ustring &sourceString);
29     
30     virtual ~StringInputStream();
31     
32     virtual int available();
33     
34     virtual void close();
35     
36     virtual int get();
37     
38 private:
40     Glib::ustring &buffer;
42     long position;
44 }; // class StringInputStream
49 //#########################################################################
50 //# S T R I N G   O U T P U T    S T R E A M
51 //#########################################################################
53 /**
54  * This class is for sending a stream to a Glib::ustring
55  *
56  */
57 class StringOutputStream : public OutputStream
58 {
60 public:
62     StringOutputStream();
63     
64     virtual ~StringOutputStream();
65     
66     virtual void close();
67     
68     virtual void flush();
69     
70     virtual void put(int ch);
72     virtual Glib::ustring &getString()
73         { return buffer; }
75     virtual void clear()
76         { buffer = ""; }
78 private:
80     Glib::ustring buffer;
83 }; // class StringOutputStream
91 } // namespace IO
92 } // namespace Inkscape
96 #endif /* __INKSCAPE_IO_STRINGSTREAM_H__ */