diff options
| author | Kris De Gussem <kris.degussem@gmail.com> | 2013-03-03 09:18:37 +0000 |
|---|---|---|
| committer | Kris <Kris.De.Gussem@hotmail.com> | 2013-03-03 09:18:37 +0000 |
| commit | 1279e676eccb0b3786d21fd390e4965f78a003c1 (patch) | |
| tree | 7caebee8350e7ddced1dfdccb1b34d38a7d47b8c /src/io | |
| parent | Fix autotools deprecation warnings (diff) | |
| download | inkscape-1279e676eccb0b3786d21fd390e4965f78a003c1.tar.gz inkscape-1279e676eccb0b3786d21fd390e4965f78a003c1.zip | |
Preparation to merge /dom/io and /io code (bug #1120585 )
(bzr r12168)
Diffstat (limited to 'src/io')
| -rw-r--r-- | src/io/base64stream.cpp | 5 | ||||
| -rw-r--r-- | src/io/base64stream.h | 2 | ||||
| -rw-r--r-- | src/io/gzipstream.cpp | 6 | ||||
| -rw-r--r-- | src/io/gzipstream.h | 2 | ||||
| -rw-r--r-- | src/io/inkscapestream.cpp | 42 | ||||
| -rw-r--r-- | src/io/inkscapestream.h | 8 | ||||
| -rw-r--r-- | src/io/stringstream.cpp | 3 | ||||
| -rw-r--r-- | src/io/stringstream.h | 2 | ||||
| -rw-r--r-- | src/io/uristream.cpp | 8 | ||||
| -rw-r--r-- | src/io/uristream.h | 2 | ||||
| -rw-r--r-- | src/io/xsltstream.cpp | 3 | ||||
| -rw-r--r-- | src/io/xsltstream.h | 2 |
12 files changed, 26 insertions, 59 deletions
diff --git a/src/io/base64stream.cpp b/src/io/base64stream.cpp index 42a6ba1e4..28c819347 100644 --- a/src/io/base64stream.cpp +++ b/src/io/base64stream.cpp @@ -290,12 +290,12 @@ void Base64OutputStream::putCh(int ch) /** * Writes the specified byte to this output stream. */ -void Base64OutputStream::put(gunichar ch) +int Base64OutputStream::put(gunichar ch) { if (closed) { //probably throw an exception here - return; + return -1; } outBuf <<= 8; @@ -322,6 +322,7 @@ void Base64OutputStream::put(gunichar ch) bitCount = 0; outBuf = 0L; } + return 1; } diff --git a/src/io/base64stream.h b/src/io/base64stream.h index 836939130..4bc99acac 100644 --- a/src/io/base64stream.h +++ b/src/io/base64stream.h @@ -88,7 +88,7 @@ public: virtual void flush(); - virtual void put(gunichar ch); + virtual int put(gunichar ch); /** * Sets the maximum line length for base64 output. If diff --git a/src/io/gzipstream.cpp b/src/io/gzipstream.cpp index 071179b48..8db7155db 100644 --- a/src/io/gzipstream.cpp +++ b/src/io/gzipstream.cpp @@ -433,19 +433,19 @@ void GzipOutputStream::flush() /** * Writes the specified byte to this output stream. */ -void GzipOutputStream::put(gunichar ch) +int GzipOutputStream::put(gunichar ch) { if (closed) { //probably throw an exception here - return; + return -1; } //Add char to buffer inputBuf.push_back(ch); totalIn++; - + return 1; } diff --git a/src/io/gzipstream.h b/src/io/gzipstream.h index 5af57b4c5..390ec1225 100644 --- a/src/io/gzipstream.h +++ b/src/io/gzipstream.h @@ -98,7 +98,7 @@ public: virtual void flush(); - virtual void put(gunichar ch); + virtual int put(gunichar ch); private: diff --git a/src/io/inkscapestream.cpp b/src/io/inkscapestream.cpp index 3270127d6..4c7fa4d49 100644 --- a/src/io/inkscapestream.cpp +++ b/src/io/inkscapestream.cpp @@ -125,11 +125,12 @@ void BasicOutputStream::flush() /** * Writes the specified byte to this output stream. */ -void BasicOutputStream::put(gunichar ch) +int BasicOutputStream::put(gunichar ch) { if (closed) - return; + return -1; destination.put(ch); + return 1; } @@ -137,8 +138,6 @@ void BasicOutputStream::put(gunichar ch) //######################################################################### //# B A S I C R E A D E R //######################################################################### - - /** * */ @@ -183,10 +182,6 @@ gunichar BasicReader::get() } - - - - /** * Reads a line of data from the reader. */ @@ -255,13 +250,6 @@ static bool getDouble(Glib::ustring &str, double *val) - - - - -/** - * - */ const Reader &BasicReader::readBool (bool& val ) { Glib::ustring buf = readWord(); @@ -272,9 +260,6 @@ const Reader &BasicReader::readBool (bool& val ) return *this; } -/** - * - */ const Reader &BasicReader::readShort (short& val ) { Glib::ustring buf = readWord(); @@ -284,9 +269,6 @@ const Reader &BasicReader::readShort (short& val ) return *this; } -/** - * - */ const Reader &BasicReader::readUnsignedShort (unsigned short& val ) { Glib::ustring buf = readWord(); @@ -296,9 +278,6 @@ const Reader &BasicReader::readUnsignedShort (unsigned short& val ) return *this; } -/** - * - */ const Reader &BasicReader::readInt (int& val ) { Glib::ustring buf = readWord(); @@ -308,9 +287,6 @@ const Reader &BasicReader::readInt (int& val ) return *this; } -/** - * - */ const Reader &BasicReader::readUnsignedInt (unsigned int& val ) { Glib::ustring buf = readWord(); @@ -320,9 +296,6 @@ const Reader &BasicReader::readUnsignedInt (unsigned int& val ) return *this; } -/** - * - */ const Reader &BasicReader::readLong (long& val ) { Glib::ustring buf = readWord(); @@ -332,9 +305,6 @@ const Reader &BasicReader::readLong (long& val ) return *this; } -/** - * - */ const Reader &BasicReader::readUnsignedLong (unsigned long& val ) { Glib::ustring buf = readWord(); @@ -344,9 +314,6 @@ const Reader &BasicReader::readUnsignedLong (unsigned long& val ) return *this; } -/** - * - */ const Reader &BasicReader::readFloat (float& val ) { Glib::ustring buf = readWord(); @@ -356,9 +323,6 @@ const Reader &BasicReader::readFloat (float& val ) return *this; } -/** - * - */ const Reader &BasicReader::readDouble (double& val ) { Glib::ustring buf = readWord(); diff --git a/src/io/inkscapestream.h b/src/io/inkscapestream.h index a9854ae6d..d19dbbe95 100644 --- a/src/io/inkscapestream.h +++ b/src/io/inkscapestream.h @@ -189,7 +189,7 @@ public: /** * Send one byte to the destination stream. */ - virtual void put(gunichar ch) = 0; + virtual int put(gunichar ch) = 0; }; // class OutputStream @@ -212,7 +212,7 @@ public: virtual void flush(); - virtual void put(gunichar ch); + virtual int put(gunichar ch); protected: @@ -238,8 +238,8 @@ public: void flush() { } - void put(gunichar ch) - { putchar(ch); } + int put(gunichar ch) + {return putchar(ch); } }; diff --git a/src/io/stringstream.cpp b/src/io/stringstream.cpp index f204a99d5..5a76e24a3 100644 --- a/src/io/stringstream.cpp +++ b/src/io/stringstream.cpp @@ -112,9 +112,10 @@ void StringOutputStream::flush() /** * Writes the specified byte to this output stream. */ -void StringOutputStream::put(gunichar ch) +int StringOutputStream::put(gunichar ch) { buffer.push_back(ch); + return 1; } diff --git a/src/io/stringstream.h b/src/io/stringstream.h index a78935599..939a87455 100644 --- a/src/io/stringstream.h +++ b/src/io/stringstream.h @@ -67,7 +67,7 @@ public: virtual void flush(); - virtual void put(gunichar ch); + virtual int put(gunichar ch); virtual Glib::ustring &getString() { return buffer; } diff --git a/src/io/uristream.cpp b/src/io/uristream.cpp index 8d7fd9b38..37c13ada0 100644 --- a/src/io/uristream.cpp +++ b/src/io/uristream.cpp @@ -402,17 +402,17 @@ void UriOutputStream::flush() throw(StreamException) /** * Writes the specified byte to this output stream. */ -void UriOutputStream::put(gunichar ch) throw(StreamException) +int UriOutputStream::put(gunichar ch) throw(StreamException) { if (closed) - return; + return -1; unsigned char uch; switch (scheme) { case SCHEME_FILE: if (!outf) - return; + return -1; uch = (unsigned char)(ch & 0xff); if (fputc(uch, outf) == EOF) { Glib::ustring err = "ERROR writing to file "; @@ -425,7 +425,7 @@ void UriOutputStream::put(gunichar ch) throw(StreamException) break; }//switch - + return 1; } diff --git a/src/io/uristream.h b/src/io/uristream.h index e519335e8..3080519de 100644 --- a/src/io/uristream.h +++ b/src/io/uristream.h @@ -115,7 +115,7 @@ public: virtual void flush() throw(StreamException); - virtual void put(gunichar ch) throw(StreamException); + virtual int put(gunichar ch) throw(StreamException); private: diff --git a/src/io/xsltstream.cpp b/src/io/xsltstream.cpp index 1c260c0b3..7a6632233 100644 --- a/src/io/xsltstream.cpp +++ b/src/io/xsltstream.cpp @@ -230,9 +230,10 @@ void XsltOutputStream::flush() throw (StreamException) /** * Writes the specified byte to this output stream. */ -void XsltOutputStream::put(gunichar ch) throw (StreamException) +int XsltOutputStream::put(gunichar ch) throw (StreamException) { outbuf.push_back(ch); + return 1; } diff --git a/src/io/xsltstream.h b/src/io/xsltstream.h index 9b8e19215..31ee89e10 100644 --- a/src/io/xsltstream.h +++ b/src/io/xsltstream.h @@ -120,7 +120,7 @@ public: virtual void flush() throw (StreamException); - virtual void put(gunichar ch) throw (StreamException); + virtual int put(gunichar ch) throw (StreamException); private: |
