C# Class Com.Aurora.Shared.Helpers.FileIOHelper

Mostra file Open project: aurora-lzzp/Aurora-Weather Class Usage Examples

Public Methods

Method Description
AppendLogtoCacheAsync ( string LOG, string name = "BGLOG" ) : System.Threading.Tasks.Task
AppendLogtoCacheAsync ( CrashLog exception, string name = "crashLOG" ) : Task
CreateCacheFileAsync ( string name ) : Task
CreateWallPaperFileAsync ( string name ) : Task
DeleteLogAsync ( string fileName = "crashLOG" ) : System.Threading.Tasks.Task
GetBuffer ( StorageFile file ) : Task
GetBytesAsync ( StorageFile file ) : Task

Returns byte array from StorageFile. Author : Farhan Ghumra

GetFileFromLocalAsync ( string name ) : Task
GetFileUriFromAssetsAsync ( string path, int index, bool isShuffle = false ) : Task
GetFileUriFromLocalAsync ( string path, string fileName ) : Task
GetFilebyUriAsync ( Uri uri ) : Task
GetFilesFromAssetsAsync ( string path ) : Task>
GetFilesFromLocalAsync ( string path ) : Task>
GetThumbnailUrisFromAssetsAsync ( string path ) : string>>>.Task
ReadAllBytesFromInstallAsync ( string fileName ) : Task

从安装目录读取文件,返回 byte[]

ReadBufferFromAssetsAsync ( string fileName ) : Task

从Assets读取Buffer

ReadBufferFromStorageAsync ( string fileName ) : Task

从存储目录读取文本

ReadRandomAccessStreamByUriAsync ( Uri uri ) : Task
ReadRandomAccessStreamFromAssetsAsync ( string fileName ) : Task
ReadStringFromAssetsAsync ( string fileName ) : Task

Find file from localfolder, and read it

ReadStringFromStorageAsync ( string fileName ) : Task
RemoveFileFromLocalAsync ( string path, string key ) : System.Threading.Tasks.Task
RemoveLocalFilesWithKeywordAsync ( string key ) : System.Threading.Tasks.Task
SaveBuffertoStorageAsync ( string fileName, Windows.Storage.Streams.IBuffer buffer ) : System.Threading.Tasks.Task

将缓冲区写入存储目录(覆盖)

SaveFiletoLocalAsync ( StorageFile file, string desiredName ) : Task
SaveFiletoLocalAsync ( string path, StorageFile file, string desiredName ) : Task
SaveStringtoStorageAsync ( string fileName, string content ) : System.Threading.Tasks.Task

将文本写入存储目录(覆盖)

StreamToString ( Stream src ) : string

Convert UTF-8 encoding stream to string, sync

StringToStream ( string src ) : Stream

Convert UTF-8 encoding string to stream, sync

ToIRandomAccessStreamAsync ( byte bytestream ) : Task
WriteToStream ( Stream s, byte bytes ) : void

Writes byte array to stream. Author : Farhan Ghumra

WriteToStream ( Stream s, string txt ) : void

Writes string to stream. Author : Farhan Ghumra

Method Details

AppendLogtoCacheAsync() public static method

public static AppendLogtoCacheAsync ( string LOG, string name = "BGLOG" ) : System.Threading.Tasks.Task
LOG string
name string
return System.Threading.Tasks.Task

AppendLogtoCacheAsync() public static method

public static AppendLogtoCacheAsync ( CrashLog exception, string name = "crashLOG" ) : Task
exception Com.Aurora.AuWeather.Shared.CrashLog
name string
return Task

CreateCacheFileAsync() public static method

public static CreateCacheFileAsync ( string name ) : Task
name string
return Task

CreateWallPaperFileAsync() public static method

public static CreateWallPaperFileAsync ( string name ) : Task
name string
return Task

DeleteLogAsync() public static method

public static DeleteLogAsync ( string fileName = "crashLOG" ) : System.Threading.Tasks.Task
fileName string
return System.Threading.Tasks.Task

GetBuffer() public static method

public static GetBuffer ( StorageFile file ) : Task
file Windows.Storage.StorageFile
return Task

GetBytesAsync() public static method

Returns byte array from StorageFile. Author : Farhan Ghumra
public static GetBytesAsync ( StorageFile file ) : Task
file Windows.Storage.StorageFile
return Task

GetFileFromLocalAsync() public static method

public static GetFileFromLocalAsync ( string name ) : Task
name string
return Task

