/*
This file is part of Fennix Kernel.
Fennix Kernel is free software: you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation, either version 3 of
the License, or (at your option) any later version.
Fennix Kernel is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Fennix Kernel. If not, see .
*/
#pragma once
#include
#include
#include
#include
namespace std
{
template >
class basic_istream : virtual public std::basic_ios
{
};
template >
class basic_iostream : public basic_istream, public basic_ostream
{
private:
void init(std::basic_streambuf *sb)
{
this->basic_istream::rdbuf(sb);
this->basic_ostream::rdbuf(sb);
}
public:
typedef CharT char_type;
typedef Traits::char_type traits_type;
typedef Traits::int_type int_type;
typedef Traits::pos_type pos_type;
typedef Traits::off_type off_type;
explicit basic_iostream(std::basic_streambuf *sb)
{
this->init(sb);
}
basic_iostream(const basic_iostream &other) = delete;
virtual ~basic_iostream() = default;
basic_iostream &operator=(const basic_iostream &other) = delete;
protected:
basic_iostream(basic_iostream &&other)
{
this->rdbuf(other.rdbuf());
other.rdbuf(nullptr);
}
basic_iostream &operator=(basic_iostream &&other);
void swap(basic_iostream &other)
{
std::swap(this->rdbuf(), other.rdbuf());
}
};
typedef basic_istream istream;
typedef basic_istream wistream;
typedef basic_iostream iostream;
typedef basic_iostream wiostream;
}