Removed fast_oss in favour of simple ostringsream

This commit is contained in:
gabi
2014-03-07 00:06:34 +02:00
parent 5f4bc3086a
commit bf75bfd9fb
5 changed files with 53 additions and 47 deletions

View File

@@ -10,12 +10,15 @@ public:
str_devicebuf() = default;
~str_devicebuf() = default;
str_devicebuf(const str_devicebuf& other):std::streambuf(),_str(other._str) {}
str_devicebuf& operator=(const str_devicebuf other) {
if(this != &other)
_str = other._str;
return *this;
str_devicebuf(str_devicebuf&& other) :std::streambuf(), _str(std::move(other._str)) {
other._str.clear();
}
str_devicebuf& operator=(const str_devicebuf&) = delete;
str_devicebuf& operator=(str_devicebuf&&) = delete;
const std::string& str_ref() const {
return _str;
std::ostringstream oss;
@@ -50,12 +53,11 @@ public:
~fast_oss() = default;
fast_oss(const fast_oss& other) :std::basic_ios<char>(), std::ostream(&_dev), _dev(other._dev) {}
fast_oss& operator=(const fast_oss& other) {
if(&other != this)
_dev = other._dev;
return *this;
}
fast_oss(fast_oss&& other) :std::basic_ios<char>(), std::ostream(&_dev), _dev(std::move(other._dev)) {}
fast_oss& operator=(const fast_oss& other) = delete;
const std::string& str_ref() const {
return _dev.str_ref();