C++のiostream
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
[[藤井のスタートページ]]
* C++のiostream [#fafbd692]
** C++のiostreamの感想など、、 [#a35196fb]
- [[C++のiostream感想-その1-]]
- [[C++のiostream感想-その2-]]
- [[C++のiostream感想-その3-]] rdbuf() の謎
** C++ iostream の実装 [#h411c29c]
TCP/IP で connect した socket を iostream 化する実装例を...
- [[C++ iostream 実装例 その 1]] - 1 octet 入出力だけで...
- [[C++ iostream 実装例 その 2]] - streambuf を iostream...
- [[C++ iostream 実装例 その 3]] - buffer 利用で streamb...
- [[C++ iostream 実装例 その 4]] - backup 列の導入
- [[C++ iostream 実装例 その 5]] - streambuf から iostre...
- [[C++ iostream 実装例 その 6]] - iostream化 への strea...
- [[C++ iostream 実装例 その 7]] - iostream化
実装にあたって規格を読んでの考察や規格の抜粋、(私の)解...
- [[C++ iostream 実装資料1]]
- [[C++ iostream 実装資料2]]
- [[C++ iostream 実装資料3]]
** その他、雑メモ [#eaf4862e]
- [[標準入出力のバイナリモード]]
- [[iostream と streambuf]]
- [[tcp を C++ iostream 化する]]
- [[getline()とget()]]
- [[iostreamの例外の制御]]
- [[tcp を iostream化して速度を比較]]
大雑把に言うと
- iostream(istream、ostream も)は基本的に
入出力を streambuf で行っている。つまり入出力は実はstream...
- streambuf と iostream を結びつけるのは iostream の cons...
iostream の constractor は streambuf object の pointer を...
実際には streambuf も iostream も template なので、
template <class Ch, class Tr=std::char_traits<Ch> >
class basic_mystrembuf : basic_streambuf<Ch, Tr>
{
public:
basic_mystream()
virtual ~basic_mystream();
:
};
template <class Ch, class Tr=std::char_traits<Ch> >
class basic_mystream : public std::basic_iostream<Ch,Tr>
{
public:
basic_mystream()
: std::basic_iostream<Ch,Tr>(new basic_mystreambu...
{
}
~basic_mystream()
{
}
};
typedef basic_mystreambuf<char> mystreambuf;
typedef basic_mystream<char> mystream;
とすればよいらしい。でも fstream を覗いてみると、ifstream...
作っているようだ。
C++でiostreamを拡張したい時の参考 URL。当初、参考にしよう
としたが、結局は規格を調べざるを得なかった(上記「実証資...
参照)。
- http://www.jah.ne.jp/~naoyuki/Writings/ExtIos.html
- http://www.kab-studio.biz/Programing/Codian/iostream/06...
終了行:
[[藤井のスタートページ]]
* C++のiostream [#fafbd692]
** C++のiostreamの感想など、、 [#a35196fb]
- [[C++のiostream感想-その1-]]
- [[C++のiostream感想-その2-]]
- [[C++のiostream感想-その3-]] rdbuf() の謎
** C++ iostream の実装 [#h411c29c]
TCP/IP で connect した socket を iostream 化する実装例を...
- [[C++ iostream 実装例 その 1]] - 1 octet 入出力だけで...
- [[C++ iostream 実装例 その 2]] - streambuf を iostream...
- [[C++ iostream 実装例 その 3]] - buffer 利用で streamb...
- [[C++ iostream 実装例 その 4]] - backup 列の導入
- [[C++ iostream 実装例 その 5]] - streambuf から iostre...
- [[C++ iostream 実装例 その 6]] - iostream化 への strea...
- [[C++ iostream 実装例 その 7]] - iostream化
実装にあたって規格を読んでの考察や規格の抜粋、(私の)解...
- [[C++ iostream 実装資料1]]
- [[C++ iostream 実装資料2]]
- [[C++ iostream 実装資料3]]
** その他、雑メモ [#eaf4862e]
- [[標準入出力のバイナリモード]]
- [[iostream と streambuf]]
- [[tcp を C++ iostream 化する]]
- [[getline()とget()]]
- [[iostreamの例外の制御]]
- [[tcp を iostream化して速度を比較]]
大雑把に言うと
- iostream(istream、ostream も)は基本的に
入出力を streambuf で行っている。つまり入出力は実はstream...
- streambuf と iostream を結びつけるのは iostream の cons...
iostream の constractor は streambuf object の pointer を...
実際には streambuf も iostream も template なので、
template <class Ch, class Tr=std::char_traits<Ch> >
class basic_mystrembuf : basic_streambuf<Ch, Tr>
{
public:
basic_mystream()
virtual ~basic_mystream();
:
};
template <class Ch, class Tr=std::char_traits<Ch> >
class basic_mystream : public std::basic_iostream<Ch,Tr>
{
public:
basic_mystream()
: std::basic_iostream<Ch,Tr>(new basic_mystreambu...
{
}
~basic_mystream()
{
}
};
typedef basic_mystreambuf<char> mystreambuf;
typedef basic_mystream<char> mystream;
とすればよいらしい。でも fstream を覗いてみると、ifstream...
作っているようだ。
C++でiostreamを拡張したい時の参考 URL。当初、参考にしよう
としたが、結局は規格を調べざるを得なかった(上記「実証資...
参照)。
- http://www.jah.ne.jp/~naoyuki/Writings/ExtIos.html
- http://www.kab-studio.biz/Programing/Codian/iostream/06...
ページ名: