inline void ReadBSTRFromStream( std::basic_istream< CharT, CharTraitsT > &Istream, ATL::CComBSTR &Str ) { Str.Empty(); CharT Buff[256]; do { Istream.read( Buff, APL_ARRSIZE(Buff) ); ATL::CComBSTR TmpStr(Istream.gcount(), Buff); Str.Append(TmpStr); } while(Istream.gcount() == APL_ARRSIZE(Buff)); }
inline void ReadBSTRFromStream( std::basic_istream< WCHAR, CharTraitsT > &Istream, ATL::CComBSTR &Str ) { //Оптимизация исключающая временные объекты Str.Empty(); WCHAR Buff[256]; do { Istream.read( Buff, APL_ARRSIZE(Buff) ); Str.Append(Buff, Istream.gcount()); } while(Istream.gcount() == APL_ARRSIZE(Buff)); }