blob: 9d84d7fc2bec40832002dcf841091f25e594410b (
plain)
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
|
// -*- C++ -*-
//=============================================================================
/**
* @file CE_fostream.h
*
* $Id$
*
* @author Si Mong Park <spark@ociweb.com>
*
* This is a helper class to simulate basic functions of fostream for
* Windows CE since WinCE does not have IO stream.
*
* Note that the numeric base conversion does not work and will be displayed
* as received.
*/
// ============================================================================
#ifndef ACE_CE_fostream_h
#define ACE_CE_fostream_h
#include "ace/config-all.h"
#if defined (ACE_HAS_WINCE) && defined (ACE_LACKS_IOSTREAM_TOTALLY)
#include "ace/Null_Mutex.h"
#include "ace/Singleton.h"
#ifdef ostream
#undef ostream
#endif
#ifdef OFSTREAM
#undef OFSTREAM
#endif // OFSTREAM
#define ostream ACE_CE_fostream
#define OFSTREAM ACE_CE_fostream
#define dec ACE_CE_fostream::dec
#define oct ACE_CE_fostream::oct
#define hex ACE_CE_fostream::hex
#define endl ACE_TEXT("\n")
class ACE_CE_fostream
{
public:
friend class ACE_Singleton<ACE_CE_fostream, ACE_Null_Mutex>;
enum NUM_TYPE {
// These numbers are not really meaningful for this class; set same as defined in ios.
// Also, base formatting works only for the integer types.
dec = 0x0010,
oct = 0x0020,
hex = 0x0040
};
static ACE_CE_fostream* instance (void);
FILE* open(const ACE_TCHAR *prog_name);
ACE_CE_fostream& operator << (NUM_TYPE);
ACE_CE_fostream& operator << (unsigned char);
ACE_CE_fostream& operator << (const ACE_ANTI_TCHAR *);
ACE_CE_fostream& operator << (ACE_ANTI_TCHAR);
ACE_CE_fostream& operator << (const ACE_TCHAR*);
ACE_CE_fostream& operator << (ACE_TCHAR);
ACE_CE_fostream& operator << (short);
ACE_CE_fostream& operator << (int);
ACE_CE_fostream& operator << (unsigned int);
ACE_CE_fostream& operator << (long);
ACE_CE_fostream& operator << (unsigned long);
ACE_CE_fostream& operator << (float);
ACE_CE_fostream& operator << (double);
ACE_CE_fostream& operator << (long double);
ACE_CE_fostream& operator << (const void *);
private:
ACE_CE_fostream();
~ACE_CE_fostream();
/**
* The ostream where logging messages can be written.
*/
ACE_OSTREAM_TYPE *ostream_;
/**
* Currently set numeric base.
*/
NUM_TYPE displayMode_;
static ACE_CE_fostream* instance_;
};
typedef ACE_Singleton<ACE_CE_fostream, ACE_Null_Mutex> ACE_CE_OSTREAM;
#endif /* ACE_HAS_WINCE && ACE_LACKS_IOSTREAM_TOTALLY */
#endif /* ACE_CE_fostream_h */
|