diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2013-03-11 21:47:05 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2013-03-11 21:47:05 +0000 |
| commit | c9ab0e5a52eeea522ba9f526836310a80bcfe466 (patch) | |
| tree | c920867ca58d37bfd847e929aa797c51e366b8ad /src | |
| parent | fix build warnings / cppcheck ( Bug #1120585 ) (diff) | |
| download | inkscape-c9ab0e5a52eeea522ba9f526836310a80bcfe466.tar.gz inkscape-c9ab0e5a52eeea522ba9f526836310a80bcfe466.zip | |
Drop duplicate io code ( Bug #1120585 )
(bzr r12192)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dom/CMakeLists.txt | 11 | ||||
| -rw-r--r-- | src/dom/Makefile_insert | 8 | ||||
| -rw-r--r-- | src/dom/io/stringstream.cpp | 159 | ||||
| -rw-r--r-- | src/dom/io/stringstream.h | 131 | ||||
| -rw-r--r-- | src/dom/io/uristream.cpp | 462 | ||||
| -rw-r--r-- | src/dom/io/uristream.h | 207 | ||||
| -rw-r--r-- | src/extension/internal/odf.cpp | 18 | ||||
| -rw-r--r-- | src/extension/internal/odf.h | 7 | ||||
| -rw-r--r-- | src/io/CMakeLists.txt | 3 | ||||
| -rw-r--r-- | src/io/Makefile_insert | 2 | ||||
| -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 |
12 files changed, 24 insertions, 1040 deletions
diff --git a/src/dom/CMakeLists.txt b/src/dom/CMakeLists.txt index 5d761e649..8167e1b03 100644 --- a/src/dom/CMakeLists.txt +++ b/src/dom/CMakeLists.txt @@ -14,16 +14,10 @@ set(dom_SRC ucd.cpp uri.cpp xmlreader.cpp - # xmlwriter.cpp xpathimpl.cpp xpathparser.cpp xpathtoken.cpp - io/bufferstream.cpp - io/domstream.cpp - io/stringstream.cpp - io/uristream.cpp - util/digest.cpp util/ziptool.cpp @@ -59,11 +53,6 @@ set(dom_SRC xpathparser.h xpathtoken.h - io/bufferstream.h - io/domstream.h - io/stringstream.h - io/uristream.h - util/digest.h util/ziptool.h ) diff --git a/src/dom/Makefile_insert b/src/dom/Makefile_insert index 91c91eeac..058242a36 100644 --- a/src/dom/Makefile_insert +++ b/src/dom/Makefile_insert @@ -50,14 +50,6 @@ dom_libdom_a_SOURCES = \ dom/xpathparser.h \ dom/xpathtoken.h \ dom/xpathtoken.cpp \ - dom/io/bufferstream.cpp \ - dom/io/bufferstream.h \ - dom/io/domstream.cpp \ - dom/io/domstream.h \ - dom/io/stringstream.cpp \ - dom/io/stringstream.h \ - dom/io/uristream.cpp \ - dom/io/uristream.h \ dom/util/digest.h \ dom/util/digest.cpp \ dom/util/ziptool.h \ diff --git a/src/dom/io/stringstream.cpp b/src/dom/io/stringstream.cpp deleted file mode 100644 index ca058a575..000000000 --- a/src/dom/io/stringstream.cpp +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Phoebe DOM Implementation. - * - * This is a C++ approximation of the W3C DOM model, which follows - * fairly closely the specifications in the various .idl files, copies of - * which are provided for reference. Most important is this one: - * - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html - * - * Authors: - * Bob Jamison - * - * Copyright (C) 2005 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * Our base String stream classes. We implement these to - * be based on DOMString - * - */ - - -#include "stringstream.h" - -namespace org -{ -namespace w3c -{ -namespace dom -{ -namespace io -{ - - - -//######################################################################### -//# S T R I N G I N P U T S T R E A M -//######################################################################### - - -/** - * - */ -StringInputStream::StringInputStream(const DOMString &sourceString) - : buffer((DOMString &)sourceString) -{ - position = 0; -} - -/** - * - */ -StringInputStream::~StringInputStream() -{ - -} - -/** - * Returns the number of bytes that can be read (or skipped over) from - * this input stream without blocking by the next caller of a method for - * this input stream. - */ -int StringInputStream::available() -{ - return buffer.size() - position; -} - - -/** - * Closes this input stream and releases any system resources - * associated with the stream. - */ -void StringInputStream::close() -{ -} - -/** - * Reads the next byte of data from the input stream. -1 if EOF - */ -int StringInputStream::get() -{ - if (position >= (int)buffer.size()) - return -1; - int ch = (int) buffer[position++]; - return ch; -} - - - - -//######################################################################### -//# S T R I N G O U T P U T S T R E A M -//######################################################################### - -/** - * - */ -StringOutputStream::StringOutputStream() -{ -} - -/** - * - */ -StringOutputStream::~StringOutputStream() -{ -} - -/** - * Closes this output stream and releases any system resources - * associated with this stream. - */ -void StringOutputStream::close() -{ -} - -/** - * Flushes this output stream and forces any buffered output - * bytes to be written out. - */ -void StringOutputStream::flush() -{ - //nothing to do -} - -/** - * Writes the specified byte to this output stream. - */ -int StringOutputStream::put(gunichar ch) -{ - buffer.push_back(ch); - return 1; -} - - - - -} //namespace io -} //namespace dom -} //namespace w3c -} //namespace org - -//######################################################################### -//# E N D O F F I L E -//######################################################################### diff --git a/src/dom/io/stringstream.h b/src/dom/io/stringstream.h deleted file mode 100644 index 9ba24fc26..000000000 --- a/src/dom/io/stringstream.h +++ /dev/null @@ -1,131 +0,0 @@ -#ifndef SEEN_STRINGSTREAM_H -#define SEEN_STRINGSTREAM_H -/** - * @file - * Phoebe DOM Implementation. - * - * This is a C++ approximation of the W3C DOM model, which follows - * fairly closely the specifications in the various .idl files, copies of - * which are provided for reference. Most important is this one: - * - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html - */ -/* - * Authors: - * Bob Jamison - * - * Copyright (C) 2006 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - -#include "domstream.h" - - -namespace org -{ -namespace w3c -{ -namespace dom -{ -namespace io -{ - - -//######################################################################### -//# S T R I N G I N P U T S T R E A M -//######################################################################### - -/** - * This class is for reading character from a DOMString - * - */ -class StringInputStream : public InputStream -{ - -public: - - StringInputStream(const DOMString &sourceString); - - virtual ~StringInputStream(); - - virtual int available(); - - virtual void close(); - - virtual int get(); - -private: - - DOMString &buffer; - - long position; - -}; // class StringInputStream - - - - -//######################################################################### -//# S T R I N G O U T P U T S T R E A M -//######################################################################### - -/** - * This class is for sending a stream to a DOMString - * - */ -class StringOutputStream : public OutputStream -{ - -public: - - StringOutputStream(); - - virtual ~StringOutputStream(); - - virtual void close(); - - virtual void flush(); - - virtual int put(gunichar ch); - - virtual DOMString &getString() - { return buffer; } - - virtual void clear() - { buffer = ""; } - -private: - - DOMString buffer; - - -}; // class StringOutputStream - - - - - - - -} //namespace io -} //namespace dom -} //namespace w3c -} //namespace org - - - -#endif // SEEN_STRINGSTREAM_H diff --git a/src/dom/io/uristream.cpp b/src/dom/io/uristream.cpp deleted file mode 100644 index f6172d9e0..000000000 --- a/src/dom/io/uristream.cpp +++ /dev/null @@ -1,462 +0,0 @@ -/* - * Phoebe DOM Implementation. - * - * This is a C++ approximation of the W3C DOM model, which follows - * fairly closely the specifications in the various .idl files, copies of - * which are provided for reference. Most important is this one: - * - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html - * - * Authors: - * Bob Jamison - * - * Copyright (C) 2005-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - - - -#include "uristream.h" -#include <cstdio> -#include <string.h> - - -namespace org -{ -namespace w3c -{ -namespace dom -{ -namespace io -{ - - - -//######################################################################### -//# U R I I N P U T S T R E A M / R E A D E R -//######################################################################### - - -/** - * - */ -UriInputStream::UriInputStream(const URI &source) - throw (StreamException): uri((URI &)source) -{ - init(); -} - -/** - * - */ -void UriInputStream::init() throw (StreamException) -{ - //get information from uri - scheme = uri.getScheme(); - - switch (scheme) - { - - case URI::SCHEME_FILE: - { - DOMString npath = uri.getNativePath(); - inf = fopen(npath.c_str(), "rb"); - if (!inf) - { - DOMString err = "UriInputStream cannot open file "; - err.append(npath); - throw StreamException(err); - } - break; - } - - case URI::SCHEME_DATA: - { - data = uri.getPath(); - //printf("in data:'%s'\n", data.c_str()); - dataPos = 0; - dataLen = uri.getPath().size(); - break; - } - } - - closed = false; -} - - - - - -/** - * - */ -UriInputStream::~UriInputStream() throw(StreamException) -{ - close(); -} - -/** - * Returns the number of bytes that can be read (or skipped over) from - * this input stream without blocking by the next caller of a method for - * this input stream. - */ -int UriInputStream::available() throw(StreamException) -{ - return 0; -} - - -/** - * Closes this input stream and releases any system resources - * associated with the stream. - */ -void UriInputStream::close() throw(StreamException) -{ - if (closed) - return; - - switch (scheme) - { - - case URI::SCHEME_FILE: - { - if (!inf) - return; - fflush(inf); - fclose(inf); - inf=NULL; - break; - } - - case URI::SCHEME_DATA: - { - //do nothing - break; - } - }//switch - - closed = true; -} - -/** - * Reads the next byte of data from the input stream. -1 if EOF - */ -int UriInputStream::get() throw(StreamException) -{ - int retVal = -1; - if (closed) - { - return -1; - } - - switch (scheme) - { - - case URI::SCHEME_FILE: - { - if (!inf || feof(inf)) - { - retVal = -1; - } - else - { - retVal = fgetc(inf); - } - break; - } - - case URI::SCHEME_DATA: - { - if (dataPos >= dataLen) - { - retVal = -1; - } - else - { - retVal = data[dataPos++]; - } - break; - } - }//switch - - return retVal; -} - - - - - - -/** - * - */ -UriReader::UriReader(const URI &uri) throw (StreamException) -{ - inputStream = new UriInputStream(uri); -} - -/** - * - */ -UriReader::~UriReader() throw (StreamException) -{ - delete inputStream; -} - -/** - * - */ -int UriReader::available() throw(StreamException) -{ - return inputStream->available(); -} - -/** - * - */ -void UriReader::close() throw(StreamException) -{ - inputStream->close(); -} - -/** - * - */ -gunichar UriReader::get() throw(StreamException) -{ - //int ch = (int)inputStream->get(); - return inputStream->get();//ch; -} - - -//######################################################################### -//# U R I O U T P U T S T R E A M / W R I T E R -//######################################################################### - -/** - * - */ -UriOutputStream::UriOutputStream(const URI &destination) - throw (StreamException): closed(false), - ownsFile(true), - outf(NULL), - uri((URI &)destination) -{ - init(); -} - - -/** - * - */ -void UriOutputStream::init() throw(StreamException) -{ - //get information from uri - scheme = uri.getScheme(); - - //printf("out schemestr:'%s' scheme:'%d'\n", schemestr, scheme); - char *cpath = NULL; - - switch (scheme) - { - - case URI::SCHEME_FILE: - { - cpath = (char *) uri.getNativePath().c_str(); - //printf("out path:'%s'\n", cpath); - outf = fopen(cpath, "wb"); - if (!outf) - { - DOMString err = "UriOutputStream cannot open file "; - err += cpath; - throw StreamException(err); - } - break; - } - - case URI::SCHEME_DATA: - { - data = "data:"; - break; - } - - }//switch -} - -/** - * - */ -UriOutputStream::~UriOutputStream() throw(StreamException) -{ - close(); -} - -/** - * Closes this output stream and releases any system resources - * associated with this stream. - */ -void UriOutputStream::close() throw(StreamException) -{ - if (closed) - return; - - switch (scheme) - { - - case URI::SCHEME_FILE: - { - if (!outf) - return; - fflush(outf); - if ( ownsFile ) - fclose(outf); - outf=NULL; - break; - } - - case URI::SCHEME_DATA: - { - uri = URI(data); - break; - } - - }//switch - - closed = true; -} - - -/** - * Flushes this output stream and forces any buffered output - * bytes to be written out. - */ -void UriOutputStream::flush() throw(StreamException) -{ - if (closed) - return; - - switch (scheme) - { - - case URI::SCHEME_FILE: - { - if (!outf) - return; - fflush(outf); - break; - } - - case URI::SCHEME_DATA: - { - //nothing - break; - } - - }//switch - -} - -/** - * Writes the specified byte to this output stream. - */ -int UriOutputStream::put(gunichar ch) throw(StreamException) -{ - if (closed) - return -1; - - switch (scheme) - { - - case URI::SCHEME_FILE: - { - if (!outf) - return -1; - unsigned char uch = (unsigned char)(ch & 0xff); - fputc(uch, outf); - //fwrite(uch, 1, 1, outf); - break; - } - - case URI::SCHEME_DATA: - { - data.push_back(ch); - break; - } - - }//switch - return 1; -} - - - - - -/** - * - */ -UriWriter::UriWriter(const URI &uri) - throw (StreamException) -{ - outputStream = new UriOutputStream(uri); -} - -/** - * - */ -UriWriter::~UriWriter() throw (StreamException) -{ - delete outputStream; -} - -/** - * - */ -void UriWriter::close() throw(StreamException) -{ - outputStream->close(); -} - -/** - * - */ -void UriWriter::flush() throw(StreamException) -{ - outputStream->flush(); -} - -/** - * - */ -int UriWriter::put(gunichar ch) throw(StreamException) -{ - if (outputStream->put(ch) < 0) - return -1; - return 1; -} - - - - - -} //namespace io -} //namespace dom -} //namespace w3c -} //namespace org - - -//######################################################################### -//# E N D O F F I L E -//######################################################################### diff --git a/src/dom/io/uristream.h b/src/dom/io/uristream.h deleted file mode 100644 index 51227acc9..000000000 --- a/src/dom/io/uristream.h +++ /dev/null @@ -1,207 +0,0 @@ -#ifndef SEEN_URISTREAM_H -#define SEEN_URISTREAM_H - -/** - * Phoebe DOM Implementation. - * - * This is a C++ approximation of the W3C DOM model, which follows - * fairly closely the specifications in the various .idl files, copies of - * which are provided for reference. Most important is this one: - * - * http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/idl-definitions.html - */ -/* - * Authors: - * Bob Jamison - * - * Copyright (C) 2005-2008 Bob Jamison - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - */ - -/** - * This should be the only way that we provide sources/sinks - * to any input/output stream. - * - */ - - -#include "../uri.h" -#include "domstream.h" - - -namespace org -{ -namespace w3c -{ -namespace dom -{ -namespace io -{ - - -//######################################################################### -//# U R I I N P U T S T R E A M / R E A D E R -//######################################################################### - -/** - * This class is for receiving a stream of data from a resource - * defined in a URI - */ -class UriInputStream : public InputStream -{ - -public: - - UriInputStream(const URI &source) throw(StreamException); - - virtual ~UriInputStream() throw(StreamException); - - virtual int available() throw(StreamException); - - virtual void close() throw(StreamException); - - virtual int get() throw(StreamException); - -private: - - void init() throw(StreamException);//common code called by constructor - - bool closed; - - FILE *inf; //for file: uris - DOMString data; //for data: uris - int dataPos; // current read position in data field - int dataLen; // length of data buffer - - URI uri; - - int scheme; -}; // class UriInputStream - - - - -/** - * This class is for receiving a stream of formatted data from a resource - * defined in a URI - */ -class UriReader : public Reader -{ - -public: - - UriReader(const URI &source) throw(StreamException); - - virtual ~UriReader() throw(StreamException); - - virtual int available() throw(StreamException); - - virtual void close() throw(StreamException); - - virtual gunichar get() throw(StreamException); - -private: - - UriInputStream *inputStream; - -}; // class UriReader - - - -//######################################################################### -//# U R I O U T P U T S T R E A M / W R I T E R -//######################################################################### - -/** - * This class is for sending a stream to a destination resource - * defined in a URI - * - */ -class UriOutputStream : public OutputStream -{ - -public: - - UriOutputStream(const URI &destination) throw(StreamException); - - virtual ~UriOutputStream() throw(StreamException); - - virtual void close() throw(StreamException); - - virtual void flush() throw(StreamException); - - virtual int put(gunichar ch) throw(StreamException); - -private: - - void init() throw(StreamException); //common code called by constructor - - bool closed; - bool ownsFile; - - FILE *outf; //for file: uris - DOMString data; //for data: uris - - URI uri; - - int scheme; -}; // class UriOutputStream - - - - - -/** - * This class is for sending a stream of formatted data to a resource - * defined in a URI - */ -class UriWriter : public Writer -{ - -public: - - UriWriter(const URI &source) throw(StreamException); - - virtual ~UriWriter() throw(StreamException); - - virtual void close() throw(StreamException); - - virtual void flush() throw(StreamException); - - virtual int put(gunichar ch) throw(StreamException); - -private: - - UriOutputStream *outputStream; - -}; // class UriReader - - - - - - -} //namespace io -} //namespace dom -} //namespace w3c -} //namespace org - -/*######################################################################### -## E N D O F F I L E -#########################################################################*/ - - -#endif // SEEN_URISTREAM_H diff --git a/src/extension/internal/odf.cpp b/src/extension/internal/odf.cpp index 47671a8d2..4c27925ae 100644 --- a/src/extension/internal/odf.cpp +++ b/src/extension/internal/odf.cpp @@ -80,16 +80,15 @@ //# DOM-specific includes #include "dom/dom.h" #include "dom/util/ziptool.h" -#include "dom/io/domstream.h" -#include "dom/io/bufferstream.h" -#include "dom/io/stringstream.h" +//#include "dom/io/domstream.h" #include "inkscape-version.h" #include "document.h" #include "extension/extension.h" - +#include "io/inkscapestream.h" +#include "io/bufferstream.h" namespace Inkscape { @@ -97,15 +96,12 @@ namespace Extension { namespace Internal { - - - //# Shorthand notation typedef org::w3c::dom::DOMString DOMString; -typedef org::w3c::dom::XMLCh XMLCh; -typedef org::w3c::dom::io::OutputStreamWriter OutputStreamWriter; -typedef org::w3c::dom::io::BufferOutputStream BufferOutputStream; -typedef org::w3c::dom::io::StringOutputStream StringOutputStream; +typedef Inkscape::IO::BufferOutputStream BufferOutputStream; +typedef Inkscape::IO::OutputStreamWriter OutputStreamWriter; +typedef Inkscape::IO::StringOutputStream StringOutputStream; + //######################################################################## //# C L A S S SingularValueDecomposition diff --git a/src/extension/internal/odf.h b/src/extension/internal/odf.h index 6b8883134..219a99a4f 100644 --- a/src/extension/internal/odf.h +++ b/src/extension/internal/odf.h @@ -24,7 +24,7 @@ #define EXTENSION_INTERNAL_ODG_OUT_H #include <dom/dom.h> -#include <dom/io/stringstream.h> +#include <io/stringstream.h> #include <dom/uri.h> #include <glibmm.h> @@ -37,7 +37,7 @@ #include <map> #include <dom/util/ziptool.h> -#include <dom/io/domstream.h> +//#include <io/domstream.h> #include "sp-item.h" namespace Inkscape @@ -48,8 +48,7 @@ namespace Internal { typedef org::w3c::dom::URI URI; -typedef org::w3c::dom::io::Writer Writer; - +typedef Inkscape::IO::Writer Writer; class StyleInfo { 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 |
