127 lines
1.4 KiB
C++
Executable File
127 lines
1.4 KiB
C++
Executable File
/*
|
|
* This file is a part of Winix
|
|
* and is not publicly distributed
|
|
*
|
|
* Copyright (c) 2010, Tomasz Sowa
|
|
* All rights reserved.
|
|
*
|
|
*/
|
|
|
|
#include "textstream.h"
|
|
|
|
|
|
|
|
|
|
void TextStream::Clear()
|
|
{
|
|
buffer.clear();
|
|
}
|
|
|
|
const std::string & TextStream::Str() const
|
|
{
|
|
return buffer;
|
|
}
|
|
|
|
|
|
const char * TextStream::CStr() const
|
|
{
|
|
return buffer.c_str();
|
|
}
|
|
|
|
|
|
|
|
TextStream & TextStream::operator<<(const char * str)
|
|
{
|
|
buffer += str;
|
|
|
|
return *this;
|
|
}
|
|
|
|
TextStream & TextStream::operator<<(const std::string * str)
|
|
{
|
|
buffer += *str;
|
|
|
|
return *this;
|
|
}
|
|
|
|
TextStream & TextStream::operator<<(const std::string & str)
|
|
{
|
|
buffer += str;
|
|
|
|
return *this;
|
|
}
|
|
|
|
TextStream & TextStream::operator<<(char v)
|
|
{
|
|
buffer += v;
|
|
|
|
return *this;
|
|
}
|
|
|
|
|
|
TextStream & TextStream::operator<<(int v)
|
|
{
|
|
char buf[50];
|
|
|
|
sprintf(buf, "%d", v);
|
|
buffer += buf;
|
|
|
|
return *this;
|
|
}
|
|
|
|
|
|
TextStream & TextStream::operator<<(long v)
|
|
{
|
|
char buf[50];
|
|
|
|
sprintf(buf, "%ld", v);
|
|
buffer += buf;
|
|
|
|
return *this;
|
|
}
|
|
|
|
|
|
TextStream & TextStream::operator<<(unsigned int v)
|
|
{
|
|
char buf[50];
|
|
|
|
sprintf(buf, "%u", v);
|
|
buffer += buf;
|
|
|
|
return *this;
|
|
}
|
|
|
|
|
|
TextStream & TextStream::operator<<(unsigned long v)
|
|
{
|
|
char buf[50];
|
|
|
|
sprintf(buf, "%lu", v);
|
|
buffer += buf;
|
|
|
|
return *this;
|
|
}
|
|
|
|
|
|
TextStream & TextStream::operator<<(double v)
|
|
{
|
|
char buf[50];
|
|
|
|
sprintf(buf, "%f", v);
|
|
buffer += buf;
|
|
|
|
return *this;
|
|
}
|
|
|
|
|
|
TextStream & TextStream::operator<<(const void * v)
|
|
{
|
|
char buf[50];
|
|
|
|
sprintf(buf, "%p", v);
|
|
buffer += buf;
|
|
|
|
return *this;
|
|
}
|
|
|