added support for UTF-8
now the UTF-8 is a default charset git-svn-id: svn://ttmath.org/publicrep/winix/trunk@677 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
@@ -8,119 +8,6 @@
|
||||
*/
|
||||
|
||||
#include "textstream.h"
|
||||
#include "misc.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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user