[brlcad-commits] SF.net SVN: brlcad:[37353]
Open Source Solid Modeling CAD
Brought to you by:
brlcad
From: <dav...@us...> - 2010-01-20 17:03:50
|
Revision: 37353 http://brlcad.svn.sourceforge.net/brlcad/?rev=37353&view=rev Author: davidloman Date: 2010-01-20 17:03:37 +0000 (Wed, 20 Jan 2010) Log Message: ----------- Drop now obsolete io stream classes. Modified Paths: -------------- rt^3/trunk/src/GE/CMakeLists.txt rt^3/trunk/src/iBME/CMakeLists.txt Removed Paths: ------------- rt^3/trunk/include/GE/io/ByteArrayInputStream.h rt^3/trunk/include/GE/io/ByteArrayOutputStream.h rt^3/trunk/include/GE/io/DataInput.h rt^3/trunk/include/GE/io/DataInputStream.h rt^3/trunk/include/GE/io/DataOutput.h rt^3/trunk/include/GE/io/DataOutputStream.h rt^3/trunk/include/GE/io/FilterInputStream.h rt^3/trunk/include/GE/io/FilterOutputStream.h rt^3/trunk/include/GE/io/InputStream.h rt^3/trunk/include/GE/io/OutputStream.h rt^3/trunk/include/GE/io/PushbackInputStream.h rt^3/trunk/src/GE/io/ByteArrayInputStream.cxx rt^3/trunk/src/GE/io/ByteArrayOutputStream.cxx rt^3/trunk/src/GE/io/DataInputStream.cxx rt^3/trunk/src/GE/io/DataOutputStream.cxx rt^3/trunk/src/GE/io/FilterInputStream.cxx rt^3/trunk/src/GE/io/FilterOutputStream.cxx rt^3/trunk/src/GE/io/InputStream.cxx rt^3/trunk/src/GE/io/OutputStream.cxx rt^3/trunk/src/GE/io/PushbackInputStream.cxx rt^3/trunk/src/tests/streamSerialTests.cxx Deleted: rt^3/trunk/include/GE/io/ByteArrayInputStream.h =================================================================== --- rt^3/trunk/include/GE/io/ByteArrayInputStream.h 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/include/GE/io/ByteArrayInputStream.h 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,64 +0,0 @@ -/* B Y T E A R R A Y I N P U T S T R E A M . H - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file ByteArrayInputStream.h - * - * Brief description - * - */ - -#ifndef __BYTEARRAYINPUTSTREAM_H__ -#define __BYTEARRAYINPUTSTREAM_H__ - -#include "GE/io/array.h" -#include "GE/io/InputStream.h" - -class ByteArrayInputStream : public InputStream -{ -protected: - array<unsigned char> _buf; - size_t _count; - size_t _mark; - size_t _pos; - -public: - ByteArrayInputStream(const unsigned char* data, size_t offset, size_t length); - ByteArrayInputStream(const array<unsigned char>& b); - virtual ~ByteArrayInputStream(); - - virtual off_t available() throw (IOException); - virtual void close() throw (IOException); - virtual void mark(off_t readlimit) throw (); - virtual bool markSupported() throw (); - virtual unsigned int read() throw (IOException); - virtual unsigned int read(unsigned char* data, size_t offset, size_t length) throw (IOException); - virtual unsigned int read(array<unsigned char>& b) throw (IOException); - virtual void reset() throw (IOException); - virtual off_t skip(off_t n) throw (IOException); -}; - -#endif - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/include/GE/io/ByteArrayOutputStream.h =================================================================== --- rt^3/trunk/include/GE/io/ByteArrayOutputStream.h 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/include/GE/io/ByteArrayOutputStream.h 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,65 +0,0 @@ -/* B Y T E A R R A Y O U T P U T S T R E A M . H - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file ByteArrayOutputStream.h - * - * Brief description - * - */ - -#ifndef __BYTEARRAYOUTPUTSTREAM_H__ -#define __BYTEARRAYOUTPUTSTREAM_H__ - -#include "GE/io/OutputStream.h" - - - class ByteArrayOutputStream : public OutputStream - { - - protected: - - array<unsigned char> buf; - size_t count; - public: - - ByteArrayOutputStream(); - ByteArrayOutputStream(size_t size); - virtual ~ByteArrayOutputStream(); - void reset() throw (); - size_t size() throw (); - array<unsigned char>* toCharArray(); - void toCharArray(array<unsigned char>& b); - void toCharArray(unsigned char* data, size_t offset, size_t length); - void writeTo(OutputStream& out) throw (IOException); - virtual void close() throw (IOException); - virtual void flush() throw (IOException); - virtual void write(unsigned char b) throw (IOException); - virtual void write(const unsigned char* data, size_t offset, size_t length) throw (IOException); - virtual void write(const array<unsigned char>& b) throw (IOException); - }; - -#endif - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/include/GE/io/DataInput.h =================================================================== --- rt^3/trunk/include/GE/io/DataInput.h 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/include/GE/io/DataInput.h 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,73 +0,0 @@ -/* D A T A I N P U T . H - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file DataInput.h - * - * Brief description - * - */ - -#ifndef __DATAINPUT_H__ -#define __DATAINPUT_H__ - -#include "GE/io/array.h" -#include "GE/exception/IOException.h" - - class DataInput - { - public: - virtual void readFully(unsigned char* data, size_t offset, size_t length) = 0; - virtual void readFully(array<unsigned char>& b) = 0; - - virtual bool readBoolean() throw (IOException) = 0; - - virtual char readChar() throw (IOException) = 0; - virtual unsigned char readUChar() throw (IOException) = 0; - - virtual short readShort() throw (IOException) = 0; - virtual unsigned short readUShort() throw (IOException) = 0; - - virtual int readInt() throw (IOException) = 0; - virtual unsigned int readUInt() throw (IOException) = 0; - - virtual long readLong() throw (IOException) = 0; - virtual unsigned long readULong() throw (IOException) = 0; - - virtual float readFloat() throw (IOException) = 0; - virtual double readDouble() throw (IOException) = 0; - - virtual std::string readString() throw (IOException) = 0; - - virtual std::string* readLine() throw (IOException) = 0; - virtual void readLine(std::string& line) throw (IOException) = 0; - - - virtual off_t skipBytes(off_t n) throw (IOException) = 0; - }; - - -#endif - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/include/GE/io/DataInputStream.h =================================================================== --- rt^3/trunk/include/GE/io/DataInputStream.h 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/include/GE/io/DataInputStream.h 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,79 +0,0 @@ -/* D A T A I N P U T S T R E A M . H - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file DataInputStream.h - * - * Brief description - * - */ - -#ifndef __DATAINPUTSTREAM_H__ -#define __DATAINPUTSTREAM_H__ - -#include "GE/io/DataInput.h" -#include "GE/io/FilterInputStream.h" - - class DataInputStream : public FilterInputStream, public DataInput - { - private: - bool _del; - InputStream* _pin; - - public: - DataInputStream(InputStream& in); - virtual ~DataInputStream(); - - virtual void readFully(unsigned char* data, size_t offset, size_t length) throw (IOException); - virtual void readFully(array<unsigned char>& b) throw (IOException); - - virtual bool readBoolean() throw (IOException); - - virtual char readChar() throw (IOException); - virtual unsigned char readUChar() throw (IOException); - - virtual short readShort() throw (IOException); - virtual unsigned short readUShort() throw (IOException); - - virtual int readInt() throw (IOException); - virtual unsigned int readUInt() throw (IOException); - - virtual long readLong() throw (IOException); - virtual unsigned long readULong() throw (IOException); - - virtual float readFloat() throw (IOException); - virtual double readDouble() throw (IOException); - - virtual std::string readString() throw (IOException); - - virtual std::string* readLine() throw (IOException); - virtual void readLine(std::string& line) throw (IOException); - - - virtual off_t skipBytes(off_t n) throw (IOException); - }; - -#endif - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/include/GE/io/DataOutput.h =================================================================== --- rt^3/trunk/include/GE/io/DataOutput.h 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/include/GE/io/DataOutput.h 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,71 +0,0 @@ -/* D A T A O U T P U T . H - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file DataOutput.h - * - * Brief description - * - */ - -#ifndef __DATAOUTPUT_H__ -#define __DATAOUTPUT_H__ - -#include "GE/io/array.h" -#include "GE/exception/IOException.h" - - class DataOutput - { - public: - virtual void write(const array<unsigned char>& b) throw (IOException) = 0; - virtual void write(const unsigned char* data, size_t offset, size_t length) throw (IOException) = 0; - - virtual void write(unsigned char v) throw (IOException) = 0; - - virtual void writeBoolean(const bool v) throw (IOException) = 0; - - virtual void writeUChar(const unsigned char v) throw (IOException) = 0; - virtual void writeChar(const char v) throw (IOException) = 0; - - virtual void writeUShort(const unsigned short v) throw (IOException) = 0; - virtual void writeShort(const short v) throw (IOException) = 0; - - virtual void writeUInt(const unsigned int v) throw (IOException) = 0; - virtual void writeInt(const int v) throw (IOException) = 0; - - virtual void writeULong(const unsigned long v) throw (IOException) = 0; - virtual void writeLong(const long v) throw (IOException) = 0; - - virtual void writeFloat(const float v) throw (IOException) = 0; - virtual void writeDouble(const double v) throw (IOException) = 0; - - virtual void writeChar(const unsigned char v) throw (IOException) = 0; - virtual void writeString(const std::string& s) throw (IOException) = 0; - - - }; - -#endif - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/include/GE/io/DataOutputStream.h =================================================================== --- rt^3/trunk/include/GE/io/DataOutputStream.h 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/include/GE/io/DataOutputStream.h 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,80 +0,0 @@ -/* D A T A O U T P U T S T R E A M . H - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file DataOutputStream.h - * - * Brief description - * - */ - -#ifndef __DATAOUTPUTSTREAM_H__ -#define __DATAOUTPUTSTREAM_H__ - -#include "GE/io/DataOutput.h" -#include "GE/io/FilterOutputStream.h" - - class DataOutputStream : public FilterOutputStream, public DataOutput - { - - protected: - size_t written; - - public: - DataOutputStream(OutputStream& out); - virtual ~DataOutputStream(); - - size_t size() const throw (); - - virtual void write(const array<unsigned char>& b) throw (IOException); - virtual void write(const unsigned char* data, size_t offset, size_t length) throw (IOException); - - virtual void write(unsigned char v) throw (IOException); - - virtual void writeBoolean(const bool v) throw (IOException); - - virtual void writeUChar(const unsigned char v) throw (IOException); - virtual void writeChar(const char v) throw (IOException); - - virtual void writeUShort(const unsigned short v) throw (IOException); - virtual void writeShort(const short v) throw (IOException); - - virtual void writeUInt(const unsigned int v) throw (IOException); - virtual void writeInt(const int v) throw (IOException); - - virtual void writeULong(const unsigned long v) throw (IOException); - virtual void writeLong(const long v) throw (IOException); - - virtual void writeFloat(const float v) throw (IOException); - virtual void writeDouble(const double v) throw (IOException); - - virtual void writeChar(const unsigned char v) throw (IOException); - virtual void writeString(const std::string& s) throw (IOException); - - }; - - -#endif - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/include/GE/io/FilterInputStream.h =================================================================== --- rt^3/trunk/include/GE/io/FilterInputStream.h 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/include/GE/io/FilterInputStream.h 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,58 +0,0 @@ -/* F I L T E R I N P U T S T R E A M . H - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file FilterInputStream.h - * - * Brief description - * - */ - -#ifndef __FILTERINPUTSTREAM_H__ -#define __FILTERINPUTSTREAM_H__ - -#include "GE/io/InputStream.h" - -class FilterInputStream : public InputStream -{ - protected: - InputStream& in; - - public: - FilterInputStream(InputStream& in); - virtual ~FilterInputStream(); - virtual off_t available() throw (IOException); - virtual void close() throw (IOException); - virtual void mark(off_t) throw (); - virtual bool markSupported() throw (); - virtual unsigned int read() throw (IOException); - virtual unsigned int read(unsigned char* data, size_t offset, size_t length) throw (IOException); - virtual unsigned int read(array<unsigned char>& b) throw (IOException); - virtual void reset() throw (IOException); - virtual off_t skip(off_t) throw (IOException); -}; - -#endif - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/include/GE/io/FilterOutputStream.h =================================================================== --- rt^3/trunk/include/GE/io/FilterOutputStream.h 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/include/GE/io/FilterOutputStream.h 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,55 +0,0 @@ -/* F I L T E R O U T P U T S T R E A M . H - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file FilterOutputStream.h - * - * Brief description - * - */ - -#ifndef __CLASS_FILTEROUTPUTSTREAM_H__ -#define __CLASS_FILTEROUTPUTSTREAM_H__ - -#include "GE/io/OutputStream.h" - -class FilterOutputStream : public OutputStream - { - protected: - OutputStream& out; - - public: - FilterOutputStream(OutputStream& out); - virtual ~FilterOutputStream(); - - virtual void close() throw (IOException); - virtual void flush() throw (IOException); - virtual void write(unsigned char b) throw (IOException); - virtual void write(const unsigned char* data, size_t offset, size_t length) throw (IOException); - virtual void write(const array<unsigned char>& b) throw (IOException); - }; - -#endif - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/include/GE/io/InputStream.h =================================================================== --- rt^3/trunk/include/GE/io/InputStream.h 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/include/GE/io/InputStream.h 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,56 +0,0 @@ -/* I N P U T S T R E A M . H - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file InputStream.h - * - * Brief description - * - */ - -#ifndef __INPUTSTREAM_H__ -#define __INPUTSTREAM_H__ - -#include "GE/io/array.h" -#include "GE/exception/IOException.h" - -class InputStream -{ -public: - virtual ~InputStream() {}; - - virtual off_t available() throw (IOException); - virtual void close() throw (IOException); - virtual void mark(off_t readlimit) throw (); - virtual bool markSupported() throw (); - virtual unsigned int read() throw (IOException) = 0; - virtual unsigned int read(unsigned char* data, size_t offset, size_t length) throw (IOException); - virtual unsigned int read(array<unsigned char>& b) throw (IOException); - virtual void reset() throw (IOException); - virtual off_t skip(off_t n) throw (IOException); -}; - -#endif - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/include/GE/io/OutputStream.h =================================================================== --- rt^3/trunk/include/GE/io/OutputStream.h 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/include/GE/io/OutputStream.h 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,52 +0,0 @@ -/* O U T P U T S T R E A M . H - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file OutputStream.h - * - * Brief description - * - */ - -#ifndef __OUTPUTSTREAM_H__ -#define __OUTPUTSTREAM_H__ - -#include "GE/io/array.h" -#include "GE/exception/IOException.h" - -class OutputStream -{ -public: - virtual ~OutputStream() {}; - - virtual void close() throw (IOException); - virtual void flush() throw (IOException); - virtual void write(unsigned char b) throw (IOException) = 0; - virtual void write(const unsigned char* data, size_t offset, size_t length) throw (IOException); - virtual void write(const array<unsigned char>& b) throw (IOException); -}; - -#endif - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/include/GE/io/PushbackInputStream.h =================================================================== --- rt^3/trunk/include/GE/io/PushbackInputStream.h 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/include/GE/io/PushbackInputStream.h 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,64 +0,0 @@ -/* P U S H B A C K I N P U T S T R E A M . H - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file PushbackInputStream.h - * - * Brief description - * - */ - -#ifndef __PUSHBACKINPUTSTREAM_H__ -#define __PUSHBACKINPUTSTREAM_H__ - -#include "GE/io/FilterInputStream.h" - -class PushbackInputStream : public FilterInputStream -{ -private: - bool _closed; - -protected: - array<unsigned char> buf; - size_t pos; - -public: - PushbackInputStream(InputStream& in, size_t size = 1); - virtual ~PushbackInputStream(); - - virtual off_t available() throw (IOException); - virtual void close() throw (IOException); - virtual bool markSupported() throw (); - virtual unsigned int read() throw (IOException); - virtual unsigned int read(unsigned char* data, size_t offset, size_t length) throw (IOException); - virtual off_t skip(off_t n) throw (IOException); - - void unread(unsigned char) throw (IOException); - void unread(const unsigned char* data, size_t offset, size_t length) throw (IOException); - void unread(const array<unsigned char>& b) throw (IOException); -}; - -#endif - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Modified: rt^3/trunk/src/GE/CMakeLists.txt =================================================================== --- rt^3/trunk/src/GE/CMakeLists.txt 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/src/GE/CMakeLists.txt 2010-01-20 17:03:37 UTC (rev 37353) @@ -33,19 +33,13 @@ MESSAGE(STATUS "################################################") MESSAGE(STATUS "") - +if(COMMAND cmake_policy) + cmake_policy(SET CMP0003 NEW) +endif(COMMAND cmake_policy) + set(GE_SOURCES GeometryEngine.cxx Logger.cxx - io/ByteArrayInputStream.cxx - io/ByteArrayOutputStream.cxx - io/DataInputStream.cxx - io/DataOutputStream.cxx - io/FilterInputStream.cxx - io/FilterOutputStream.cxx - io/InputStream.cxx - io/OutputStream.cxx - io/PushbackInputStream.cxx exception/CloneNotSupportedException.cxx exception/Exception.cxx exception/NullPointerException.cxx Deleted: rt^3/trunk/src/GE/io/ByteArrayInputStream.cxx =================================================================== --- rt^3/trunk/src/GE/io/ByteArrayInputStream.cxx 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/src/GE/io/ByteArrayInputStream.cxx 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,122 +0,0 @@ -/* B Y T E A R R A Y I N P U T S T R E A M . C X X - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file ByteArrayInputStream.cxx - * - * Brief description - * - */ - -#include "GE/io/ByteArrayInputStream.h" -#include "GE/exception/NullPointerException.h" - -ByteArrayInputStream::ByteArrayInputStream(const array<unsigned char>& b) : _buf(b) -{ - _count = _buf.size(); - _mark = 0; - _pos = 0; -} - -ByteArrayInputStream::ByteArrayInputStream(const unsigned char* data, size_t offset, size_t length) : _buf(data+offset, length) -{ - _count = _buf.size(); - _mark = 0; - _pos = 0; -} - -ByteArrayInputStream::~ByteArrayInputStream() -{ -} - -off_t ByteArrayInputStream::available() throw (IOException) -{ - return (off_t)(_count - _pos); -} - -void ByteArrayInputStream::close() throw (IOException) -{ -} - -void ByteArrayInputStream::mark(off_t readlimit) throw () -{ - _mark = _pos; -} - -bool ByteArrayInputStream::markSupported() throw () -{ - return true; -} - -unsigned int ByteArrayInputStream::read() throw (IOException) -{ - register int rc; - rc = (_pos < _count) ? _buf[_pos++] : -1; - return rc; -} - -unsigned int ByteArrayInputStream::read(unsigned char* data, size_t offset, size_t length) throw (IOException) -{ - if (!data) - throw NullPointerException(); - - if (_pos >= _count) - { - return -1; - } - - if (_pos + length > _count) - length = _count - _pos; - - if (length == 0) - { - return 0; - } - - memcpy(data+offset, _buf.data()+_pos, length); - _pos += length; - - - return length; -} - -unsigned int ByteArrayInputStream::read(array<unsigned char>& b) throw (IOException) -{ - return read(b.data(), 0, b.size()); -} - -void ByteArrayInputStream::reset() throw (IOException) -{ - _pos = _mark; -} - -off_t ByteArrayInputStream::skip(off_t n) throw (IOException) -{ - if (_pos + n > _count) - n = _count - _pos; - _pos += n; - return n; -} - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/src/GE/io/ByteArrayOutputStream.cxx =================================================================== --- rt^3/trunk/src/GE/io/ByteArrayOutputStream.cxx 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/src/GE/io/ByteArrayOutputStream.cxx 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,138 +0,0 @@ -/* B Y T E A R R A Y O U T P U T S T R E A M . C X X - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file ByteArrayOutputStream.cxx - * - * Brief description - * - */ - -#include "GE/io/ByteArrayOutputStream.h" -#include "GE/exception/NullPointerException.h" - -ByteArrayOutputStream::ByteArrayOutputStream() : buf(32) -{ - count = 0; -} - -ByteArrayOutputStream::ByteArrayOutputStream(size_t size) : buf(size) -{ - count = 0; -} - -ByteArrayOutputStream::~ByteArrayOutputStream() -{ -} - -void ByteArrayOutputStream::reset() throw () -{ - count = 0; -} - -size_t ByteArrayOutputStream::size() throw () -{ - return count; -} - -array<unsigned char>* ByteArrayOutputStream::toCharArray() -{ - array<unsigned char>* result = new array<unsigned char>(); - - this->toCharArray(*result); - - return result; -} - -void ByteArrayOutputStream::toCharArray(array<unsigned char>& b) -{ - b.resize(count); - memcpy(b.data(), buf.data(), count); -} - -void ByteArrayOutputStream::toCharArray(unsigned char* data, size_t offset, size_t length) -{ - if (!data) - throw NullPointerException(); - memcpy(data+offset, buf.data(), length < count ? length : count); - -} -void ByteArrayOutputStream::close() throw (IOException) -{ -} - -void ByteArrayOutputStream::flush() throw (IOException) -{ -} - -void ByteArrayOutputStream::write(unsigned char b) throw (IOException) -{ - size_t newcount = count+1; - size_t actualsz = buf.size(); - - if (actualsz < newcount) - { - if (actualsz == 0) - buf.resize(32); - else - buf.resize(actualsz << 1); - } - - buf[count++] = b; -} - -void ByteArrayOutputStream::write(const unsigned char* data, size_t offset, size_t length) throw (IOException) -{ - if (length) - { - if (!data) - throw NullPointerException(); - - size_t newcount = count + length; - size_t actualsz = buf.size(); - - if (newcount > actualsz) - { - buf.resize(newcount > (actualsz << 1) ? newcount : (actualsz << 1)); - } - memcpy(buf.data()+count, data, length); - count += length; - - } -} - -void ByteArrayOutputStream::write(const array<unsigned char>& b) throw (IOException) -{ - write(b.data(), 0, b.size()); -} - -void ByteArrayOutputStream::writeTo(OutputStream& out) throw (IOException) -{ - if (count) - { - out.write(buf.data(), 0, count); - } -} - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/src/GE/io/DataInputStream.cxx =================================================================== --- rt^3/trunk/src/GE/io/DataInputStream.cxx 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/src/GE/io/DataInputStream.cxx 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,319 +0,0 @@ -/* D A T A I N P U T S T R E A M . C X X - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file DataInputStream.cxx - * - * Brief description - * - */ - -#include "GE/io/DataInputStream.h" -#include "GE/exception/EOFException.h" -#include "GE/io/PushbackInputStream.h" -#include "GE/exception/NullPointerException.h" - -#define MAX_BYTES_PER_CHARACTER 8 - -DataInputStream::DataInputStream(InputStream& in) : FilterInputStream(in) -{ - _pin = ∈ - _del = false; -} - -DataInputStream::~DataInputStream() -{ - - if (_del) - { - delete _pin; - _pin = 0; - } -} - -bool DataInputStream::readBoolean() throw (IOException) -{ - register int b = _pin->read(); - - if (b < 0) - throw EOFException(); - - return (b != 0); -} - -char DataInputStream::readChar() throw (IOException) -{ - return static_cast<char>(this->readUChar()); -} - -unsigned char DataInputStream::readUChar() throw (IOException) -{ - register int b = _pin->read(); - - if (b < 0) - throw EOFException(); - - return static_cast<unsigned char>(b); -} - - - -short DataInputStream::readShort() throw (IOException) -{ - return static_cast<short>(this->readUShort()); -} - -unsigned short DataInputStream::readUShort() throw (IOException) -{ - register unsigned int tmp = 0, rc; - - for (register unsigned int i = 0; i < 2; ++i) - { - if ((rc = _pin->read()) < 0) - throw EOFException(); - - tmp = (tmp << 8) + rc; - } - - return tmp; -} - - - -std::string DataInputStream::readString() throw (IOException) -{ - - unsigned int len = this->readUInt(); - - std::string out = ""; - - for (int i = 0; i < len; ++i) - { - out += this->readChar(); - } - - return out; -} - - -int DataInputStream::readInt() throw (IOException) -{ - return static_cast<int>(this->readUInt()); -} - -unsigned int DataInputStream::readUInt() throw (IOException) -{ - register unsigned int tmp = 0; - register int rc; - - for (register unsigned int i = 0; i < 4; ++i) - { - if ((rc = _pin->read()) < 0) - throw EOFException(); - - tmp = (tmp << 8) + rc; - } - - return tmp; -} - - -long DataInputStream::readLong() throw (IOException) -{ - return static_cast<long>(this->readULong()); -} - -unsigned long DataInputStream::readULong() throw (IOException) -{ - register unsigned long tmp = 0; - register int rc; - - for (register unsigned int i = 0; i < 8; ++i) - { - if ((rc = _pin->read()) < 0) - throw EOFException(); - - tmp = (tmp << 8) + rc; - } - - return tmp; -} - - -float DataInputStream::readFloat() throw (IOException) -{ -//Need to route this through ntohf - float f = 0.0; - unsigned char* pf = (unsigned char*) &f; - unsigned char b; - - for (int i = 0; i < 4; ++i) - { - *pf = this->readUChar(); - *pf++; - } - return f; -} - -double DataInputStream::readDouble() throw (IOException) -{ -//Need to route this through ntohd - double d = 0.0; - unsigned char* pd = (unsigned char*) &d; - unsigned char b; - - for (int i = 0; i < 8; ++i) - { - *pd = this->readUChar(); - *pd++; - } - return d; -} - - - - - - - - -std::string* DataInputStream::readLine() throw (IOException) -{ - std::string* result = new std::string(); - - readLine(*result); - - return result; -} - -void DataInputStream::readLine(std::string& line) throw (IOException) -{ - - - char target_buffer[1]; - char* target = target_buffer; - const char* target_limit = target_buffer+1; - char source_buffer[MAX_BYTES_PER_CHARACTER]; - const char* source = source_buffer; - char* source_limit = source_buffer; - - bool cr = false; - - int ch; - - // clear the line - line.clear(); - - do - { - ch = _pin->read(); - - if (ch >= 0) - { - if ((source_limit - source_buffer) == MAX_BYTES_PER_CHARACTER) - throw IOException("fubar in readLine"); - - *(source_limit++) = (unsigned char) ch; - } - - - - if (target == target_limit) - { - // we got a whole character from the converter - if (cr) - { - // last character read was ASCII <CR>; is this one a <LF>? - if (target_buffer[0] != 0x0A) - { - // unread the right number of unsigned chars - PushbackInputStream* p = dynamic_cast<PushbackInputStream*>(_pin); - if (p) - p->unread((const unsigned char*) source_buffer, 0, source-source_buffer); - else - throw IOException("fubar in dynamic_cast"); - } - // we're now officially at the end of the line - break; - } - - // did we get an ASCII <LF>? - if (target_buffer[0] == 0x0A) - break; - - // did we get an ASCII <CR>? - if (target_buffer[0] == 0x0D) - { - cr = true; - - // the next character may be a <LF> but if not we'll have to 'unread' it - if (!_del) - { - // lazy push - _pin = new PushbackInputStream(in, MAX_BYTES_PER_CHARACTER); - _del = true; - } - } - else - { - // append character to string and reset pointers - source = source_limit = source_buffer; - line.append((const char*)*(target = target_buffer)); - } - } - } while (ch >= 0); -} - -void DataInputStream::readFully(unsigned char* data, size_t offset, size_t length) throw (IOException) -{ - if (!data) - throw NullPointerException(); - - size_t total = 0; - - while (total < length) - { - int rc = _pin->read(data, offset+total, length-total); - if (rc < 0) - throw EOFException(); - total += rc; - } -} - -void DataInputStream::readFully(array<unsigned char>& b) throw (IOException) -{ - readFully(b.data(), 0, b.size()); -} - -off_t DataInputStream::skipBytes(off_t n) throw (IOException) -{ - off_t total = 0, rc; - - while ((total < n) && ((rc = _pin->skip(n - total)) > 0)) - total += rc; - - return total; -} - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/src/GE/io/DataOutputStream.cxx =================================================================== --- rt^3/trunk/src/GE/io/DataOutputStream.cxx 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/src/GE/io/DataOutputStream.cxx 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,174 +0,0 @@ -/* D A T A O U T P U T S T R E A M . C X X - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file DataOutputStream.cxx - * - * Brief description - * - */ - -#include "GE/io/DataOutputStream.h" - -#include <iostream> - -DataOutputStream::DataOutputStream(OutputStream& out) : FilterOutputStream(out) -{ - written = 0; -} - -DataOutputStream::~DataOutputStream() -{ -} - -size_t DataOutputStream::size() const throw () -{ - return written; -} - -void DataOutputStream::write(unsigned char b) throw (IOException) -{ - out.write(b); - written++; -} - -void DataOutputStream::write(const unsigned char* data, size_t offset, size_t length) throw (IOException) -{ - if (length) - { - out.write(data, offset, length); - written += length; - } -} - -void DataOutputStream::write(const array<unsigned char>& b) throw (IOException) -{ - write(b.data(), 0, b.size()); -} - -void DataOutputStream::writeBoolean(bool b) throw (IOException) -{ - out.write(b ? 1 : 0); - written++; -} - -void DataOutputStream::writeChar(char b) throw (IOException) -{ - this->writeUChar(static_cast<unsigned char>(b)); -} -void DataOutputStream::writeUChar(unsigned char b) throw (IOException) -{ - out.write(b); - written++; -} - - -void DataOutputStream::writeShort(short s) throw (IOException) -{ - this->writeUShort(static_cast<unsigned short>(s)); -} -void DataOutputStream::writeUShort(unsigned short s) throw (IOException) -{ - out.write((s >> 8) ); - out.write((s ) & 0xff); - written += 2; -} - -void DataOutputStream::writeInt(int i) throw (IOException) -{ - this->writeUInt(static_cast<unsigned int>(i)); -} -void DataOutputStream::writeUInt(unsigned int i) throw (IOException) -{ - out.write((i >> 24) ); - out.write((i >> 16) & 0xff); - out.write((i >> 8) & 0xff); - out.write((i ) & 0xff); - written += 4; -} - -void DataOutputStream::writeLong(long l) throw (IOException) -{ - this->writeULong(static_cast<unsigned long>(l)); -} -void DataOutputStream::writeULong(unsigned long l) throw (IOException) -{ - out.write((l >> 56) ); - out.write((l >> 48) & 0xff); - out.write((l >> 40) & 0xff); - out.write((l >> 32) & 0xff); - out.write((l >> 24) & 0xff); - out.write((l >> 16) & 0xff); - out.write((l >> 8) & 0xff); - out.write((l ) & 0xff); - written += 8; -} - - - - - -void DataOutputStream::writeFloat(float f) throw (IOException) -{ -//need to route this through htonf - unsigned char* b = (unsigned char*) &f; - for (unsigned int i = 0; i < 4; ++i) - { - this->write(*b++); - } -} - - -void DataOutputStream::writeDouble(double d) throw (IOException) -{ -//Need to route this through htond - unsigned char* b = (unsigned char*) &d; - for (unsigned int i = 0; i < 8; ++i) - { - this->write(*b++); - } - -} - - - - -void DataOutputStream::writeChar(unsigned char v) throw (IOException) -{ - this->writeUChar(v); -} - -void DataOutputStream::writeString(const std::string& str) throw (IOException) -{ - this->writeUInt(str.size()); - - for (size_t i = 0; i < str.length(); i++) - { - this->writeChar(str[i]); - } -} - - - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/src/GE/io/FilterInputStream.cxx =================================================================== --- rt^3/trunk/src/GE/io/FilterInputStream.cxx 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/src/GE/io/FilterInputStream.cxx 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,91 +0,0 @@ -/* F I L T E R I N P U T S T R E A M . C X X - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file FilterInputStream.cxx - * - * Brief description - * - */ - -#include "GE/io/FilterInputStream.h" - -FilterInputStream::FilterInputStream(InputStream& in) : in(in) -{ -} - -FilterInputStream::~FilterInputStream() -{ -} - -off_t FilterInputStream::available() throw (IOException) -{ - return in.available(); -} - -void FilterInputStream::close() throw (IOException) -{ - in.close(); -} - -void FilterInputStream::mark(off_t readlimit) throw () -{ - - in.mark(readlimit); - -} - -bool FilterInputStream::markSupported() throw () -{ - return in.markSupported(); -} - -unsigned int FilterInputStream::read() throw (IOException) -{ - return in.read(); -} - -unsigned int FilterInputStream::read(unsigned char* data, size_t offset, size_t len) throw (IOException) -{ - return in.read(data, offset, len); -} - -unsigned int FilterInputStream::read(array<unsigned char>& b) throw (IOException) -{ - return in.read(b); -} - -void FilterInputStream::reset() throw (IOException) -{ - - in.reset(); - -} - -off_t FilterInputStream::skip(off_t n) throw (IOException) -{ - return in.skip(n); -} - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/src/GE/io/FilterOutputStream.cxx =================================================================== --- rt^3/trunk/src/GE/io/FilterOutputStream.cxx 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/src/GE/io/FilterOutputStream.cxx 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,75 +0,0 @@ -/* F I L T E R O U T P U T S T R E A M . C X X - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file FilterOutputStream.cxx - * - * Brief description - * - */ - -#include "GE/io/FilterOutputStream.h" - -FilterOutputStream::FilterOutputStream(OutputStream& out) : out(out) -{ -} - -FilterOutputStream::~FilterOutputStream() -{ -} - -void FilterOutputStream::close() throw (IOException) -{ - try - { - flush(); - } - catch (IOException) - { - // ignore - } - out.close(); -} - -void FilterOutputStream::flush() throw (IOException) -{ - out.flush(); -} - -void FilterOutputStream::write(unsigned char b) throw (IOException) -{ - out.write(b); -} - -void FilterOutputStream::write(const unsigned char* data, size_t offset, size_t len) throw (IOException) -{ - out.write(data, offset, len); -} - -void FilterOutputStream::write(const array<unsigned char>& b) throw (IOException) -{ - out.write(b.data(), 0, b.size()); -} - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/src/GE/io/InputStream.cxx =================================================================== --- rt^3/trunk/src/GE/io/InputStream.cxx 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/src/GE/io/InputStream.cxx 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,109 +0,0 @@ -/* I N P U T S T R E A M . C X X - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file InputStream.cxx - * - * Brief description - * - */ - -#include "GE/io/InputStream.h" -#include "GE/exception/NullPointerException.h" - -off_t InputStream::available() throw (IOException) -{ - return 0; -} - -void InputStream::close() throw (IOException) -{ -} - -void InputStream::mark(off_t readlimit) throw () -{ -} - -bool InputStream::markSupported() throw () -{ - return false; -} - -unsigned int InputStream::read(array<unsigned char>& b) throw (IOException) -{ - return read(b.data(), 0, b.size()); -} - -unsigned int InputStream::read(unsigned char* data, size_t offset, size_t length) throw (IOException) -{ - if (!data) - throw NullPointerException(); - - int b = read(); - if (b < 0) - return -1; - - data[offset] = (unsigned char) b; - - size_t i = 1; - try - { - while (i < length) - { - b = read(); - if (b < 0) - break; - data[offset+i++] = (unsigned char) b; - } - } - catch (IOException) - { - // ignore - } - return i; -} - -off_t InputStream::skip(off_t n) throw (IOException) -{ - off_t remaining = n; - - unsigned char skip[2048]; - - while (remaining > 0) - { - int rc = read(skip, 0, remaining > 2048 ? 2048 : remaining); - if (rc < 0) - break; - remaining -= rc; - } - - return n - remaining; -} - -void InputStream::reset() throw (IOException) -{ - throw IOException("reset not supported"); -} - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/src/GE/io/OutputStream.cxx =================================================================== --- rt^3/trunk/src/GE/io/OutputStream.cxx 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/src/GE/io/OutputStream.cxx 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,60 +0,0 @@ -/* O U T P U T S T R E A M . C X X - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file OutputStream.cxx - * - * Brief description - * - */ - -#include "GE/io/OutputStream.h" -#include "GE/exception/NullPointerException.h" - -void OutputStream::close() throw (IOException) -{ -} - -void OutputStream::flush() throw (IOException) -{ -} - -void OutputStream::write(const unsigned char* data, size_t offset, size_t length) throw (IOException) -{ - if (length) - { - if (!data) - throw NullPointerException(); - - for (size_t i = 0; i < length; i++) - write(data[offset+i]); - } -} - -void OutputStream::write(const array<unsigned char>& b) throw (IOException) -{ - write(b.data(), 0, b.size()); -} - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Deleted: rt^3/trunk/src/GE/io/PushbackInputStream.cxx =================================================================== --- rt^3/trunk/src/GE/io/PushbackInputStream.cxx 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/src/GE/io/PushbackInputStream.cxx 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,174 +0,0 @@ -/* P U S H B A C K I N P U T S T R E A M . C X X - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file PushbackInputStream.cxx - * - * Brief description - * - */ - -#include "GE/io/PushbackInputStream.h" -#include "GE/exception/NullPointerException.h" - -PushbackInputStream::PushbackInputStream(InputStream& in, size_t size) : FilterInputStream(in), buf(size) -{ - _closed = false; - pos = 0; -} - -PushbackInputStream::~PushbackInputStream() -{ -} - -off_t PushbackInputStream::available() throw (IOException) -{ - if (_closed) - throw IOException("Stream closed"); - - return in.available() + (buf.size() - pos); -} - -void PushbackInputStream::close() throw (IOException) -{ - if (!_closed) - { - in.close(); - _closed = true; - } -} - -unsigned int PushbackInputStream::read() throw (IOException) -{ - if (_closed) - throw IOException("Stream closed"); - - if (pos < buf.size()) - return buf[pos++]; - - return in.read(); -} - -bool PushbackInputStream::markSupported() throw () -{ - return false; -} - -unsigned int PushbackInputStream::read(unsigned char* data, size_t offset, size_t length) throw (IOException) -{ - if (!data) - throw NullPointerException(); - - if (_closed) - throw IOException("Stream closed"); - - if (length == 0) - return 0; - - size_t buffered = buf.size() - pos; - - if (buffered > 0) - { - if (length < buffered) - buffered = length; - - memcpy(data+offset, buf.data()+pos, buffered); - - pos += buffered; - offset += buffered; - length -= buffered; - } - - if (length > 0) - { - int rc = in.read(data, offset, length); - if (rc < 0) - if (buffered == 0) - return -1; // nothing in buffer and nothing read - else - return buffered; // something in buffer and nothing read - - return buffered + rc; // something in buffer and something read - } - - return buffered; // everything was in buffer -} - -off_t PushbackInputStream::skip(off_t n) throw (IOException) -{ - if (_closed) - throw IOException("Stream closed"); - - if (n == 0) - return 0; - - size_t canskip = buf.size() - pos; - - if (canskip > 0) - { - if (n < canskip) - { - // more in buffer than we need to skip - canskip = n; - } - pos += canskip; - n -= canskip; - } - - if (n > 0) - { - // apparently we didn't have enough in the buffer - canskip += in.skip(n); - } - - return canskip; -} - -void PushbackInputStream::unread(unsigned char b) throw (IOException) -{ - if (_closed) - throw IOException("Stream closed"); - - if (pos == 0) - throw IOException("Pushback buffer is full"); - - buf[--pos] = b; -} - -void PushbackInputStream::unread(const array<unsigned char>& b) throw (IOException) -{ - unread(b.data(), 0, b.size()); -} - -void PushbackInputStream::unread(const unsigned char* data, size_t offset, size_t length) throw (IOException) -{ - if (!data) - throw NullPointerException(); - - pos -= length; - - memcpy(buf.data()+pos, data+offset, length); -} - -// Local Variables: *** -// mode: C++ *** -// tab-width: 8 *** -// c-basic-offset: 2 *** -// indent-tabs-mode: t *** -// End: *** -// ex: shiftwidth=2 tabstop=8 Modified: rt^3/trunk/src/iBME/CMakeLists.txt =================================================================== --- rt^3/trunk/src/iBME/CMakeLists.txt 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/src/iBME/CMakeLists.txt 2010-01-20 17:03:37 UTC (rev 37353) @@ -53,9 +53,6 @@ ## Make the Test Apps. -ADD_EXECUTABLE(streamSerialTests ../tests/streamSerialTests.cxx) -TARGET_LINK_LIBRARIES(streamSerialTests ge) - ADD_EXECUTABLE(netMsgSerialTest ../tests/netMsgSerialTest.cxx) TARGET_LINK_LIBRARIES(netMsgSerialTest ge gs ${QT_LIBRARIES}) Deleted: rt^3/trunk/src/tests/streamSerialTests.cxx =================================================================== --- rt^3/trunk/src/tests/streamSerialTests.cxx 2010-01-20 16:54:22 UTC (rev 37352) +++ rt^3/trunk/src/tests/streamSerialTests.cxx 2010-01-20 17:03:37 UTC (rev 37353) @@ -1,173 +0,0 @@ -/* S T R E A M S E R I A L T E S T S . C X X - * BRL-CAD - * - * Copyright (c) 2009 United States Government as represented by - * the U.S. Army Research Laboratory. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * version 2.1 as published by the Free Software Foundation. - * - * 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 file; see the file named COPYING for more - * information. - */ -/** @file streamSerialTests... [truncated message content] |