-
Notifications
You must be signed in to change notification settings - Fork 0
/
BasicReaderWriter.h
43 lines (35 loc) · 1.18 KB
/
BasicReaderWriter.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//// THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF
//// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
//// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//// PARTICULAR PURPOSE.
////
//// Copyright (c) Microsoft Corporation. All rights reserved
#pragma once
#include <ppltasks.h>
// A simple reader/writer class that provides support for reading and writing
// files on disk. Provides synchronous and asynchronous methods.
ref class BasicReaderWriter
{
private:
Windows::Storage::StorageFolder^ m_location;
Platform::String^ m_locationPath;
internal:
BasicReaderWriter();
BasicReaderWriter(
_In_ Windows::Storage::StorageFolder^ folder
);
Platform::Array<byte>^ ReadData(
_In_ Platform::String^ filename
);
concurrency::task<Platform::Array<byte>^> ReadDataAsync(
_In_ Platform::String^ filename
);
uint32 WriteData(
_In_ Platform::String^ filename,
_In_ const Platform::Array<byte>^ fileData
);
concurrency::task<void> WriteDataAsync(
_In_ Platform::String^ filename,
_In_ const Platform::Array<byte>^ fileData
);
};