C# 클래스 LitDev.LDFile

파일 보기 프로젝트 열기: litdev1/LitDev

공개 메소드들

메소드 설명
ANSItoUTF8 ( Primitive fileName, Primitive BOM ) : Primitive

Convert an ANSI encoded text file to UTF8. It should also work for any other encoding. UTF8 is the default text file encoding used by Small Basic.

AccessTime ( Primitive fileName ) : Primitive

Gets the last time a file was accessed.

CopyDirectory ( Primitive directoryFrom, Primitive directoryTo ) : Primitive

Recursively copy a directory and all contents including sub-directories.

CreationTime ( Primitive fileName ) : Primitive

Gets the creation time of a file.

Exists ( Primitive fileName ) : Primitive

Check if a file path is an existing file or directory.

GetAllDirectories ( Primitive path ) : Primitive

Recursively get all sub-directories in directory.

GetExtension ( Primitive fileName ) : Primitive

Get the file extension for a file.

GetFile ( Primitive fileName ) : Primitive

Get the file for a full file path.

GetFolder ( Primitive fileName ) : Primitive

Get the folder for a full file path.

Length ( Primitive fileName ) : Primitive

Gets the number of lines in a text file.

LoadAllVariables ( Primitive fileName ) : void

Restore the values of all variables that were previously stored using SaveAllVariables.

ModifiedTime ( Primitive fileName ) : Primitive

Gets the last time a file was modified.

PrintFile ( Primitive fileName ) : void

Print a file.

ReadANSI ( Primitive fileName ) : Primitive

Read an ANSI encoded text file. It should also work for any other encoding including UTF8. UTF8 is the default text file encoding used by Small Basic.

ReadANSIToArray ( Primitive fileName ) : Primitive

Reads a text file with ANSI encoding into an array with one element for each line in the file. It should also work for any other encoding including UTF8. Blank lines are included as an element in the array with one blank space.

ReadCSV ( Primitive fileName ) : Primitive

Read a CSV (comma separated values) file into an array. The deliminator may be changed from a comma using Utilities.CSVdeliminator

ReadCSVTransposed ( Primitive fileName ) : Primitive

Read a CSV (comma separated values) file into an array. and transpose (swap rows and columns). The deliminator may be changed from a comma using Utilities.CSVdeliminator

ReadToArray ( Primitive fileName ) : Primitive

Reads a text file into an array with one element for each line in the file. Blank lines are included as an element in the array with one blank space.

RenameDirectory ( Primitive directoryFrom, Primitive directoryTo ) : Primitive

Rename or move a directory.

RenameFile ( Primitive fileFrom, Primitive fileTo ) : Primitive

Rename or move a file.

SaveAllVariables ( Primitive fileName ) : void

Save all of the current variables to a file. This is the complete current state of your program. May be useful to store a game state, or for debugging.

Size ( Primitive fileName ) : Primitive

Get the size of a file in bytes.

WriteCSV ( Primitive fileName, Primitive array ) : void

Write a 2D array to a CSV (comma separated values) file. The deliminator may be changed from a comma using Utilities.CSVdeliminator

비공개 메소드들

메소드 설명
CopyFilesRecursively ( String SourcePath, String DestinationPath ) : void
GetFileEncoding ( string fileName ) : Encoding
MusicPlayTime ( Primitive fileName ) : Primitive
ReadEncodedFile ( string fileName ) : string
getDirectories ( string dirPath, string &result, int &i ) : void

메소드 상세

ANSItoUTF8() 공개 정적인 메소드

Convert an ANSI encoded text file to UTF8. It should also work for any other encoding. UTF8 is the default text file encoding used by Small Basic.
public static ANSItoUTF8 ( Primitive fileName, Primitive BOM ) : Primitive
fileName Primitive The file path to convert.
BOM Primitive Include Byte Order Mark (BOM) in UTF8 file ("True" or "False", no BOM is usual).
리턴 Primitive

AccessTime() 공개 정적인 메소드

Gets the last time a file was accessed.
public static AccessTime ( Primitive fileName ) : Primitive
fileName Primitive /// The full path of the file. ///
리턴 Primitive

CopyDirectory() 공개 정적인 메소드

Recursively copy a directory and all contents including sub-directories.
public static CopyDirectory ( Primitive directoryFrom, Primitive directoryTo ) : Primitive
directoryFrom Primitive The full path to the directory to copy from.
directoryTo Primitive The full path to the directory to copy to.
리턴 Primitive

CreationTime() 공개 정적인 메소드

Gets the creation time of a file.
public static CreationTime ( Primitive fileName ) : Primitive
fileName Primitive /// The full path of the file. ///
리턴 Primitive

Exists() 공개 정적인 메소드

