C# Class DrutNET.DrutNETBase

Base Class with general functions
Afficher le fichier Open project: bricel/DrutNet Class Usage Examples

Méthodes publiques

Méthode Description
CreateDir ( string dir ) : DirectoryInfo
CurlDataProgress ( ProgressDataStruct info ) : void
DeleteAllFiles ( string directory, string fileNotToDelete ) : void
DirectoryExists ( string dir ) : bool
DownloadHTTPFile ( string httpPath, string savePath ) : bool

Download a public file from a URL

FileExists ( string file ) : bool
GetExtension ( string FileName ) : string

return file extension with leading point

GetFileName ( string FileName ) : string

Return file name and extension without path

GetFileNameWithoutExtension ( string FileName ) : string

Remove the extension and path of a filename

GetFileNameWithoutExtension ( string FileName, bool withPath ) : string

remove extension and keep path if withPath is set to true

GetPath ( string FileName ) : string

Return the path of the file

GetUniqueDirectory ( string dir, bool useUnderScore ) : string

return a unique dir name

GetUniqueFileName ( string sourceFN ) : string

check if filename exist , and return a filename_num that is unique

GetUniqueFileName ( string sourceFN, bool useUnderScore ) : string
OpenWebPage ( string url ) : void
ReadAutoCompleteFile ( string path ) : string[]
ReplaceFileExtension ( string FileName, string newExtension ) : string

replace the filename extension

UnZip ( string pathToUnZip, string targetFolder ) : void
WriteAutoCompleteFile ( string autoCompleteStr, string path ) : void
sendLogEvent ( string message, string mSender, Enums mType ) : void

Send a message event

sendLogEvent ( string message, string mSender, Enums mType, bool verbose ) : void
sendLogEvent ( string message, string errorFile, string mSender, Enums mType ) : void
sendLogEvent ( string message, string errorFile, string mSender, Enums mType, bool verbose ) : void

Méthodes protégées

Méthode Description
readByte ( BinaryReader ruleFileBinaryReader ) : byte
readFloat ( BinaryReader ruleFileBinaryReader, int numOfIFloatToRead ) : List

Read floats into an array

readFloat ( BinaryReader ruleFileBinaryReader ) : float

read single float

readInt32 ( BinaryReader ruleFileBinaryReader, int numOfIntToRead ) : List

read int32

readInt32 ( BinaryReader ruleFileBinaryReader ) : int

read single int 32

readString ( BinaryReader ruleFileBinaryReader, int numOfCharToRead ) : string
writeFloatToFile ( BinaryWriter ruleFileBinaryWriter, float f ) : bool
writeInt32ToFile ( BinaryWriter ruleFileBinaryWriter, int i ) : bool
writeStringAndLengthToFile ( BinaryWriter ruleFileBinaryWriter, string s ) : bool
writeStringToFile ( BinaryWriter ruleFileBinaryWriter, string s ) : bool
writeStringToFile ( BinaryWriter ruleFileBinaryWriter, string s, bool endChar ) : bool

Private Methods

Méthode Description
sendErrorLogEvent ( string message ) : void
sendErrorLogEvent ( string message, bool verbose ) : void
writeLogToFile ( string message, string mSender, Enums mType ) : void

Method Details

CreateDir() public static méthode

public static CreateDir ( string dir ) : DirectoryInfo
dir string
Résultat System.IO.DirectoryInfo

CurlDataProgress() public static méthode

public static CurlDataProgress ( ProgressDataStruct info ) : void
info ProgressDataStruct
Résultat void

DeleteAllFiles() public static méthode

public static DeleteAllFiles ( string directory, string fileNotToDelete ) : void
directory string
fileNotToDelete string
Résultat void

DirectoryExists() public static méthode

public static DirectoryExists ( string dir ) : bool
dir string
Résultat bool

DownloadHTTPFile() public static méthode

Download a public file from a URL
public static DownloadHTTPFile ( string httpPath, string savePath ) : bool
httpPath string
savePath string
Résultat bool

FileExists() public static méthode

public static FileExists ( string file ) : bool
file string
Résultat bool

GetExtension() public static méthode

return file extension with leading point
public static GetExtension ( string FileName ) : string
FileName string
Résultat string

GetFileName() public static méthode

Return file name and extension without path
public static GetFileName ( string FileName ) : string
FileName string
Résultat string

GetFileNameWithoutExtension() public static méthode

Remove the extension and path of a filename
public static GetFileNameWithoutExtension ( string FileName ) : string
FileName string
Résultat string

GetFileNameWithoutExtension() public static méthode

remove extension and keep path if withPath is set to true
public static GetFileNameWithoutExtension ( string FileName, bool withPath ) : string
FileName string
withPath bool
Résultat string

