1 // Sun, 18 Jun 2000 2 // Y.Takagi 3 4 #ifndef __LprTransport_H 5 #define __LprTransport_H 6 7 #include <DataIO.h> 8 #include <Message.h> 9 #include <fstream> 10 #include <string> 11 12 #if (!__MWERKS__ || defined(WIN32)) 13 using namespace std; 14 #else 15 #define std 16 #endif 17 18 class LprTransport : public BDataIO { 19 public: 20 LprTransport(BMessage *msg); 21 virtual ~LprTransport(); 22 virtual ssize_t Read(void *buffer, size_t size); 23 virtual ssize_t Write(const void *buffer, size_t size); 24 25 bool operator !() const; 26 bool fail() const; 27 28 private: 29 char __server[256]; 30 char __queue[256]; 31 char __file[256]; 32 char __user[256]; 33 int32 __jobid; 34 fstream __fs; 35 bool __error; 36 }; 37 38 inline bool LprTransport::fail() const 39 { 40 return __error; 41 } 42 43 inline bool LprTransport::operator !() const 44 { 45 return fail(); 46 } 47 48 #endif // __LprTransport_H 49