NetBurner 3.5.8
PDF Version
Toggle main menu visibility
web_buffers.h
1
/*NB_REVISION*/
2
3
/*NB_COPYRIGHT*/
4
5
#ifndef _WEB_BUFFERS_H
6
#define _WEB_BUFFERS_H
7
#include <nbstring.h>
8
9
13
14
19
class
buffer_object
20
{
21
public
:
22
// A write of ZERO bytes indicates end of data stream
23
virtual
int
WriteData(
const
unsigned
char
*pCopyFrom,
int
num_bytes) = 0;
24
virtual
int
ReadFrom(
int
fd) = 0;
25
virtual
void
ProcessHeader(
const
char
* hdr) {};
26
};
27
31
class
SimpleBufferObject :
public
buffer_object
32
{
33
protected
:
34
unsigned
char
*cp_to;
35
int
space_left;
36
int
used;
37
public
:
38
39
virtual
int
WriteData(
const
unsigned
char
*pCopyFrom,
int
num_bytes);
40
virtual
int
ReadFrom(
int
fd);
41
42
SimpleBufferObject(
unsigned
char
*p,
int
len)
43
{
44
cp_to = p;
45
space_left = len;
46
used = 0;
47
};
48
int
AmountUsed() {
return
used; };
49
};
50
54
class
StringBufferObject :
public
buffer_object
55
{
56
NBString
& TheString;
57
public
:
58
59
virtual
int
WriteData(
const
unsigned
char
*pCopyFrom,
int
num_bytes);
60
virtual
int
ReadFrom(
int
fd);
61
62
StringBufferObject(
NBString
& s) :TheString(s){};
63
};
64
66
67
#endif
NBString
Lightweight alternative to C++ CString class.
Definition
nbstring.h:118
buffer_object
Base class for web client response buffers.
Definition
web_buffers.h:20
nbrtos
include
webclient
web_buffers.h
Generated by
1.18.0