C# Class GitSharp.Core.Util.QuotedString

Utility functions related to quoted string handling.
Show file Open project: stschake/GitSharp

Public Properties

Property Type Description
BOURNE BourneStyle
BOURNE_USER_PATH BourneUserPathStyle
GIT_PATH GitPathStyle

Public Methods

Method Description
dequote ( byte instr, int offset, int end ) : string

Decode a previously quoted input, scanning a UTF-8 encoded buffer. This method must match quote such that: a.Equals(Dequote(Constants.encode(quote(a)))); is true for any a. This method removes any opening/closing quotation marks added by

dequote ( string instr ) : string

Clean a previously quoted input, decoding the result via UTF-8. This method must match quote such that: a.Equals(qequote(quote(a))); is true for any a.

quote ( string instr ) : string

Quote an input string by the quoting rules. If the input string does not require any quoting, the same String reference is returned to the caller. Otherwise a quoted string is returned, including the opening and closing quotation marks at the start and end of the string. If the style does not permit raw Unicode characters then the string will first be encoded in UTF-8, with unprintable sequences possibly escaped by the rules.

Method Details

dequote() public abstract method

Decode a previously quoted input, scanning a UTF-8 encoded buffer. This method must match quote such that: a.Equals(Dequote(Constants.encode(quote(a)))); is true for any a. This method removes any opening/closing quotation marks added by
public abstract dequote ( byte instr, int offset, int end ) : string
instr byte /// The input buffer to parse. ///
offset int /// First position within to scan. ///
end int /// One position past in to scan. ///
return string

dequote() public method

Clean a previously quoted input, decoding the result via UTF-8. This method must match quote such that: a.Equals(qequote(quote(a))); is true for any a.
public dequote ( string instr ) : string
instr string a Unicode string to remove quoting from.
return string

quote() public abstract method

Quote an input string by the quoting rules. If the input string does not require any quoting, the same String reference is returned to the caller. Otherwise a quoted string is returned, including the opening and closing quotation marks at the start and end of the string. If the style does not permit raw Unicode characters then the string will first be encoded in UTF-8, with unprintable sequences possibly escaped by the rules.
public abstract quote ( string instr ) : string
instr string any non-null Unicode string
return string

Property Details

BOURNE public static property

Quoting style used by the Bourne shell. Quotes are unconditionally inserted during quote(string). This protects shell meta-characters like $ or ~ from being recognized as special.
public static BourneStyle BOURNE
return BourneStyle

BOURNE_USER_PATH public static property

Bourne style, but permits ~user at the start of the string.
public static BourneUserPathStyle BOURNE_USER_PATH
return BourneUserPathStyle

GIT_PATH public static property

Quoting style that obeys the rules Git applies to file names.
public static GitPathStyle GIT_PATH
return GitPathStyle