#include <OutputStreamWriter.h>
Definition at line 25 of file OutputStreamWriter.h.
◆ OutputStreamWriter() [1/2]
참조된 스트림과 엔코더로 객체를 구성한다. _output과 _encoder는 객체의 생면주기동안 유효해야 하며, _output은 close()
에서 close하지 않는다.
- Parameters
-
◆ OutputStreamWriter() [2/2]
넘겨받은 스트림과 디코더로 객체를 구성한다. close()
에서 _pOutput의 close()가 호출되고 _pOutput과 _pEncoder는 파괴된다.
- Parameters
-
◆ ~OutputStreamWriter()
OutputStreamWriter::~OutputStreamWriter |
( |
| ) |
|
|
virtual |
객체의 파괴를 수행한다. close하지 않았으면 close()
하며 예외가 발생하면 무시한다.
Definition at line 74 of file OutputStreamWriter.cpp.
75{
77 {
78 try
79 {
81 }
82 catch (Exception* cause)
83 {
86 }
87 }
88}
#define __DCL_TRACE1(fmt, arg1)
virtual String toString() const
virtual void close() __DCL_THROWS1(IOException *)
◆ close()
void OutputStreamWriter::close |
( |
| ) |
|
|
virtual |
객체를 닫는다. 넘겨받은 OutputStream과 CharsetEncoder는 파괴된다.
Definition at line 90 of file OutputStreamWriter.cpp.
92{
94
100
102 {
103 if (encoder)
105
106 try
107 {
108 output->close();
109 }
110 catch (Exception* cause)
111 {
112 e = cause;
113 }
115 }
116
117 if (e)
118 throw e;
119}
#define __DCL_ASSERT_HANDLE(expr)
CharsetEncoder * __encoder
◆ flush()
void OutputStreamWriter::flush |
( |
| ) |
|
|
virtual |
◆ toString()
virtual String OutputStreamWriter::toString |
( |
| ) |
const |
|
virtual |
파생클래스를 위한 생성자이다. 객체의 구성에 대하여 간략한 요약을 리턴한다.
Reimplemented from Object.
◆ write()
Writer & OutputStreamWriter::write |
( |
const wchar_t * | _buf, |
|
|
size_t | _n ) |
|
virtual |
텍스트를 출력한다.
- Parameters
-
_buf | 버퍼 |
_n | 버퍼의 크기가 _n개의 wchar_t 문자 |
- Returns
- Writer&
Implements Writer.
Definition at line 129 of file OutputStreamWriter.cpp.
131{
134
136
137 const wchar_t* pCur = _buf;
138 const wchar_t* pEnd = _buf + _n;
140 size_t nInCount;
141
142 while ((nInCount = pEnd - pCur) > 0)
143 {
145 int r =
__encoder->encode(pCur, nInCount, aOutBuf, nOutCount);
147 throw (
new IOException(
toString(),
new CharsetConvertException(
r)));
148 __output->write(aOutBuf, nOutCount);
149 pCur += nInCount;
150 }
151
152 return *this;
153}
#define __countof(array, type)
#define __DCL_ASSERT_PARAM(expr)
#define __DCL_ASSERT(expr)
virtual String toString() const
◆ __closeDestroy
bool OutputStreamWriter::__closeDestroy |
|
protected |
◆ __encoder
◆ __output
The documentation for this class was generated from the following files: