Ejemplo n.º 1
0
pplx::task<Concurrency::streams::streambuf<_CharType>> OPEN_R(const utility::string_t& name)
{
#if !defined(__cplusplus_winrt)
    return Concurrency::streams::file_buffer<_CharType>::open(name, std::ios_base::in);
#else
    auto file =
        pplx::create_task(KnownFolders::DocumentsLibrary->GetFileAsync(ref new Platform::String(name.c_str()))).get();

    return Concurrency::streams::file_buffer<_CharType>::open(file, std::ios_base::in);
#endif
}