xref: /haiku/src/add-ons/input_server/methods/pen/compat/StringIO.h (revision ed24eb5ff12640d052171c6a7feba37fab8a75d1)
1 /*
2  * minimalistic Dano-ilke BStringIO
3  * (c) 2007, François Revol.
4  */
5 #include <BeBuild.h>
6 #ifdef B_BEOS_VERSION_DANO
7 #include_next <StringIO.h>
8 #else
9 
10 #ifndef _STRING_IO_H
11 #define _STRING_IO_H
12 
13 #include <DataIO.h>
14 #include <Rect.h>
15 #include <String.h>
16 //#include <stdint.h>
17 
18 // stripped down BStringIO
19 
20 class BStringIO : public BPositionIO {
21 public:
22 	BStringIO();
23 virtual ~BStringIO();
24 
25 virtual	ssize_t		ReadAt(off_t pos, void *buffer, size_t size);
26 virtual	ssize_t		WriteAt(off_t pos, const void *buffer, size_t size);
27 
28 virtual	off_t		Seek(off_t pos, uint32 seek_mode);
29 virtual off_t		Position() const;
30 virtual status_t	SetSize(off_t size);
31 
32 //		void		SetBlockSize(size_t blocksize);
33 
34 const	char*		String() const;
35 //		size_t		StringLength() const;
36 
37 BStringIO & operator<<(const BString & s);
38 BStringIO & operator<<(const BRect & r);
39 
40 
41 private:
42 	off_t fPosition;
43 	BString *fString;
44 };
45 
46 
47 
48 #endif /* _STRING_IO_H */
49 
50 #endif
51