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 13 using namespace std; 14 15 16 class LprTransport : public BDataIO { 17 public: 18 LprTransport(BMessage *msg); 19 virtual ~LprTransport(); 20 virtual ssize_t Read(void *buffer, size_t size); 21 virtual ssize_t Write(const void *buffer, size_t size); 22 23 bool operator!() const; 24 bool fail() const; 25 26 private: 27 void _SendFile(); 28 29 char fServer[256]; 30 char fQueue[256]; 31 char fFile[256]; 32 char fUser[256]; 33 int32 fJobId; 34 fstream fStream; 35 bool fError; 36 }; 37 38 39 inline bool 40 LprTransport::fail() const 41 { 42 return fError; 43 } 44 45 46 inline bool 47 LprTransport::operator!() const 48 { 49 return fail(); 50 } 51 52 #endif // __LprTransport_H 53