C# Class PEBakery.Core.StringEscaper

显示文件 Open project: pebakery/pebakery Class Usage Examples

Public Methods

Method Description
DoubleQuote ( string str ) : string
Escape ( IEnumerable strs, bool fullEscape = false, bool escapePercent = false ) : List
Escape ( string str, bool fullEscape = false, bool escapePercent = false ) : string
EscapePercent ( IEnumerable strs ) : List
EscapePercent ( string str ) : string
ExpandSectionParams ( PEBakery.Core.EngineState s, IEnumerable strs ) : List
ExpandSectionParams ( PEBakery.Core.EngineState s, string str ) : string

Expand #1, #2, #3, etc...

ExpandVariables ( PEBakery.Core.EngineState s, IEnumerable strs ) : List
ExpandVariables ( PEBakery.Core.Variables vars, IEnumerable strs ) : List
ExpandVariables ( PEBakery.Core.EngineState s, string str ) : string

Expand #n and %Var% variables.

ExpandVariables ( PEBakery.Core.Variables vars, string str ) : string
GetUniqueFileName ( string srcKey, IEnumerable keys ) : string
GetUniqueKey ( string srcKey, IEnumerable keys, int startIdx = 1 ) : string
IsFileFilterValid ( string filter ) : bool

Check if given filter is a valid Microsoft.Win32.OpenFileDialog.Filter format.

IsFileNameValid ( string path, IEnumerable more = null ) : bool
IsPathValid ( string path, IEnumerable more = null ) : bool
IsUrlValid ( string url ) : bool

Check if given url is valid http or https url.

PackRegBinary ( Array bin, bool escape = false ) : string
PackRegMultiBinary ( IEnumerable multiStrs ) : string
PackRegMultiString ( IEnumerable multiStrs ) : string
PathSecurityCheck ( string path, string &errorMsg ) : bool

Check if a path is safe to write. Allows wildcard.

Preprocess ( PEBakery.Core.EngineState s, IEnumerable strs, bool escapePercent = true ) : List
Preprocess ( PEBakery.Core.Variables vars, IEnumerable strs, bool escapePercent = true ) : List
Preprocess ( PEBakery.Core.EngineState s, string str, bool escapePercent = true ) : string
Preprocess ( PEBakery.Core.Variables vars, string str, bool escapePercent = true ) : string
ProcessVersionString ( string str ) : string
QuoteEscape ( IEnumerable strs, bool fullEscape = false, bool escapePercent = false ) : List
QuoteEscape ( string str, bool fullEscape = false, bool escapePercent = false ) : string
QuoteUnescape ( IEnumerable strs, bool escapePercent = false ) : List
QuoteUnescape ( string str, bool escapePercent = false ) : string
Unescape ( IEnumerable strs, bool escapePercent = false ) : List
Unescape ( string str, bool escapePercent = false ) : string
UnescapePercent ( IEnumerable strs ) : List
UnescapePercent ( string str ) : string
UnpackRegBinary ( Array packStrs, Array &bin ) : bool
UnpackRegBinary ( string packStr, Array &bin ) : bool
UnpackRegMultiString ( string packStr ) : List

Private Methods

Method Description
PackListStr ( IList list, string separator ) : string
UnpackListStr ( string listStr, string separator ) : List

Method Details

DoubleQuote() public static method

public static DoubleQuote ( string str ) : string
str string
return string

Escape() public static method

public static Escape ( IEnumerable strs, bool fullEscape = false, bool escapePercent = false ) : List
strs IEnumerable
fullEscape bool
escapePercent bool
return List

Escape() public static method

public static Escape ( string str, bool fullEscape = false, bool escapePercent = false ) : string
str string
fullEscape bool
escapePercent bool
return string

EscapePercent() public static method

public static EscapePercent ( IEnumerable strs ) : List
strs IEnumerable
return List

EscapePercent() public static method

public static EscapePercent ( string str ) : string
str string
return string

ExpandSectionParams() public static method

public static ExpandSectionParams ( PEBakery.Core.EngineState s, IEnumerable strs ) : List
s PEBakery.Core.EngineState
strs IEnumerable
return List

ExpandSectionParams() public static method

Expand #1, #2, #3, etc...
public static ExpandSectionParams ( PEBakery.Core.EngineState s, string str ) : string
s PEBakery.Core.EngineState
str string
return string

ExpandVariables() public static method

public static ExpandVariables ( PEBakery.Core.EngineState s, IEnumerable strs ) : List
s PEBakery.Core.EngineState
strs IEnumerable
return List

ExpandVariables() public static method