Check if a file path is an existing file or directory.
public static Exists ( Primitive fileName ) : Primitive
fileName Primitive /// The full path of the file or directory. ///
리턴 Primitive

GetAllDirectories() 공개 정적인 메소드

Recursively get all sub-directories in directory.
public static GetAllDirectories ( Primitive path ) : Primitive
path Primitive The full path to the root dircetory.
리턴 Primitive

GetExtension() 공개 정적인 메소드

Get the file extension for a file.
public static GetExtension ( Primitive fileName ) : Primitive
fileName Primitive The file name with extension (may include folder path or not).
리턴 Primitive

GetFile() 공개 정적인 메소드

Get the file for a full file path.
public static GetFile ( Primitive fileName ) : Primitive
fileName Primitive The full path of a file.
리턴 Primitive

GetFolder() 공개 정적인 메소드

Get the folder for a full file path.
public static GetFolder ( Primitive fileName ) : Primitive
fileName Primitive The full path of a file.
리턴 Primitive

Length() 공개 정적인 메소드

Gets the number of lines in a text file.
public static Length ( Primitive fileName ) : Primitive
fileName Primitive /// The full path of the file. ///
리턴 Primitive

LoadAllVariables() 공개 정적인 메소드

Restore the values of all variables that were previously stored using SaveAllVariables.
public static LoadAllVariables ( Primitive fileName ) : void
fileName Primitive The full path to a file with stored variable values.
리턴 void

ModifiedTime() 공개 정적인 메소드

Gets the last time a file was modified.
public static ModifiedTime ( Primitive fileName ) : Primitive
fileName Primitive /// The full path of the file. ///
리턴 Primitive

PrintFile() 공개 정적인 메소드

Print a file.
public static PrintFile ( Primitive fileName ) : void
fileName Primitive The full path of the file to print.
리턴 void

ReadANSI() 공개 정적인 메소드

Read an ANSI encoded text file. It should also work for any other encoding including UTF8. UTF8 is the default text file encoding used by Small Basic.
public static ReadANSI ( Primitive fileName ) : Primitive
fileName Primitive The file path to read.
리턴 Primitive

ReadANSIToArray() 공개 정적인 메소드

Reads a text file with ANSI encoding into an array with one element for each line in the file. It should also work for any other encoding including UTF8. Blank lines are included as an element in the array with one blank space.
public static ReadANSIToArray ( Primitive fileName ) : Primitive
fileName Primitive /// The full path of the file. ///
리턴 Primitive

ReadCSV() 공개 정적인 메소드

Read a CSV (comma separated values) file into an array. The deliminator may be changed from a comma using Utilities.CSVdeliminator
public static ReadCSV ( Primitive fileName ) : Primitive
fileName Primitive /// The full path of the CSV file. ///
리턴 Primitive

ReadCSVTransposed() 공개 정적인 메소드

Read a CSV (comma separated values) file into an array. and transpose (swap rows and columns). The deliminator may be changed from a comma using Utilities.CSVdeliminator
public static ReadCSVTransposed ( Primitive fileName ) : Primitive
fileName Primitive /// The full path of the CSV file. ///
리턴 Primitive

ReadToArray() 공개 정적인 메소드

Reads a text file into an array with one element for each line in the file. Blank lines are included as an element in the array with one blank space.
public static ReadToArray ( Primitive fileName ) : Primitive
fileName Primitive /// The full path of the file. ///
리턴 Primitive

RenameDirectory() 공개 정적인 메소드

Rename or move a directory.
public static RenameDirectory ( Primitive directoryFrom, Primitive directoryTo ) : Primitive
directoryFrom Primitive The full path to the directory to rename.
directoryTo Primitive The full path to the new name for the directory.
리턴 Primitive

RenameFile() 공개 정적인 메소드

Rename or move a file.
public static RenameFile ( Primitive fileFrom, Primitive fileTo ) : Primitive
fileFrom Primitive The full path to the file to rename.
fileTo Primitive The full path to the new name for the file.
리턴 Primitive

SaveAllVariables() 공개 정적인 메소드

Save all of the current variables to a file. This is the complete current state of your program. May be useful to store a game state, or for debugging.
public static SaveAllVariables ( Primitive fileName ) : void
fileName Primitive The full path to store the variables and their values. /// This file will be over-written.
리턴 void

Size() 공개 정적인 메소드

Get the size of a file in bytes.
public static Size ( Primitive fileName ) : Primitive
fileName Primitive The full path to the file to get the size of.
리턴 Primitive

WriteCSV() 공개 정적인 메소드

Write a 2D array to a CSV (comma separated values) file. The deliminator may be changed from a comma using Utilities.CSVdeliminator
public static WriteCSV ( Primitive fileName, Primitive array ) : void
fileName Primitive /// The full path of the CSV file. ///
array Primitive /// The array to export. ///
리턴 void