-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathios_base
61 lines (53 loc) · 2.03 KB
/
ios_base
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*****************************************************************************/
// Filename: ios_base.h
/*****************************************************************************/
// Description: This class represents a the highest level base class from which everything is
// derived
/*****************************************************************************/
#ifndef _IOS_BASE_H
#define _IOS_BASE_H
namespace ppcStreams
{
typedef int streamsize;
static const char endl = '\n'; //Define newline character
const int MAX_SIZE_STD_STRING_IN_STREAM = 2048; //Limitation of library
//std::strings passed
//in and out can't exceed
//this size for single arg
//Can't resolve the true buffer
//space needed at run-time w/o
//heavy modification
class ios_base
{
public:
typedef char iostate;
static const iostate badbit, eofbit, failbit, goodbit;
typedef char openmode;
static const openmode app, ate, binary, in, out, trunc;
typedef int fmtflags;
static const fmtflags boolalpha, dec, fixed, hex,
internal, left, right, oct,
scientific, showbase, showpoint,
showpos, skipws, unitbuf,
upperbuf, uppercase;
public:
virtual ~ios_base();
bool bad();
bool good();
void setf(fmtflags flags);
streamsize precision ( ) const;
streamsize precision ( streamsize prec );
streamsize width() const;
streamsize width(streamsize w);
protected:
ios_base();
protected:
iostate _iostate; //bitmask for iostate
private:
fmtflags _fmtflags; //bitmask for formatting
openmode _openmode; //bitmask for open mode
streamsize _precision; //precision of floating point output
streamsize _width;
};
};
#endif