]> git.donarmstrong.com Git - lilypond.git/blob - flower/include/memory-stream.hh
* Documentation/topdocs/NEWS.tely: add inputfileref macro.
[lilypond.git] / flower / include / memory-stream.hh
1 /*
2   memory-stream.hh -- declare Memory_out_stream
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 class Memory_out_stream
17 {
18   char *buffer_;
19   ssize_t size_;
20   int buffer_blocks_;
21   FILE *file_;
22
23   static cookie_io_functions_t functions_;
24   static const int block_size_;
25
26   static ssize_t reader (void*, char*,  size_t);
27   static ssize_t writer (void*, const char*,  size_t);
28   static int seeker (void*, off64_t *, int whence);
29   static int cleaner (void*);
30
31
32 public:
33   ~Memory_out_stream ();
34   Memory_out_stream ();
35   FILE *get_file () const;
36   char const *get_string() const;
37   ssize_t get_length () const;
38 };
39
40 #endif /* MEMORY_STREAM_HH */