[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnash-commit] gnash ChangeLog libbase/IOChannel.cpp libbase/I...
From: |
Sandro Santilli |
Subject: |
[Gnash-commit] gnash ChangeLog libbase/IOChannel.cpp libbase/I... |
Date: |
Mon, 09 Jun 2008 14:44:48 +0000 |
CVSROOT: /sources/gnash
Module name: gnash
Changes by: Sandro Santilli <strk> 08/06/09 14:44:48
Modified files:
. : ChangeLog
libbase : IOChannel.cpp IOChannel.h
Log message:
* libbase/IOChannel.{cpp,h}: read_byte and write_byte don't
need to be virtual, implement in terms of read_bytes and
write_bytes, with exception throwing on error. Fix IOException
to be actually instantiatable..
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/gnash/ChangeLog?cvsroot=gnash&r1=1.6864&r2=1.6865
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/IOChannel.cpp?cvsroot=gnash&r1=1.2&r2=1.3
http://cvs.savannah.gnu.org/viewcvs/gnash/libbase/IOChannel.h?cvsroot=gnash&r1=1.2&r2=1.3
Patches:
Index: ChangeLog
===================================================================
RCS file: /sources/gnash/gnash/ChangeLog,v
retrieving revision 1.6864
retrieving revision 1.6865
diff -u -b -r1.6864 -r1.6865
--- ChangeLog 9 Jun 2008 14:31:51 -0000 1.6864
+++ ChangeLog 9 Jun 2008 14:44:47 -0000 1.6865
@@ -1,5 +1,12 @@
2008-06-09 Sandro Santilli <address@hidden>
+ * libbase/IOChannel.{cpp,h}: read_byte and write_byte don't
+ need to be virtual, implement in terms of read_bytes and
+ write_bytes, with exception throwing on error. Fix IOException
+ to be actually instantiatable..
+
+2008-06-09 Sandro Santilli <address@hidden>
+
* lots of files: use IOChannel instead of tu_file for input.
2008-06-09 Benjamin Wolsey <address@hidden>
Index: libbase/IOChannel.cpp
===================================================================
RCS file: /sources/gnash/gnash/libbase/IOChannel.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- libbase/IOChannel.cpp 9 Jun 2008 14:31:52 -0000 1.2
+++ libbase/IOChannel.cpp 9 Jun 2008 14:44:48 -0000 1.3
@@ -124,5 +124,22 @@
return u.f;
}
+boost::uint8_t
+IOChannel::read_byte()
+{
+ boost::uint8_t u;
+ if ( read_bytes(&u, 1) == -1 )
+ {
+ throw IOException("Could not read a single byte from input");
+ }
+ return u;
+}
+
+void
+IOChannel::write_byte(boost::uint8_t u)
+{
+ write_bytes(&u, 1); // will trhow on error it seems
+}
+
} // namespace gnash
Index: libbase/IOChannel.h
===================================================================
RCS file: /sources/gnash/gnash/libbase/IOChannel.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- libbase/IOChannel.h 9 Jun 2008 14:31:52 -0000 1.2
+++ libbase/IOChannel.h 9 Jun 2008 14:44:48 -0000 1.3
@@ -42,7 +42,7 @@
/// Exception signalling an IO error
class IOException : public GnashException {
-
+public:
IOException(const std::string& s) : GnashException(s) {}
IOException() : GnashException("IO error") {}
};
@@ -92,13 +92,13 @@
//
/// Throw IOException on error
///
- virtual boost::uint8_t read_byte() =0;
+ boost::uint8_t read_byte();
/// write a single byte to the stream
//
/// Throw IOException on error
///
- virtual void write_byte(boost::uint8_t u)=0;
+ void write_byte(boost::uint8_t u);
/// Read the given number of bytes from the stream
//
- [Gnash-commit] gnash ChangeLog libbase/IOChannel.cpp libbase/I...,
Sandro Santilli <=