【C++】STL(Standard Template Library)相談室 9at TECH【C++】STL(Standard Template Library)相談室 9 - 暇つぶし2ch■コピペモード□スレを通常表示□オプションモード□このスレッドの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)); } //--------------------------------------------------------------------------- 次ページ最新レス表示レスジャンプ類似スレ一覧スレッドの検索話題のニュースおまかせリストオプションしおりを挟むスレッドに書込スレッドの一覧暇つぶし2ch