summaryrefslogtreecommitdiffstats
path: root/src/io
diff options
context:
space:
mode:
authorKris De Gussem <kris.degussem@gmail.com>2013-03-11 21:47:05 +0000
committerKris <Kris.De.Gussem@hotmail.com>2013-03-11 21:47:05 +0000
commitc9ab0e5a52eeea522ba9f526836310a80bcfe466 (patch)
treec920867ca58d37bfd847e929aa797c51e366b8ad /src/io
parentfix build warnings / cppcheck ( Bug #1120585 ) (diff)
downloadinkscape-c9ab0e5a52eeea522ba9f526836310a80bcfe466.tar.gz
inkscape-c9ab0e5a52eeea522ba9f526836310a80bcfe466.zip
Drop duplicate io code ( Bug #1120585 )
(bzr r12192)
Diffstat (limited to '')
-rw-r--r--src/io/CMakeLists.txt3
-rw-r--r--src/io/Makefile_insert2
-rw-r--r--src/io/bufferstream.cpp (renamed from src/dom/io/bufferstream.cpp)18
-rw-r--r--src/io/bufferstream.h (renamed from src/dom/io/bufferstream.h)38
4 files changed, 14 insertions, 47 deletions
diff --git a/src/io/CMakeLists.txt b/src/io/CMakeLists.txt
index c5606779e..34502d3db 100644
--- a/src/io/CMakeLists.txt
+++ b/src/io/CMakeLists.txt
@@ -1,6 +1,7 @@
set(io_SRC
base64stream.cpp
+ bufferstream.cpp
ftos.cpp
gzipstream.cpp
inkjar.cpp
@@ -12,10 +13,10 @@ set(io_SRC
uristream.cpp
xsltstream.cpp
-
# -------
# Headers
base64stream.h
+ bufferstream.h
ftos.h
gzipstream.h
inkjar.h
diff --git a/src/io/Makefile_insert b/src/io/Makefile_insert
index bb47b46b8..935c0cc07 100644
--- a/src/io/Makefile_insert
+++ b/src/io/Makefile_insert
@@ -3,6 +3,8 @@
ink_common_sources += \
io/base64stream.h \
io/base64stream.cpp \
+ io/bufferstream.cpp \
+ io/bufferstream.h \
io/ftos.cpp \
io/ftos.h \
io/gzipstream.cpp \
diff --git a/src/dom/io/bufferstream.cpp b/src/io/bufferstream.cpp
index 3389bd80e..ba440254f 100644
--- a/src/dom/io/bufferstream.cpp
+++ b/src/io/bufferstream.cpp
@@ -33,22 +33,14 @@
#include "bufferstream.h"
-namespace org
+namespace Inkscape
{
-namespace w3c
+namespace IO
{
-namespace dom
-{
-namespace io
-{
-
-
//#########################################################################
//# B U F F E R I N P U T S T R E A M
//#########################################################################
-
-
/**
*
*/
@@ -157,10 +149,8 @@ int BufferOutputStream::put(gunichar ch)
-} //namespace io
-} //namespace dom
-} //namespace w3c
-} //namespace org
+} //namespace IO
+} //namespace Inkscape
//#########################################################################
//# E N D O F F I L E
diff --git a/src/dom/io/bufferstream.h b/src/io/bufferstream.h
index 0ac06b362..ed565572a 100644
--- a/src/dom/io/bufferstream.h
+++ b/src/io/bufferstream.h
@@ -31,20 +31,15 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
+#include <vector.h>
+#include "inkscapestream.h"
-#include "domstream.h"
-
-namespace org
-{
-namespace w3c
-{
-namespace dom
+namespace Inkscape
{
-namespace io
+namespace IO
{
-
//#########################################################################
//# S T R I N G I N P U T S T R E A M
//#########################################################################
@@ -59,21 +54,14 @@ class BufferInputStream : public InputStream
public:
BufferInputStream(const std::vector<unsigned char> &sourceBuffer);
-
virtual ~BufferInputStream();
-
virtual int available();
-
virtual void close();
-
virtual int get();
private:
-
const std::vector<unsigned char> &buffer;
-
long position;
-
bool closed;
}; // class BufferInputStream
@@ -95,15 +83,10 @@ class BufferOutputStream : public OutputStream
public:
BufferOutputStream();
-
virtual ~BufferOutputStream();
-
virtual void close();
-
virtual void flush();
-
virtual int put(gunichar ch);
-
virtual std::vector<unsigned char> &getBuffer()
{ return buffer; }
@@ -111,24 +94,15 @@ public:
{ buffer.clear(); }
private:
-
std::vector<unsigned char> buffer;
-
bool closed;
-
}; // class BufferOutputStream
-
-
-
-
-} //namespace io
-} //namespace dom
-} //namespace w3c
-} //namespace org
+} //namespace IO
+} //namespace Inkscape