/// SetBufferSize - Set the internal buffer size to the specified amount
/// instead of the default.
- void SetBufferSize(size_t Size=4096) {
- assert(Size >= 64 &&
- "Buffer size must be somewhat large for invariants to hold");
- flush();
-
- delete [] OutBufStart;
- OutBufStart = new char[Size];
- OutBufEnd = OutBufStart+Size;
- OutBufCur = OutBufStart;
- Unbuffered = false;
- }
+ void SetBufferSize(size_t Size=4096);
size_t GetBufferSize() const {
return OutBufEnd - OutBufStart;
/// unbuffered the stream will flush after every write. This routine
/// will also flush the buffer immediately when the stream is being
/// set to unbuffered.
- void SetUnbuffered() {
- flush();
-
- delete [] OutBufStart;
- OutBufStart = OutBufEnd = OutBufCur = 0;
- Unbuffered = true;
- }
+ void SetUnbuffered();
size_t GetNumBytesInBuffer() const {
return OutBufCur - OutBufStart;
// An out of line virtual method to provide a home for the class vtable.
void raw_ostream::handle() {}
+void raw_ostream::SetBufferSize(size_t Size) {
+ assert(Size >= 64 &&
+ "Buffer size must be somewhat large for invariants to hold");
+ flush();
+
+ delete [] OutBufStart;
+ OutBufStart = new char[Size];
+ OutBufEnd = OutBufStart+Size;
+ OutBufCur = OutBufStart;
+ Unbuffered = false;
+}
+
+void raw_ostream::SetUnbuffered() {
+ flush();
+
+ delete [] OutBufStart;
+ OutBufStart = OutBufEnd = OutBufCur = 0;
+ Unbuffered = true;
+}
+
raw_ostream &raw_ostream::operator<<(unsigned long N) {
// Zero is a special case.
if (N == 0)