29#ifndef _gd_io_stream_h
30#define _gd_io_stream_h
38class BGD_EXPORT_DATA_IMPL istreamIOCtx :
public gdIOCtx {
40 typedef std::istream stream_type;
47 istreamIOCtx(stream_type &__stream) { init(&__stream); }
49 static int Getbuf(gdIOCtxPtr ctx,
void *buf,
int size);
50 static int Putbuf(gdIOCtxPtr,
const void *,
int);
51 static void Putchar(gdIOCtxPtr,
int);
52 static int Getchar(gdIOCtxPtr ctx);
53 static int Seek(gdIOCtxPtr ctx,
const int pos);
54 static long Tell(gdIOCtxPtr ctx);
55 static void FreeCtx(gdIOCtxPtr ctx);
57 void init(stream_type *__stream)
70 stream_type *_M_stream;
74inline gdIOCtxPtr gdNewIstreamCtx(std::istream *__stream) {
return new istreamIOCtx(*__stream); }
78class BGD_EXPORT_DATA_IMPL ostreamIOCtx :
public gdIOCtx {
80 typedef std::ostream stream_type;
87 ostreamIOCtx(stream_type &__stream) { init(&__stream); }
89 static int Getbuf(gdIOCtxPtr,
void *,
int);
90 static int Putbuf(gdIOCtxPtr ctx,
const void *buf,
int size);
91 static int Getchar(gdIOCtxPtr);
92 static void Putchar(gdIOCtxPtr ctx,
int a);
93 static int Seek(gdIOCtxPtr ctx,
const int pos);
94 static long Tell(gdIOCtxPtr ctx);
95 static void FreeCtx(gdIOCtxPtr ctx);
97 void init(stream_type *__stream)
106 _M_stream = __stream;
110 stream_type *_M_stream;
114inline gdIOCtxPtr gdNewOstreamCtx(std::ostream *__stream) {
return new ostreamIOCtx(*__stream); }