Richard Boegli's CnC_Generals_Zero_Hour Fork WIP
This is documentation of Richard Boegil's Zero Hour Fork
 
Loading...
Searching...
No Matches
streamer.h
Go to the documentation of this file.
1/*
2** Command & Conquer Generals Zero Hour(tm)
3** Copyright 2025 Electronic Arts Inc.
4**
5** This program is free software: you can redistribute it and/or modify
6** it under the terms of the GNU General Public License as published by
7** the Free Software Foundation, either version 3 of the License, or
8** (at your option) any later version.
9**
10** This program is distributed in the hope that it will be useful,
11** but WITHOUT ANY WARRANTY; without even the implied warranty of
12** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13** GNU General Public License for more details.
14**
15** You should have received a copy of the GNU General Public License
16** along with this program. If not, see <http://www.gnu.org/licenses/>.
17*/
18
19#ifndef STREAMER_HEADER
20#define STREAMER_HEADER
21
22#include <stdlib.h>
23#include <stdio.h>
24#include <stdarg.h>
25#include <iostream.h>
26#include <string.h>
27
28// Windows headers have a tendency to redefine IN
29#ifdef IN
30#undef IN
31#endif
32#define IN const
33
34#include "odevice.h"
35
36#ifndef STREAMER_BUFSIZ
37// This limits the number of characters that can be sent to a single 'print'
38// call. If your debug message is bigger than this, it will get split over
39// multiple 'print' calls. That's usually not a problem.
40 #define STREAMER_BUFSIZ 2048
41#endif
42
43
44// Provide a streambuf interface for a class that can 'print'
45class Streamer : public streambuf
46{
47 public:
49 virtual ~Streamer();
50
52
53 protected:
54 // Virtual methods from streambuf
55 int xsputn(const char* s, int n); // buffer some characters
56 int overflow(int = EOF); // flush buffer and make more room
57 int underflow(void); // Does nothing
58 int sync();
59
60 int doallocate(); // allocate a buffer
61
62
64};
65
66#endif
int xsputn(const char *s, int n)
OutputDevice * Output_Device
Definition streamer.h:57
int doallocate()
int sync()
int underflow(void)
virtual ~Streamer()
int setOutputDevice(OutputDevice *output_device)
int overflow(int=EOF)
OutputDevice * output_device
Definition main.cpp:59