summaryrefslogtreecommitdiffstats
path: root/src/dom/io
diff options
context:
space:
mode:
authorBob Jamison <ishmalius@gmail.com>2006-05-21 21:51:51 +0000
committerishmal <ishmal@users.sourceforge.net>2006-05-21 21:51:51 +0000
commit12c02a7a645e0bc0a2acdddfe3fdb9911b8c6a61 (patch)
tree2ab648845475b57afc3837bf1883b8785861d95e /src/dom/io
parentCheck if we are already SSL before trying STARTTLS (diff)
downloadinkscape-12c02a7a645e0bc0a2acdddfe3fdb9911b8c6a61.tar.gz
inkscape-12c02a7a645e0bc0a2acdddfe3fdb9911b8c6a61.zip
Unix-ify the sources
(bzr r928)
Diffstat (limited to 'src/dom/io')
-rw-r--r--src/dom/io/base64stream.cpp678
-rw-r--r--src/dom/io/base64stream.h292
-rw-r--r--src/dom/io/gzipstream.cpp490
-rw-r--r--src/dom/io/gzipstream.h250
-rw-r--r--src/dom/io/httpclient.cpp334
-rw-r--r--src/dom/io/httpclient.h230
6 files changed, 1137 insertions, 1137 deletions
diff --git a/src/dom/io/base64stream.cpp b/src/dom/io/base64stream.cpp
index 42df842c4..f71532e8b 100644
--- a/src/dom/io/base64stream.cpp
+++ b/src/dom/io/base64stream.cpp
@@ -1,339 +1,339 @@
-/**
- * Phoebe DOM Implementation.
- *
- * Base64-enabled input and output streams
- *
- * This class allows easy encoding and decoding
- * of Base64 data with a stream interface, hiding
- * the implementation from the user.
- *
- * 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 "base64stream.h"
-
-
-namespace org
-{
-namespace w3c
-{
-namespace dom
-{
-namespace io
-{
-
-
-//#########################################################################
-//# B A S E 6 4 I N P U T S T R E A M
-//#########################################################################
-
-static int base64decode[] =
-{
-/*00*/ -1, -1, -1, -1, -1, -1, -1, -1,
-/*08*/ -1, -1, -1, -1, -1, -1, -1, -1,
-/*10*/ -1, -1, -1, -1, -1, -1, -1, -1,
-/*18*/ -1, -1, -1, -1, -1, -1, -1, -1,
-/*20*/ -1, -1, -1, -1, -1, -1, -1, -1,
-/*28*/ -1, -1, -1, 62, -1, -1, -1, 63,
-/*30*/ 52, 53, 54, 55, 56, 57, 58, 59,
-/*38*/ 60, 61, -1, -1, -1, -1, -1, -1,
-/*40*/ -1, 0, 1, 2, 3, 4, 5, 6,
-/*48*/ 7, 8, 9, 10, 11, 12, 13, 14,
-/*50*/ 15, 16, 17, 18, 19, 20, 21, 22,
-/*58*/ 23, 24, 25, -1, -1, -1, -1, -1,
-/*60*/ -1, 26, 27, 28, 29, 30, 31, 32,
-/*68*/ 33, 34, 35, 36, 37, 38, 39, 40,
-/*70*/ 41, 42, 43, 44, 45, 46, 47, 48,
-/*78*/ 49, 50, 51, -1, -1, -1, -1, -1
-};
-
-
-/**
- *
- */
-Base64InputStream::Base64InputStream(InputStream &sourceStream)
- : BasicInputStream(sourceStream)
-{
- outCount = 0;
- padCount = 0;
- closed = false;
- done = false;
-}
-
-/**
- *
- */
-Base64InputStream::~Base64InputStream()
-{
- 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 Base64InputStream::available()
-{
- if (closed )
- return 0;
- int len = source.available() * 2 / 3;
- return len;
-}
-
-
-/**
- * Closes this input stream and releases any system resources
- * associated with the stream.
- */
-void Base64InputStream::close()
-{
- if (closed)
- return;
- source.close();
- closed = true;
-}
-
-/**
- * Reads the next byte of data from the input stream. -1 if EOF
- */
-int Base64InputStream::get()
-{
- if (closed)
- return -1;
-
- if (outCount - padCount > 0)
- {
- return outBytes[3-(outCount--)];
- }
-
- if (done)
- return -1;
-
- int inBytes[4];
- int inCount = 0;
- while (inCount < 4)
- {
- int ch = source.get();
- if (ch < 0)
- {
- while (inCount < 4) //pad if needed
- {
- inBytes[inCount++] = 0;
- padCount++;
- }
- done = true;
- break;
- }
- if (isspace(ch)) //ascii whitespace
- {
- //nothing
- }
- else if (ch == '=') //padding
- {
- inBytes[inCount++] = 0;
- padCount++;
- }
- else
- {
- int byteVal = base64decode[ch & 0x7f];
- //printf("char:%c %d\n", ch, byteVal);
- if (byteVal < 0)
- {
- //Bad lookup value
- }
- inBytes[inCount++] = byteVal;
- }
- }
-
- outBytes[0] = ((inBytes[0]<<2) & 0xfc) | ((inBytes[1]>>4) & 0x03);
- outBytes[1] = ((inBytes[1]<<4) & 0xf0) | ((inBytes[2]>>2) & 0x0f);
- outBytes[2] = ((inBytes[2]<<6) & 0xc0) | ((inBytes[3] ) & 0x3f);
-
- outCount = 3;
-
- //try again
- if (outCount - padCount > 0)
- {
- return outBytes[3-(outCount--)];
- }
-
- return -1;
-
-}
-
-
-//#########################################################################
-//# B A S E 6 4 O U T P U T S T R E A M
-//#########################################################################
-
-static char *base64encode =
- "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
-
-/**
- *
- */
-Base64OutputStream::Base64OutputStream(OutputStream &destinationStream)
- : BasicOutputStream(destinationStream)
-{
- column = 0;
- columnWidth = 72;
- outBuf = 0L;
- bitCount = 0;
-}
-
-/**
- *
- */
-Base64OutputStream::~Base64OutputStream()
-{
- close();
-}
-
-/**
- * Closes this output stream and releases any system resources
- * associated with this stream.
- */
-void Base64OutputStream::close()
-{
- if (closed)
- return;
-
- //get any last bytes (1 or 2) out of the buffer
- if (bitCount == 16)
- {
- outBuf <<= 2; //pad to make 18 bits
-
- int indx = (int)((outBuf & 0x0003f000L) >> 12);
- int obyte = (int)base64encode[indx & 63];
- putCh(obyte);
-
- indx = (int)((outBuf & 0x00000fc0L) >> 6);
- obyte = (int)base64encode[indx & 63];
- putCh(obyte);
-
- indx = (int)((outBuf & 0x0000003fL) );
- obyte = (int)base64encode[indx & 63];
- putCh(obyte);
-
- putCh('=');
- }
- else if (bitCount == 8)
- {
- outBuf <<= 4; //pad to make 12 bits
-
- int indx = (int)((outBuf & 0x00000fc0L) >> 6);
- int obyte = (int)base64encode[indx & 63];
- putCh(obyte);
-
- indx = (int)((outBuf & 0x0000003fL) );
- obyte = (int)base64encode[indx & 63];
- putCh(obyte);
-
- putCh('=');
- putCh('=');
- }
-
- if (columnWidth > 0) //if <=0, no newlines
- destination.put('\n');
-
- destination.close();
- closed = true;
-}
-
-/**
- * Flushes this output stream and forces any buffered output
- * bytes to be written out.
- */
-void Base64OutputStream::flush()
-{
- if (closed)
- return;
- //dont flush here. do it on close()
- destination.flush();
-}
-
-/**
- * Private. Put a char to the output stream, checking for line length
- */
-void Base64OutputStream::putCh(int ch)
-{
- destination.put(ch);
- column++;
- if (columnWidth > 0 && column >= columnWidth)
- {
- destination.put('\n');
- column = 0;
- }
-}
-
-
-/**
- * Writes the specified byte to this output stream.
- */
-void Base64OutputStream::put(XMLCh ch)
-{
- if (closed)
- {
- //probably throw an exception here
- return;
- }
-
- outBuf <<= 8;
- outBuf |= (ch & 0xff);
- bitCount += 8;
- if (bitCount >= 24)
- {
- int indx = (int)((outBuf & 0x00fc0000L) >> 18);
- int obyte = (int)base64encode[indx & 63];
- putCh(obyte);
-
- indx = (int)((outBuf & 0x0003f000L) >> 12);
- obyte = (int)base64encode[indx & 63];
- putCh(obyte);
-
- indx = (int)((outBuf & 0x00000fc0L) >> 6);
- obyte = (int)base64encode[indx & 63];
- putCh(obyte);
-
- indx = (int)((outBuf & 0x0000003fL) );
- obyte = (int)base64encode[indx & 63];
- putCh(obyte);
-
- bitCount = 0;
- outBuf = 0L;
- }
-}
-
-
-
-} //namespace io
-} //namespace dom
-} //namespace w3c
-} //namespace org
-
-
-//#########################################################################
-//# E N D O F F I L E
-//#########################################################################
+/**
+ * Phoebe DOM Implementation.
+ *
+ * Base64-enabled input and output streams
+ *
+ * This class allows easy encoding and decoding
+ * of Base64 data with a stream interface, hiding
+ * the implementation from the user.
+ *
+ * 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 "base64stream.h"
+
+
+namespace org
+{
+namespace w3c
+{
+namespace dom
+{
+namespace io
+{
+
+
+//#########################################################################
+//# B A S E 6 4 I N P U T S T R E A M
+//#########################################################################
+
+static int base64decode[] =
+{
+/*00*/ -1, -1, -1, -1, -1, -1, -1, -1,
+/*08*/ -1, -1, -1, -1, -1, -1, -1, -1,
+/*10*/ -1, -1, -1, -1, -1, -1, -1, -1,
+/*18*/ -1, -1, -1, -1, -1, -1, -1, -1,
+/*20*/ -1, -1, -1, -1, -1, -1, -1, -1,
+/*28*/ -1, -1, -1, 62, -1, -1, -1, 63,
+/*30*/ 52, 53, 54, 55, 56, 57, 58, 59,
+/*38*/ 60, 61, -1, -1, -1, -1, -1, -1,
+/*40*/ -1, 0, 1, 2, 3, 4, 5, 6,
+/*48*/ 7, 8, 9, 10, 11, 12, 13, 14,
+/*50*/ 15, 16, 17, 18, 19, 20, 21, 22,
+/*58*/ 23, 24, 25, -1, -1, -1, -1, -1,
+/*60*/ -1, 26, 27, 28, 29, 30, 31, 32,
+/*68*/ 33, 34, 35, 36, 37, 38, 39, 40,
+/*70*/ 41, 42, 43, 44, 45, 46, 47, 48,
+/*78*/ 49, 50, 51, -1, -1, -1, -1, -1
+};
+
+
+/**
+ *
+ */
+Base64InputStream::Base64InputStream(InputStream &sourceStream)
+ : BasicInputStream(sourceStream)
+{
+ outCount = 0;
+ padCount = 0;
+ closed = false;
+ done = false;
+}
+
+/**
+ *
+ */
+Base64InputStream::~Base64InputStream()
+{
+ 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 Base64InputStream::available()
+{
+ if (closed )
+ return 0;
+ int len = source.available() * 2 / 3;
+ return len;
+}
+
+
+/**
+ * Closes this input stream and releases any system resources
+ * associated with the stream.
+ */
+void Base64InputStream::close()
+{
+ if (closed)
+ return;
+ source.close();
+ closed = true;
+}
+
+/**
+ * Reads the next byte of data from the input stream. -1 if EOF
+ */
+int Base64InputStream::get()
+{
+ if (closed)
+ return -1;
+
+ if (outCount - padCount > 0)
+ {
+ return outBytes[3-(outCount--)];
+ }
+
+ if (done)
+ return -1;
+
+ int inBytes[4];
+ int inCount = 0;
+ while (inCount < 4)
+ {
+ int ch = source.get();
+ if (ch < 0)
+ {
+ while (inCount < 4) //pad if needed
+ {
+ inBytes[inCount++] = 0;
+ padCount++;
+ }
+ done = true;
+ break;
+ }
+ if (isspace(ch)) //ascii whitespace
+ {
+ //nothing
+ }
+ else if (ch == '=') //padding
+ {
+ inBytes[inCount++] = 0;
+ padCount++;
+ }
+ else
+ {
+ int byteVal = base64decode[ch & 0x7f];
+ //printf("char:%c %d\n", ch, byteVal);
+ if (byteVal < 0)
+ {
+ //Bad lookup value
+ }
+ inBytes[inCount++] = byteVal;
+ }
+ }
+
+ outBytes[0] = ((inBytes[0]<<2) & 0xfc) | ((inBytes[1]>>4) & 0x03);
+ outBytes[1] = ((inBytes[1]<<4) & 0xf0) | ((inBytes[2]>>2) & 0x0f);
+ outBytes[2] = ((inBytes[2]<<6) & 0xc0) | ((inBytes[3] ) & 0x3f);
+
+ outCount = 3;
+
+ //try again
+ if (outCount - padCount > 0)
+ {
+ return outBytes[3-(outCount--)];
+ }
+
+ return -1;
+
+}
+
+
+//#########################################################################
+//# B A S E 6 4 O U T P U T S T R E A M
+//#########################################################################
+
+static char *base64encode =
+ "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
+
+/**
+ *
+ */
+Base64OutputStream::Base64OutputStream(OutputStream &destinationStream)
+ : BasicOutputStream(destinationStream)
+{
+ column = 0;
+ columnWidth = 72;
+ outBuf = 0L;
+ bitCount = 0;
+}
+
+/**
+ *
+ */
+Base64OutputStream::~Base64OutputStream()
+{
+ close();
+}
+
+/**
+ * Closes this output stream and releases any system resources
+ * associated with this stream.
+ */
+void Base64OutputStream::close()
+{
+ if (closed)
+ return;
+
+ //get any last bytes (1 or 2) out of the buffer
+ if (bitCount == 16)
+ {
+ outBuf <<= 2; //pad to make 18 bits
+
+ int indx = (int)((outBuf & 0x0003f000L) >> 12);
+ int obyte = (int)base64encode[indx & 63];
+ putCh(obyte);
+
+ indx = (int)((outBuf & 0x00000fc0L) >> 6);
+ obyte = (int)base64encode[indx & 63];
+ putCh(obyte);
+
+ indx = (int)((outBuf & 0x0000003fL) );
+ obyte = (int)base64encode[indx & 63];
+ putCh(obyte);
+
+ putCh('=');
+ }
+ else if (bitCount == 8)
+ {
+ outBuf <<= 4; //pad to make 12 bits
+
+ int indx = (int)((outBuf & 0x00000fc0L) >> 6);
+ int obyte = (int)base64encode[indx & 63];
+ putCh(obyte);
+
+ indx = (int)((outBuf & 0x0000003fL) );
+ obyte = (int)base64encode[indx & 63];
+ putCh(obyte);
+
+ putCh('=');
+ putCh('=');
+ }
+
+ if (columnWidth > 0) //if <=0, no newlines
+ destination.put('\n');
+
+ destination.close();
+ closed = true;
+}
+
+/**
+ * Flushes this output stream and forces any buffered output
+ * bytes to be written out.
+ */
+void Base64OutputStream::flush()
+{
+ if (closed)
+ return;
+ //dont flush here. do it on close()
+ destination.flush();
+}
+
+/**
+ * Private. Put a char to the output stream, checking for line length
+ */
+void Base64OutputStream::putCh(int ch)
+{
+ destination.put(ch);
+ column++;
+ if (columnWidth > 0 && column >= columnWidth)
+ {
+ destination.put('\n');
+ column = 0;
+ }
+}
+
+
+/**
+ * Writes the specified byte to this output stream.
+ */
+void Base64OutputStream::put(XMLCh ch)
+{
+ if (closed)
+ {
+ //probably throw an exception here
+ return;
+ }
+
+ outBuf <<= 8;
+ outBuf |= (ch & 0xff);
+ bitCount += 8;
+ if (bitCount >= 24)
+ {
+ int indx = (int)((outBuf & 0x00fc0000L) >> 18);
+ int obyte = (int)base64encode[indx & 63];
+ putCh(obyte);
+
+ indx = (int)((outBuf & 0x0003f000L) >> 12);
+ obyte = (int)base64encode[indx & 63];
+ putCh(obyte);
+
+ indx = (int)((outBuf & 0x00000fc0L) >> 6);
+ obyte = (int)base64encode[indx & 63];
+ putCh(obyte);
+
+ indx = (int)((outBuf & 0x0000003fL) );
+ obyte = (int)base64encode[indx & 63];
+ putCh(obyte);
+
+ bitCount = 0;
+ outBuf = 0L;
+ }
+}
+
+
+
+} //namespace io
+} //namespace dom
+} //namespace w3c
+} //namespace org
+
+
+//#########################################################################
+//# E N D O F F I L E
+//#########################################################################
diff --git a/src/dom/io/base64stream.h b/src/dom/io/base64stream.h
index ed5159b3c..23ec1ce07 100644
--- a/src/dom/io/base64stream.h
+++ b/src/dom/io/base64stream.h
@@ -1,146 +1,146 @@
-#ifndef __DOM_IO_BASE64STREAM_H__
-#define __DOM_IO_BASE64STREAM_H__
-
-/**
- * Phoebe DOM Implementation.
- *
- * Base64-enabled input and output streams
- *
- * This class allows easy encoding and decoding
- * of Base64 data with a stream interface, hiding
- * the implementation from the user.
- *
- * 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
-{
-
-
-
-//#########################################################################
-//# B A S E 6 4 I N P U T S T R E A M
-//#########################################################################
-
-/**
- * This class is for decoding a Base-64 encoded InputStream source
- *
- */
-class Base64InputStream : public BasicInputStream
-{
-
-public:
-
- Base64InputStream(InputStream &sourceStream);
-
- virtual ~Base64InputStream();
-
- virtual int available();
-
- virtual void close();
-
- virtual int get();
-
-private:
-
- int outBytes[3];
-
- int outCount;
-
- int padCount;
-
- bool done;
-
-}; // class Base64InputStream
-
-
-
-
-//#########################################################################
-//# B A S E 6 4 O U T P U T S T R E A M
-//#########################################################################
-
-/**
- * This class is for Base-64 encoding data going to the
- * destination OutputStream
- *
- */
-class Base64OutputStream : public BasicOutputStream
-{
-
-public:
-
- Base64OutputStream(OutputStream &destinationStream);
-
- virtual ~Base64OutputStream();
-
- virtual void close();
-
- virtual void flush();
-
- virtual void put(XMLCh ch);
-
- /**
- * Sets the maximum line length for base64 output. If
- * set to <=0, then there will be no line breaks;
- */
- virtual void setColumnWidth(int val)
- { columnWidth = val; }
-
-private:
-
- void putCh(int ch);
-
- int column;
-
- int columnWidth;
-
- unsigned long outBuf;
-
- int bitCount;
-
-}; // class Base64OutputStream
-
-
-
-
-
-
-
-} //namespace io
-} //namespace dom
-} //namespace w3c
-} //namespace org
-
-
-#endif /* __INKSCAPE_IO_BASE64STREAM_H__ */
+#ifndef __DOM_IO_BASE64STREAM_H__
+#define __DOM_IO_BASE64STREAM_H__
+
+/**
+ * Phoebe DOM Implementation.
+ *
+ * Base64-enabled input and output streams
+ *
+ * This class allows easy encoding and decoding
+ * of Base64 data with a stream interface, hiding
+ * the implementation from the user.
+ *
+ * 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
+{
+
+
+
+//#########################################################################
+//# B A S E 6 4 I N P U T S T R E A M
+//#########################################################################
+
+/**
+ * This class is for decoding a Base-64 encoded InputStream source
+ *
+ */
+class Base64InputStream : public BasicInputStream
+{
+
+public:
+
+ Base64InputStream(InputStream &sourceStream);
+
+ virtual ~Base64InputStream();
+
+ virtual int available();
+
+ virtual void close();
+
+ virtual int get();
+
+private:
+
+ int outBytes[3];
+
+ int outCount;
+
+ int padCount;
+
+ bool done;
+
+}; // class Base64InputStream
+
+
+
+
+//#########################################################################
+//# B A S E 6 4 O U T P U T S T R E A M
+//#########################################################################
+
+/**
+ * This class is for Base-64 encoding data going to the
+ * destination OutputStream
+ *
+ */
+class Base64OutputStream : public BasicOutputStream
+{
+
+public:
+
+ Base64OutputStream(OutputStream &destinationStream);
+
+ virtual ~Base64OutputStream();
+
+ virtual void close();
+
+ virtual void flush();
+
+ virtual void put(XMLCh ch);
+
+ /**
+ * Sets the maximum line length for base64 output. If
+ * set to <=0, then there will be no line breaks;
+ */
+ virtual void setColumnWidth(int val)
+ { columnWidth = val; }
+
+private:
+
+ void putCh(int ch);
+
+ int column;
+
+ int columnWidth;
+
+ unsigned long outBuf;
+
+ int bitCount;
+
+}; // class Base64OutputStream
+
+
+
+
+
+
+
+} //namespace io
+} //namespace dom
+} //namespace w3c
+} //namespace org
+
+
+#endif /* __INKSCAPE_IO_BASE64STREAM_H__ */
diff --git a/src/dom/io/gzipstream.cpp b/src/dom/io/gzipstream.cpp
index 510101553..19369b6dc 100644
--- a/src/dom/io/gzipstream.cpp
+++ b/src/dom/io/gzipstream.cpp
@@ -1,245 +1,245 @@
-/**
- * Zlib-enabled input and output streams
- *
- * This is a thin wrapper of libz calls, in order
- * to provide a simple interface to our developers
- * for gzip input and output.
- *
- * 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 "gzipstream.h"
-
-#include "dom/util/ziptool.h"
-
-
-namespace org
-{
-namespace w3c
-{
-namespace dom
-{
-namespace io
-{
-
-
-//#########################################################################
-//# G Z I P I N P U T S T R E A M
-//#########################################################################
-
-/**
- *
- */
-GzipInputStream::GzipInputStream(InputStream &sourceStream)
- : BasicInputStream(sourceStream)
-{
- loaded = false;
- bufPos = 0;
-}
-
-/**
- *
- */
-GzipInputStream::~GzipInputStream()
-{
- 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 GzipInputStream::available()
-{
- if (closed)
- return 0;
- if (!loaded)
- if (!load())
- return 0;
- return (int) buffer.size();
-}
-
-
-/**
- * Closes this input stream and releases any system resources
- * associated with the stream.
- */
-void GzipInputStream::close()
-{
- if (closed)
- return;
-
- closed = true;
-}
-
-/**
- * Reads the next byte of data from the input stream. -1 if EOF
- */
-int GzipInputStream::get()
-{
- if (closed)
- return -1;
-
- if (!loaded)
- if (!load())
- return -1;
-
- if (bufPos >= buffer.size())
- return -1;
- int ch = (int) buffer[bufPos++];
-
- return ch;
-}
-
-/**
- * Processes input. Fills read buffer.
- */
-bool GzipInputStream::load()
-{
- if (closed)
- return false;
-
- if (loaded)
- return true;
-
- std::vector<unsigned char> compBuf;
- while (true)
- {
- int ch = source.get();
- if (ch < 0)
- break;
- compBuf.push_back(ch);
- }
- GzipFile gz;
- if (!gz.readBuffer(compBuf))
- {
- return -1;
- }
- buffer = gz.getData();
- bufPos = 0;
- loaded = true;
- return true;
-}
-
-
-
-
-
-
-//#########################################################################
-//# G Z I P O U T P U T S T R E A M
-//#########################################################################
-
-/**
- *
- */
-GzipOutputStream::GzipOutputStream(OutputStream &destinationStream)
- : BasicOutputStream(destinationStream)
-{
-
- closed = false;
-}
-
-/**
- *
- */
-GzipOutputStream::~GzipOutputStream()
-{
- close();
-}
-
-/**
- * Closes this output stream and releases any system resources
- * associated with this stream.
- */
-void GzipOutputStream::close()
-{
- if (closed)
- return;
-
- flush();
-
- closed = true;
-}
-
-/**
- * Flushes this output stream and forces any buffered output
- * bytes to be written out.
- */
-void GzipOutputStream::flush()
-{
- if (closed || buffer.size()<1)
- return;
-
- std::vector<unsigned char> compBuf;
- GzipFile gz;
-
- gz.writeBuffer(buffer);
-
- std::vector<unsigned char>::iterator iter;
- for (iter=compBuf.begin() ; iter!=compBuf.end() ; iter++)
- {
- int ch = (int) *iter;
- destination.put(ch);
- }
-
- buffer.clear();
-
- //printf("done\n");
-
-}
-
-
-
-/**
- * Writes the specified byte to this output stream.
- */
-void GzipOutputStream::put(XMLCh ch)
-{
- if (closed)
- {
- //probably throw an exception here
- return;
- }
-
- //Add char to buffer
- buffer.push_back(ch);
-
-}
-
-
-
-} // namespace io
-} // namespace dom
-} // namespace w3c
-} // namespace org
-
-
-
-
-//#########################################################################
-//# E N D O F F I L E
-//#########################################################################
-
-
-
+/**
+ * Zlib-enabled input and output streams
+ *
+ * This is a thin wrapper of libz calls, in order
+ * to provide a simple interface to our developers
+ * for gzip input and output.
+ *
+ * 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 "gzipstream.h"
+
+#include "dom/util/ziptool.h"
+
+
+namespace org
+{
+namespace w3c
+{
+namespace dom
+{
+namespace io
+{
+
+
+//#########################################################################
+//# G Z I P I N P U T S T R E A M
+//#########################################################################
+
+/**
+ *
+ */
+GzipInputStream::GzipInputStream(InputStream &sourceStream)
+ : BasicInputStream(sourceStream)
+{
+ loaded = false;
+ bufPos = 0;
+}
+
+/**
+ *
+ */
+GzipInputStream::~GzipInputStream()
+{
+ 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 GzipInputStream::available()
+{
+ if (closed)
+ return 0;
+ if (!loaded)
+ if (!load())
+ return 0;
+ return (int) buffer.size();
+}
+
+
+/**
+ * Closes this input stream and releases any system resources
+ * associated with the stream.
+ */
+void GzipInputStream::close()
+{
+ if (closed)
+ return;
+
+ closed = true;
+}
+
+/**
+ * Reads the next byte of data from the input stream. -1 if EOF
+ */
+int GzipInputStream::get()
+{
+ if (closed)
+ return -1;
+
+ if (!loaded)
+ if (!load())
+ return -1;
+
+ if (bufPos >= buffer.size())
+ return -1;
+ int ch = (int) buffer[bufPos++];
+
+ return ch;
+}
+
+/**
+ * Processes input. Fills read buffer.
+ */
+bool GzipInputStream::load()
+{
+ if (closed)
+ return false;
+
+ if (loaded)
+ return true;
+
+ std::vector<unsigned char> compBuf;
+ while (true)
+ {
+ int ch = source.get();
+ if (ch < 0)
+ break;
+ compBuf.push_back(ch);
+ }
+ GzipFile gz;
+ if (!gz.readBuffer(compBuf))
+ {
+ return -1;
+ }
+ buffer = gz.getData();
+ bufPos = 0;
+ loaded = true;
+ return true;
+}
+
+
+
+
+
+
+//#########################################################################
+//# G Z I P O U T P U T S T R E A M
+//#########################################################################
+
+/**
+ *
+ */
+GzipOutputStream::GzipOutputStream(OutputStream &destinationStream)
+ : BasicOutputStream(destinationStream)
+{
+
+ closed = false;
+}
+
+/**
+ *
+ */
+GzipOutputStream::~GzipOutputStream()
+{
+ close();
+}
+
+/**
+ * Closes this output stream and releases any system resources
+ * associated with this stream.
+ */
+void GzipOutputStream::close()
+{
+ if (closed)
+ return;
+
+ flush();
+
+ closed = true;
+}
+
+/**
+ * Flushes this output stream and forces any buffered output
+ * bytes to be written out.
+ */
+void GzipOutputStream::flush()
+{
+ if (closed || buffer.size()<1)
+ return;
+
+ std::vector<unsigned char> compBuf;
+ GzipFile gz;
+
+ gz.writeBuffer(buffer);
+
+ std::vector<unsigned char>::iterator iter;
+ for (iter=compBuf.begin() ; iter!=compBuf.end() ; iter++)
+ {
+ int ch = (int) *iter;
+ destination.put(ch);
+ }
+
+ buffer.clear();
+
+ //printf("done\n");
+
+}
+
+
+
+/**
+ * Writes the specified byte to this output stream.
+ */
+void GzipOutputStream::put(XMLCh ch)
+{
+ if (closed)
+ {
+ //probably throw an exception here
+ return;
+ }
+
+ //Add char to buffer
+ buffer.push_back(ch);
+
+}
+
+
+
+} // namespace io
+} // namespace dom
+} // namespace w3c
+} // namespace org
+
+
+
+
+//#########################################################################
+//# E N D O F F I L E
+//#########################################################################
+
+
+
diff --git a/src/dom/io/gzipstream.h b/src/dom/io/gzipstream.h
index 8fc26f0a2..6396772a5 100644
--- a/src/dom/io/gzipstream.h
+++ b/src/dom/io/gzipstream.h
@@ -1,125 +1,125 @@
-#ifndef __GZIPSTREAM_H__
-#define __GZIPSTREAM_H__
-/**
- * Zlib-enabled input and output streams
- *
- * This provides a simple mechanism for reading and
- * writing Gzip files. We use our own 'ZipTool' class
- * to accomplish this, avoiding a zlib dependency.
- *
- * 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
-{
-
-//#########################################################################
-//# G Z I P I N P U T S T R E A M
-//#########################################################################
-
-/**
- * This class is for deflating a gzip-compressed InputStream source
- *
- */
-class GzipInputStream : public BasicInputStream
-{
-
-public:
-
- GzipInputStream(InputStream &sourceStream);
-
- virtual ~GzipInputStream();
-
- virtual int available();
-
- virtual void close();
-
- virtual int get();
-
-private:
-
- bool load();
-
- bool loaded;
-
- std::vector<unsigned char> buffer;
- unsigned int bufPos;
-
-
-}; // class GzipInputStream
-
-
-
-
-//#########################################################################
-//# G Z I P O U T P U T S T R E A M
-//#########################################################################
-
-/**
- * This class is for gzip-compressing data going to the
- * destination OutputStream
- *
- */
-class GzipOutputStream : public BasicOutputStream
-{
-
-public:
-
- GzipOutputStream(OutputStream &destinationStream);
-
- virtual ~GzipOutputStream();
-
- virtual void close();
-
- virtual void flush();
-
- virtual void put(XMLCh ch);
-
-private:
-
- std::vector<unsigned char> buffer;
-
-
-}; // class GzipOutputStream
-
-
-
-
-
-
-
-} // namespace io
-} // namespace dom
-} // namespace w3c
-} // namespace org
-
-
-#endif /* __GZIPSTREAM_H__ */
+#ifndef __GZIPSTREAM_H__
+#define __GZIPSTREAM_H__
+/**
+ * Zlib-enabled input and output streams
+ *
+ * This provides a simple mechanism for reading and
+ * writing Gzip files. We use our own 'ZipTool' class
+ * to accomplish this, avoiding a zlib dependency.
+ *
+ * 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
+{
+
+//#########################################################################
+//# G Z I P I N P U T S T R E A M
+//#########################################################################
+
+/**
+ * This class is for deflating a gzip-compressed InputStream source
+ *
+ */
+class GzipInputStream : public BasicInputStream
+{
+
+public:
+
+ GzipInputStream(InputStream &sourceStream);
+
+ virtual ~GzipInputStream();
+
+ virtual int available();
+
+ virtual void close();
+
+ virtual int get();
+
+private:
+
+ bool load();
+
+ bool loaded;
+
+ std::vector<unsigned char> buffer;
+ unsigned int bufPos;
+
+
+}; // class GzipInputStream
+
+
+
+
+//#########################################################################
+//# G Z I P O U T P U T S T R E A M
+//#########################################################################
+
+/**
+ * This class is for gzip-compressing data going to the
+ * destination OutputStream
+ *
+ */
+class GzipOutputStream : public BasicOutputStream
+{
+
+public:
+
+ GzipOutputStream(OutputStream &destinationStream);
+
+ virtual ~GzipOutputStream();
+
+ virtual void close();
+
+ virtual void flush();
+
+ virtual void put(XMLCh ch);
+
+private:
+
+ std::vector<unsigned char> buffer;
+
+
+}; // class GzipOutputStream
+
+
+
+
+
+
+
+} // namespace io
+} // namespace dom
+} // namespace w3c
+} // namespace org
+
+
+#endif /* __GZIPSTREAM_H__ */
diff --git a/src/dom/io/httpclient.cpp b/src/dom/io/httpclient.cpp
index b81e9aedf..4245d71f2 100644
--- a/src/dom/io/httpclient.cpp
+++ b/src/dom/io/httpclient.cpp
@@ -1,167 +1,167 @@
-/**
- * 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 "httpclient.h"
-
-namespace org
-{
-namespace w3c
-{
-namespace dom
-{
-namespace io
-{
-
-
-
-
-/**
- *
- */
-HttpClient::HttpClient()
-{
-}
-
-
-/**
- *
- */
-HttpClient::~HttpClient()
-{
-}
-
-
-/**
- *
- */
-bool HttpClient::openGet(const URI &uri)
-{
-
- socket.disconnect();
-
- if (uri.getScheme() == URI::SCHEME_HTTP)
- socket.enableSSL(false);
- else if (uri.getScheme() == URI::SCHEME_HTTPS)
- socket.enableSSL(true);
- else
- {
- printf("Bad proto scheme:%d\n", uri.getScheme());
- return false;
- }
-
- DOMString host = uri.getHost();
- int port = uri.getPort();
- DOMString path = uri.getPath();
- if (path.size() == 0)
- path = "/";
-
- //printf("host:%s port:%d, path:%s\n", host.c_str(), port, path.c_str());
-
- if (!socket.connect(host, port))
- {
- return false;
- }
-
- DOMString msg = "GET ";
- msg.append(path);
- msg.append(" HTTP/1.0\r\n\r\n");
- //printf("msg:'%s'\n", msg.c_str());
-
- //# Make the request
- if (!socket.write(msg))
- {
- return false;
- }
-
- //# Read the HTTP headers
- while (true)
- {
- if (!socket.readLine(msg))
- return false;
- printf("header:'%s'\n", msg.c_str());
- if (msg.size() < 1)
- break;
- }
-
- return true;
-}
-
-
-/**
- *
- */
-int HttpClient::read()
-{
- int ret = socket.read();
- return ret;
-}
-
-/**
- *
- */
-bool HttpClient::write(int ch)
-{
- if (!socket.write(ch))
- return false;
- return true;
-}
-
-/**
- *
- */
-bool HttpClient::write(const DOMString &msg)
-{
- if (!socket.write(msg))
- return false;
- return true;
-}
-
-/**
- *
- */
-bool HttpClient::close()
-{
- socket.disconnect();
- return true;
-}
-
-
-
-} //namespace io
-} //namespace dom
-} //namespace w3c
-} //namespace org
-
-
-//#########################################################################
-//# E N D O F F I L E
-//#########################################################################
-
+/**
+ * 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 "httpclient.h"
+
+namespace org
+{
+namespace w3c
+{
+namespace dom
+{
+namespace io
+{
+
+
+
+
+/**
+ *
+ */
+HttpClient::HttpClient()
+{
+}
+
+
+/**
+ *
+ */
+HttpClient::~HttpClient()
+{
+}
+
+
+/**
+ *
+ */
+bool HttpClient::openGet(const URI &uri)
+{
+
+ socket.disconnect();
+
+ if (uri.getScheme() == URI::SCHEME_HTTP)
+ socket.enableSSL(false);
+ else if (uri.getScheme() == URI::SCHEME_HTTPS)
+ socket.enableSSL(true);
+ else
+ {
+ printf("Bad proto scheme:%d\n", uri.getScheme());
+ return false;
+ }
+
+ DOMString host = uri.getHost();
+ int port = uri.getPort();
+ DOMString path = uri.getPath();
+ if (path.size() == 0)
+ path = "/";
+
+ //printf("host:%s port:%d, path:%s\n", host.c_str(), port, path.c_str());
+
+ if (!socket.connect(host, port))
+ {
+ return false;
+ }
+
+ DOMString msg = "GET ";
+ msg.append(path);
+ msg.append(" HTTP/1.0\r\n\r\n");
+ //printf("msg:'%s'\n", msg.c_str());
+
+ //# Make the request
+ if (!socket.write(msg))
+ {
+ return false;
+ }
+
+ //# Read the HTTP headers
+ while (true)
+ {
+ if (!socket.readLine(msg))
+ return false;
+ printf("header:'%s'\n", msg.c_str());
+ if (msg.size() < 1)
+ break;
+ }
+
+ return true;
+}
+
+
+/**
+ *
+ */
+int HttpClient::read()
+{
+ int ret = socket.read();
+ return ret;
+}
+
+/**
+ *
+ */
+bool HttpClient::write(int ch)
+{
+ if (!socket.write(ch))
+ return false;
+ return true;
+}
+
+/**
+ *
+ */
+bool HttpClient::write(const DOMString &msg)
+{
+ if (!socket.write(msg))
+ return false;
+ return true;
+}
+
+/**
+ *
+ */
+bool HttpClient::close()
+{
+ socket.disconnect();
+ return true;
+}
+
+
+
+} //namespace io
+} //namespace dom
+} //namespace w3c
+} //namespace org
+
+
+//#########################################################################
+//# E N D O F F I L E
+//#########################################################################
+
diff --git a/src/dom/io/httpclient.h b/src/dom/io/httpclient.h
index 4c4bbcfe6..50538d0f5 100644
--- a/src/dom/io/httpclient.h
+++ b/src/dom/io/httpclient.h
@@ -1,115 +1,115 @@
-#ifndef __HTTPCLIENT_H__
-#define __HTTPCLIENT_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) 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 "dom/dom.h"
-#include "dom/uri.h"
-#include "dom/io/socket.h"
-
-namespace org
-{
-namespace w3c
-{
-namespace dom
-{
-namespace io
-{
-
-
-
-
-
-
-class HttpClient
-{
-
-public:
-
- /**
- *
- */
- HttpClient();
-
- /**
- *
- */
- virtual ~HttpClient();
-
- /**
- *
- */
- bool openGet(const URI &uri);
-
- /**
- *
- */
- int read();
-
- /**
- *
- */
- bool write(int ch);
-
- /**
- *
- */
- bool write(const DOMString &msg);
-
- /**
- *
- */
- bool close();
-
-
-private:
-
-
- TcpSocket socket;
-
-};
-
-
-
-
-} //namespace io
-} //namespace dom
-} //namespace w3c
-} //namespace org
-
-
-#endif /* __HTTPCLIENT_H__ */
-
-
-//#########################################################################
-//# E N D O F F I L E
-//#########################################################################
-
+#ifndef __HTTPCLIENT_H__
+#define __HTTPCLIENT_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) 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 "dom/dom.h"
+#include "dom/uri.h"
+#include "dom/io/socket.h"
+
+namespace org
+{
+namespace w3c
+{
+namespace dom
+{
+namespace io
+{
+
+
+
+
+
+
+class HttpClient
+{
+
+public:
+
+ /**
+ *
+ */
+ HttpClient();
+
+ /**
+ *
+ */
+ virtual ~HttpClient();
+
+ /**
+ *
+ */
+ bool openGet(const URI &uri);
+
+ /**
+ *
+ */
+ int read();
+
+ /**
+ *
+ */
+ bool write(int ch);
+
+ /**
+ *
+ */
+ bool write(const DOMString &msg);
+
+ /**
+ *
+ */
+ bool close();
+
+
+private:
+
+
+ TcpSocket socket;
+
+};
+
+
+
+
+} //namespace io
+} //namespace dom
+} //namespace w3c
+} //namespace org
+
+
+#endif /* __HTTPCLIENT_H__ */
+
+
+//#########################################################################
+//# E N D O F F I L E
+//#########################################################################
+