xref: /haiku/src/add-ons/print/transports/ipp/IppTransport.h (revision 51978af14a173e7fae0563b562be5603bc652aeb)
1 // Sun, 18 Jun 2000
2 // Y.Takagi
3 
4 #ifndef __IppTransport_H
5 #define __IppTransport_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 IppTransport : public BDataIO {
19 public:
20 	IppTransport(BMessage *msg);
21 	virtual ~IppTransport();
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    __url[256];
30 	char    __user[256];
31 	char    __file[256];
32 	int32   __jobid;
33 	bool    __error;
34 	fstream __fs;
35 };
36 
37 inline bool IppTransport::fail() const
38 {
39 	return __error;
40 }
41 
42 inline bool IppTransport::operator !() const
43 {
44 	return fail();
45 }
46 
47 #endif	// __IppTransport_H
48