GetFileUriFromAssetsAsync() public static method

public static GetFileUriFromAssetsAsync ( string path, int index, bool isShuffle = false ) : Task
path string
index int
isShuffle bool
return Task

GetFileUriFromLocalAsync() public static method

public static GetFileUriFromLocalAsync ( string path, string fileName ) : Task
path string
fileName string
return Task

GetFilebyUriAsync() public static method

public static GetFilebyUriAsync ( Uri uri ) : Task
uri System.Uri
return Task

GetFilesFromAssetsAsync() public static method

public static GetFilesFromAssetsAsync ( string path ) : Task>
path string
return Task>

GetFilesFromLocalAsync() public static method

public static GetFilesFromLocalAsync ( string path ) : Task>
path string
return Task>

GetThumbnailUrisFromAssetsAsync() public static method

public static GetThumbnailUrisFromAssetsAsync ( string path ) : string>>>.Task
path string
return string>>>.Task

ReadAllBytesFromInstallAsync() public static method

从安装目录读取文件,返回 byte[]
public static ReadAllBytesFromInstallAsync ( string fileName ) : Task
fileName string
return Task

ReadBufferFromAssetsAsync() public static method

从Assets读取Buffer
public static ReadBufferFromAssetsAsync ( string fileName ) : Task
fileName string
return Task

ReadBufferFromStorageAsync() public static method

从存储目录读取文本
public static ReadBufferFromStorageAsync ( string fileName ) : Task
fileName string
return Task

ReadRandomAccessStreamByUriAsync() public static method

public static ReadRandomAccessStreamByUriAsync ( Uri uri ) : Task
uri System.Uri
return Task

ReadRandomAccessStreamFromAssetsAsync() public static method

public static ReadRandomAccessStreamFromAssetsAsync ( string fileName ) : Task
fileName string
return Task

ReadStringFromAssetsAsync() public static method

Find file from localfolder, and read it
public static ReadStringFromAssetsAsync ( string fileName ) : Task
fileName string file total name
return Task

ReadStringFromStorageAsync() public static method

public static ReadStringFromStorageAsync ( string fileName ) : Task
fileName string
return Task

RemoveFileFromLocalAsync() public static method

public static RemoveFileFromLocalAsync ( string path, string key ) : System.Threading.Tasks.Task
path string
key string
return System.Threading.Tasks.Task

RemoveLocalFilesWithKeywordAsync() public static method

public static RemoveLocalFilesWithKeywordAsync ( string key ) : System.Threading.Tasks.Task
key string
return System.Threading.Tasks.Task

SaveBuffertoStorageAsync() public static method

将缓冲区写入存储目录(覆盖)
public static SaveBuffertoStorageAsync ( string fileName, Windows.Storage.Streams.IBuffer buffer ) : System.Threading.Tasks.Task
fileName string 文件名
buffer Windows.Storage.Streams.IBuffer 要存储的缓冲区
return System.Threading.Tasks.Task

SaveFiletoLocalAsync() public static method

public static SaveFiletoLocalAsync ( StorageFile file, string desiredName ) : Task
file Windows.Storage.StorageFile
desiredName string
return Task

SaveFiletoLocalAsync() public static method

public static SaveFiletoLocalAsync ( string path, StorageFile file, string desiredName ) : Task
path string
file Windows.Storage.StorageFile
desiredName string
return Task

SaveStringtoStorageAsync() public static method

将文本写入存储目录(覆盖)
public static SaveStringtoStorageAsync ( string fileName, string content ) : System.Threading.Tasks.Task
fileName string
content string
return System.Threading.Tasks.Task

StreamToString() public static method

Convert UTF-8 encoding stream to string, sync
public static StreamToString ( Stream src ) : string
src Stream
return string

StringToStream() public static method

Convert UTF-8 encoding string to stream, sync
public static StringToStream ( string src ) : Stream
src string source
return Stream

ToIRandomAccessStreamAsync() public static method

public static ToIRandomAccessStreamAsync ( byte bytestream ) : Task
bytestream byte
return Task

WriteToStream() public static method

Writes byte array to stream. Author : Farhan Ghumra
public static WriteToStream ( Stream s, byte bytes ) : void
s Stream
bytes byte
return void

WriteToStream() public static method

Writes string to stream. Author : Farhan Ghumra
public static WriteToStream ( Stream s, string txt ) : void
s Stream
txt string
return void