X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=flower%2Finclude%2Fmemory-stream.hh;h=dab6732e775fb7ee3e87785d435f0733b9066632;hb=81f52a2e6a716e9d5d91d4455ba1079518307931;hp=822c4470d2416c29f4f4be4fed24db47e79be478;hpb=6e9040684ec18353e138194d7a1d557acf791748;p=lilypond.git diff --git a/flower/include/memory-stream.hh b/flower/include/memory-stream.hh index 822c4470d2..dab6732e77 100644 --- a/flower/include/memory-stream.hh +++ b/flower/include/memory-stream.hh @@ -1,22 +1,32 @@ /* - memory-stream.hh -- declare + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2005--2010 Han-Wen Nienhuys - (c) 2005 Han-Wen Nienhuys + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #ifndef MEMORY_STREAM_HH #define MEMORY_STREAM_HH -#include +#include #include +using namespace std; +#include "libc-extension.hh" +#include "file-cookie.hh" -/* - TODO: read support as well. - */ class Memory_out_stream { char *buffer_; @@ -24,20 +34,19 @@ class Memory_out_stream int buffer_blocks_; FILE *file_; - static cookie_io_functions_t functions_; + static lily_cookie_io_functions_t functions_; static const int block_size_; - static ssize_t reader (void*, char*, size_t); - static ssize_t writer (void*, const char*, size_t); - static int seeker (void*, off64_t *, int whence); - static int cleaner (void*); - - public: - ~Memory_out_stream (); + static ssize_t reader (void *, char *, size_t); + static ssize_t writer (void *, char const *, size_t); + static int seeker (void *, off64_t *, int); + static int cleaner (void *); + Memory_out_stream (); + ~Memory_out_stream (); FILE *get_file () const; - char const *get_string() const; + char const *get_string () const; ssize_t get_length () const; };