2 * Copyright (c) 2017 Samsung Electronics Co., Ltd
4 * Licensed under the Flora License, Version 1.1 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
18 using System.Collections.Generic;
21 using System.Threading.Tasks;
24 namespace LibTVRefCommonPortable.Utils
27 /// An enumeration for the file open mode.
29 public enum UtilFileMode
40 /// An interface for the file operations
42 public interface IFileSystemAPIs
45 /// A directory path which should be used for app data storing.
53 /// A directory path which should be used for app resource storing.
55 string AppResourceStorage
61 /// A directory path which should be used for sharing between apps.
63 string PlatformShareStorage
69 /// A method opens a file on the given mode.
71 /// <param name="filePath">A file path</param>
72 /// <param name="mode">An opening mode</param>
73 /// <returns>A file descriptor</returns>
74 Stream OpenFile(string filePath, UtilFileMode mode);
77 /// A method flushing the stream to write remains.
79 /// <param name="stream">A file descriptor</param>
80 void Flush(Stream stream);
83 /// A method closes the file.
85 /// <param name="stream">A file descriptor</param>
86 void CloseFile(Stream stream);
89 /// A method checks if a file existence in the file system.
91 /// <param name="filePath">A file path</param>
92 /// <returns>An existence of the file</returns>
93 bool IsFileExist(String filePath);
96 /// A method checks if file is read to use.
98 /// <param name="filePath">A file path</param>
99 /// <returns>A status of ready</returns>
100 bool IsFileReady(String filePath);