GetPath() public static méthode

Return the path of the file
public static GetPath ( string FileName ) : string
FileName string
Résultat string

GetUniqueDirectory() public static méthode

return a unique dir name
public static GetUniqueDirectory ( string dir, bool useUnderScore ) : string
dir string Directory without ending slash
useUnderScore bool
Résultat string

GetUniqueFileName() public static méthode

check if filename exist , and return a filename_num that is unique
public static GetUniqueFileName ( string sourceFN ) : string
sourceFN string
Résultat string

GetUniqueFileName() public static méthode

public static GetUniqueFileName ( string sourceFN, bool useUnderScore ) : string
sourceFN string
useUnderScore bool
Résultat string

OpenWebPage() public static méthode

public static OpenWebPage ( string url ) : void
url string
Résultat void

ReadAutoCompleteFile() public static méthode

public static ReadAutoCompleteFile ( string path ) : string[]
path string
Résultat string[]

ReplaceFileExtension() public static méthode

replace the filename extension
public static ReplaceFileExtension ( string FileName, string newExtension ) : string
FileName string original file name to change
newExtension string new extension , with the dot
Résultat string

UnZip() public static méthode

public static UnZip ( string pathToUnZip, string targetFolder ) : void
pathToUnZip string
targetFolder string
Résultat void

WriteAutoCompleteFile() public static méthode

public static WriteAutoCompleteFile ( string autoCompleteStr, string path ) : void
autoCompleteStr string
path string
Résultat void

readByte() protected méthode

protected readByte ( BinaryReader ruleFileBinaryReader ) : byte
ruleFileBinaryReader System.IO.BinaryReader
Résultat byte

readFloat() protected méthode

Read floats into an array
protected readFloat ( BinaryReader ruleFileBinaryReader, int numOfIFloatToRead ) : List
ruleFileBinaryReader System.IO.BinaryReader
numOfIFloatToRead int
Résultat List

readFloat() protected méthode

read single float
protected readFloat ( BinaryReader ruleFileBinaryReader ) : float
ruleFileBinaryReader System.IO.BinaryReader
Résultat float

readInt32() protected méthode

read int32
protected readInt32 ( BinaryReader ruleFileBinaryReader, int numOfIntToRead ) : List
ruleFileBinaryReader System.IO.BinaryReader
numOfIntToRead int
Résultat List

readInt32() protected méthode

read single int 32
protected readInt32 ( BinaryReader ruleFileBinaryReader ) : int
ruleFileBinaryReader System.IO.BinaryReader
Résultat int

readString() protected méthode

protected readString ( BinaryReader ruleFileBinaryReader, int numOfCharToRead ) : string
ruleFileBinaryReader System.IO.BinaryReader
numOfCharToRead int
Résultat string

sendLogEvent() public static méthode

Send a message event
public static sendLogEvent ( string message, string mSender, Enums mType ) : void
message string
mSender string
mType Enums
Résultat void

sendLogEvent() public static méthode

public static sendLogEvent ( string message, string mSender, Enums mType, bool verbose ) : void
message string
mSender string
mType Enums
verbose bool
Résultat void

sendLogEvent() public static méthode

public static sendLogEvent ( string message, string errorFile, string mSender, Enums mType ) : void
message string
errorFile string
mSender string
mType Enums
Résultat void

sendLogEvent() public static méthode

public static sendLogEvent ( string message, string errorFile, string mSender, Enums mType, bool verbose ) : void
message string
errorFile string
mSender string
mType Enums
verbose bool
Résultat void

writeFloatToFile() protected méthode

protected writeFloatToFile ( BinaryWriter ruleFileBinaryWriter, float f ) : bool
ruleFileBinaryWriter System.IO.BinaryWriter
f float
Résultat bool

writeInt32ToFile() protected méthode

protected writeInt32ToFile ( BinaryWriter ruleFileBinaryWriter, int i ) : bool
ruleFileBinaryWriter System.IO.BinaryWriter
i int
Résultat bool

writeStringAndLengthToFile() protected méthode

protected writeStringAndLengthToFile ( BinaryWriter ruleFileBinaryWriter, string s ) : bool
ruleFileBinaryWriter System.IO.BinaryWriter
s string
Résultat bool

writeStringToFile() protected méthode

protected writeStringToFile ( BinaryWriter ruleFileBinaryWriter, string s ) : bool
ruleFileBinaryWriter System.IO.BinaryWriter
s string
Résultat bool

writeStringToFile() protected méthode

protected writeStringToFile ( BinaryWriter ruleFileBinaryWriter, string s, bool endChar ) : bool
ruleFileBinaryWriter System.IO.BinaryWriter
s string
endChar bool
Résultat bool