]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/memory-stream.hh
* lily/pfb.cc (LY_DEFINE): ly:ttf->pfa, new function.
[lilypond.git] / flower / include / memory-stream.hh
1 /*
2   memory-stream.hh -- declare
3
4   source file of the GNU LilyPond music typesetter
5
6   (c) 2005 Han-Wen Nienhuys <hanwen@xs4all.nl>
7
8 */
9
10 #ifndef MEMORY_STREAM_HH
11 #define MEMORY_STREAM_HH
12
13 #include <stdio.h>
14 #include <unistd.h>
15
16
17 /*
18   TODO: read support as well.
19  */
20 class Memory_out_stream
21 {
22   char *buffer_;
23   ssize_t size_;
24   int buffer_blocks_;
25   FILE *file_;
26
27   static cookie_io_functions_t functions_;
28   static const int block_size_;
29
30   static ssize_t reader (void*, char*,  size_t);
31   static ssize_t writer (void*, const char*,  size_t);
32   static int seeker (void*, off64_t *, int whence);
33   static int cleaner (void*);
34
35
36 public:
37   ~Memory_out_stream ();
38   Memory_out_stream ();
39   FILE *get_file () const;
40   char const *get_string() const;
41   ssize_t get_length () const;
42 };
43
44 #endif /* MEMORY_STREAM_HH */