file_stream::open_istream 方法

打开表示特定文件的新输入流。 磁盘上应已存在文件,否则将引发异常。

static pplx::task<streams::basic_istream<_CharType>> open_istream(
   const utility::string_t &file_name,
   std::ios_base::openmode mode = std::ios_base::in,
   #ifdef _MS_WINDOWS int prot = (int) std::ios_base::_Openprot #else int prot = 0 #endif
);

static pplx::task<streams::basic_istream<_CharType>> open_istream(
   ::Windows::Storage::StorageFile^ file,
   std::ios_base::openmode mode = std::ios_base::in
);

参数

  • file_name
    文件的名称

  • mode
    文件的打开模式

  • prot
    文件保护模式

  • file
    表示该文件的 StorageFile 引用

返回值

task 在完成时返回已打开的输入流。

要求

**标头:**filestream.h

**命名空间:**concurrency::streams

请参见

参考

file_stream 类