public static ExpandVariables ( PEBakery.Core.Variables vars, IEnumerable strs ) : List
vars PEBakery.Core.Variables
strs IEnumerable
return List

ExpandVariables() public static method

Expand #n and %Var% variables.
public static ExpandVariables ( PEBakery.Core.EngineState s, string str ) : string
s PEBakery.Core.EngineState
str string
return string

ExpandVariables() public static method

public static ExpandVariables ( PEBakery.Core.Variables vars, string str ) : string
vars PEBakery.Core.Variables
str string
return string

GetUniqueFileName() public static method

public static GetUniqueFileName ( string srcKey, IEnumerable keys ) : string
srcKey string
keys IEnumerable
return string

GetUniqueKey() public static method

public static GetUniqueKey ( string srcKey, IEnumerable keys, int startIdx = 1 ) : string
srcKey string
keys IEnumerable
startIdx int
return string

IsFileFilterValid() public static method

Check if given filter is a valid Microsoft.Win32.OpenFileDialog.Filter format.
public static IsFileFilterValid ( string filter ) : bool
filter string File filter string to test
return bool

IsFileNameValid() public static method

public static IsFileNameValid ( string path, IEnumerable more = null ) : bool
path string
more IEnumerable
return bool

IsPathValid() public static method

public static IsPathValid ( string path, IEnumerable more = null ) : bool
path string
more IEnumerable
return bool

IsUrlValid() public static method

Check if given url is valid http or https url.
public static IsUrlValid ( string url ) : bool
url string
return bool

PackRegBinary() public static method

public static PackRegBinary ( Array bin, bool escape = false ) : string
bin Array
escape bool
return string

PackRegMultiBinary() public static method

public static PackRegMultiBinary ( IEnumerable multiStrs ) : string
multiStrs IEnumerable
return string

PackRegMultiString() public static method

public static PackRegMultiString ( IEnumerable multiStrs ) : string
multiStrs IEnumerable
return string

PathSecurityCheck() public static method

Check if a path is safe to write. Allows wildcard.
public static PathSecurityCheck ( string path, string &errorMsg ) : bool
path string
errorMsg string
return bool

Preprocess() public static method

public static Preprocess ( PEBakery.Core.EngineState s, IEnumerable strs, bool escapePercent = true ) : List
s PEBakery.Core.EngineState
strs IEnumerable
escapePercent bool
return List

Preprocess() public static method

public static Preprocess ( PEBakery.Core.Variables vars, IEnumerable strs, bool escapePercent = true ) : List
vars PEBakery.Core.Variables
strs IEnumerable
escapePercent bool
return List

Preprocess() public static method

public static Preprocess ( PEBakery.Core.EngineState s, string str, bool escapePercent = true ) : string
s PEBakery.Core.EngineState
str string
escapePercent bool
return string

Preprocess() public static method

public static Preprocess ( PEBakery.Core.Variables vars, string str, bool escapePercent = true ) : string
vars PEBakery.Core.Variables
str string
escapePercent bool
return string

ProcessVersionString() public static method

public static ProcessVersionString ( string str ) : string
str string
return string

QuoteEscape() public static method

public static QuoteEscape ( IEnumerable strs, bool fullEscape = false, bool escapePercent = false ) : List
strs IEnumerable
fullEscape bool
escapePercent bool
return List

QuoteEscape() public static method

public static QuoteEscape ( string str, bool fullEscape = false, bool escapePercent = false ) : string
str string
fullEscape bool
escapePercent bool
return string

QuoteUnescape() public static method

public static QuoteUnescape ( IEnumerable strs, bool escapePercent = false ) : List
strs IEnumerable
escapePercent bool
return List

QuoteUnescape() public static method

public static QuoteUnescape ( string str, bool escapePercent = false ) : string
str string
escapePercent bool
return string

Unescape() public static method

public static Unescape ( IEnumerable strs, bool escapePercent = false ) : List
strs IEnumerable
escapePercent bool
return List

Unescape() public static method

public static Unescape ( string str, bool escapePercent = false ) : string
str string
escapePercent bool
return string

UnescapePercent() public static method

public static UnescapePercent ( IEnumerable strs ) : List
strs IEnumerable
return List

UnescapePercent() public static method

public static UnescapePercent ( string str ) : string
str string
return string

UnpackRegBinary() public static method

public static UnpackRegBinary ( Array packStrs, Array &bin ) : bool
packStrs Array
bin Array
return bool

UnpackRegBinary() public static method

public static UnpackRegBinary ( string packStr, Array &bin ) : bool
packStr string
bin Array
return bool

UnpackRegMultiString() public static method

public static UnpackRegMultiString ( string packStr ) : List
packStr string
return List