DCL 4.0
Loading...
Searching...
No Matches
OutputStream.cpp
Go to the documentation of this file.
1#if 0
2#include <string.h>
3#include <stdio.h>
4#include <errno.h>
5#endif
6
7#include <dcl/Object.h>
8
9#if __DCL_HAVE_ALLOC_DEBUG
10#undef __DCL_ALLOC_LEVEL
11#define __DCL_ALLOC_LEVEL __DCL_ALLOC_INTERNAL
12#endif
13
14#include <dcl/Numeric.h>
15#include <dcl/OutputStream.h>
16
17__DCL_BEGIN_NAMESPACE
18
19#undef __THIS_FILE__
20static const char_t __THIS_FILE__[] = __T("dcl/Stream.cpp");
21
23
24void OutputStream::close()
26{
27}
28
29void OutputStream::flush()
31{
32}
33
34int OutputStream::vprintf(const char* _format, va_list _arglist)
36{
37 __DCL_ASSERT_PARAM(_format != NULL);
38
39 ByteBuffer* buf = ByteBuffer::create(256);
40 int n = ByteBuffer::vformat(buf, _format, _arglist);
41 write(buf->data(), n);
42 buf->release();
43 return n;
44}
45
46int OutputStream::printf(const char* _format, ...)
48{
49 va_list arglist;
50 va_start(arglist, _format);
51 int r = vprintf(_format, arglist);
52 va_end(arglist);
53 return r;
54}
55
58{
59 out.write("\n", 1);
60 out.flush();
61 return out;
62}
63
64#if defined(__GNUC__) || defined(_WIN64)
65const struct __endl endl;
66#else
67#undef endl
68const struct __endl __endl__;
70 return __endl__;
71}
72#endif
73
74__DCL_END_NAMESPACE
#define __THIS_FILE__
Definition _trace.h:14
#define NULL
Definition Config.h:340
#define DCLCAPI
Definition Config.h:100
wchar_t char_t
Definition Config.h:275
#define __DCL_THROWS1(e)
Definition Config.h:167
#define __DCL_ASSERT_PARAM(expr)
Definition Object.h:384
#define IMPLEMENT_CLASSINFO(class_name, base_class_name)
Definition Object.h:228
#define __T(str)
Definition Object.h:44
DCLCAPI OutputStream & operator<<(OutputStream &out, const __endl &) __DCL_THROWS1(IOException *)
DCLCAPI const __endl endl()
const struct __endl __endl__
#define endl
ByteString r
ByteBuffer * buf
void CharsetConvertException *size_t n
Definition SQLField.cpp:253