00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00023 #ifndef _CLASS_PRINTSTREAM_H
00024 #define _CLASS_PRINTSTREAM_H
00025
00026 #ifdef __cplusplus
00027
00028 #include "beecrypt/c++/array.h"
00029 using beecrypt::array;
00030 using beecrypt::bytearray;
00031 #include "beecrypt/c++/io/FilterOutputStream.h"
00032 using beecrypt::io::FilterOutputStream;
00033
00034 #include <unicode/ucnv.h>
00035
00036 namespace beecrypt {
00037 namespace io {
00040 class BEECRYPTCXXAPI PrintStream : public FilterOutputStream
00041 {
00042 private:
00043 bool _closed;
00044 bool _error;
00045 bool _flush;
00046 UConverter* _loc;
00047
00048 void print(const UChar*, size_t) throw ();
00049
00050 protected:
00051 void setError() throw ();
00052
00053 public:
00054 PrintStream(OutputStream& out, bool autoflush = false, const char* encoding = 0);
00055 virtual ~PrintStream();
00056
00057 virtual void close() throw ();
00058 virtual void flush() throw ();
00059 virtual void write(byte b) throw ();
00060 virtual void write(const byte* data, size_t offset, size_t length) throw ();
00061
00062 bool checkError() throw ();
00063 void print(bool) throw ();
00064 void print(javachar) throw ();
00065 void print(javaint) throw ();
00066 void print(javalong) throw ();
00067 void print(javashort) throw ();
00068
00069
00070
00071 void print(const array<javachar>&) throw ();
00072 void print(const String&) throw ();
00073 void println() throw ();
00074 void println(bool) throw ();
00075 void println(javachar) throw ();
00076 void println(javaint) throw ();
00077 void println(javalong) throw ();
00078 void println(javashort) throw ();
00079
00080
00081
00082 void println(const array<javachar>&) throw ();
00083 void println(const String&) throw ();
00084 };
00085 }
00086 }
00087
00088 #endif
00089
00090 #endif