【C++】STL(Standard Template Library)相談室 9
at TECH
[
2ch
|
▼Menu
]
■コピペモード
□
スレを通常表示
□
オプションモード
□このスレッドのURL
■項目テキスト
50:デフォルトの名無しさん 08/02/28 14:03:23 >>49 ストリームクラスの基底クラスではない。 継承関係にはない。 ストリームバッファクラス(basic_streambuf<>)のオブジェクトへの ポインタを保持している。 51:デフォルトの名無しさん 08/02/28 14:29:38 テキスト版は出来ますた。 //--------------------------------------------------------------------------- bool Test::LoadFromFile(const char *filepath, bool bAdd) { ifstream fs(filepath); string SBuf((istreambuf_iterator<char>(fs)), istreambuf_iterator<char>()); //stringからバッファへロード } //--------------------------------------------------------------------------- bool Test::SaveToFile(const char *filepath) { string SBuf(Text()); //バッファからstringへセーブ ofstream fs(filepath); copy(SBuf.begin(), SBuf.end(), ostreambuf_iterator<char>(fs)); } //---------------------------------------------------------------------------
次ページ
最新レス表示
スレッドの検索
類似スレ一覧
話題のニュース
おまかせリスト
▼オプションを表示
レスジャンプ
mixiチェック!
Twitterに投稿
オプション
しおりを挟む
スレッドに書込
スレッドの一覧
暇つぶし2ch
4965日前に更新/192 KB
担当:undef