C# 클래스 CK.Text.StringMatcherTextExtension

Extends StringMatcher with useful (yet basic) methods.
파일 보기 프로젝트 열기: Invenietis/ck-core

공개 프로퍼티들

프로퍼티 타입 설명
RegexDouble System.Text.RegularExpressions.Regex

공개 메소드들

메소드 설명
MatchInt32 ( this @this, int &i, int minValue = int.MinValue, int maxValue = int.MaxValue ) : bool

Matches Int32 values that must not start with '0' ('0' is valid but '0d', where d is any digit, is not). A signed integer starts with a '-'. '-0' is valid but '-0d' (where d is any digit) is not. If the value is to big for an Int32, it fails.

TryMatchDoubleValue ( this @this ) : bool

Matches a double without getting its value nor setting an error if match fails. This uses RegexDouble.

TryMatchDoubleValue ( this @this, double &value ) : bool

Matches a double and gets its value. No error is set if match fails.

TryMatchGuid ( this @this, System.Guid &id ) : bool

Matches a Guid. No error is set if match fails.

Any of the 5 forms of Guid can be matched: N00000000000000000000000000000000 D00000000-0000-0000-0000-000000000000 B{00000000-0000-0000-0000-000000000000} P(00000000-0000-0000-0000-000000000000) X{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}

TryMatchJSONQuotedString ( this @this, bool allowNull = false ) : bool

Matches a quoted string without extracting its content.

TryMatchJSONQuotedString ( this @this, string &content, bool allowNull = false ) : bool

Matches a JSON quoted string without setting an error if match fails.

TryMatchJSONTerminalValue ( this @this ) : bool

Matches a JSON value: a "string", null, a number (double value), true or false. This method ignores the actual value and does not set any error if match fails.

TryMatchJSONValue ( this @this, object &value ) : bool

Matches a JSON value: a "string", null, a number (double value), true or false. Not error is set if match fails.

비공개 메소드들

메소드 설명
ReadHexDigit ( char c ) : int

메소드 상세

MatchInt32() 공개 정적인 메소드

Matches Int32 values that must not start with '0' ('0' is valid but '0d', where d is any digit, is not). A signed integer starts with a '-'. '-0' is valid but '-0d' (where d is any digit) is not. If the value is to big for an Int32, it fails.
public static MatchInt32 ( this @this, int &i, int minValue = int.MinValue, int maxValue = int.MaxValue ) : bool
@this this
i int The result integer. 0 on failure.
minValue int Optional minimal value.
maxValue int Optional maximal value.
리턴 bool

TryMatchDoubleValue() 공개 정적인 메소드

Matches a double without getting its value nor setting an error if match fails. This uses RegexDouble.
public static TryMatchDoubleValue ( this @this ) : bool
@this this
리턴 bool

TryMatchDoubleValue() 공개 정적인 메소드

Matches a double and gets its value. No error is set if match fails.
public static TryMatchDoubleValue ( this @this, double &value ) : bool
@this this
value double The read value on success.
리턴 bool

TryMatchGuid() 공개 정적인 메소드

Matches a Guid. No error is set if match fails.
Any of the 5 forms of Guid can be matched: N00000000000000000000000000000000 D00000000-0000-0000-0000-000000000000 B{00000000-0000-0000-0000-000000000000} P(00000000-0000-0000-0000-000000000000) X{0x00000000,0x0000,0x0000,{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00}}
public static TryMatchGuid ( this @this, System.Guid &id ) : bool
@this this
id System.Guid The result Guid. on failure.
리턴 bool

TryMatchJSONQuotedString() 공개 정적인 메소드

Matches a quoted string without extracting its content.
public static TryMatchJSONQuotedString ( this @this, bool allowNull = false ) : bool
@this this
allowNull bool True to allow 'null'.
리턴 bool

TryMatchJSONQuotedString() 공개 정적인 메소드

Matches a JSON quoted string without setting an error if match fails.
public static TryMatchJSONQuotedString ( this @this, string &content, bool allowNull = false ) : bool
@this this
content string Extracted content.
allowNull bool True to allow 'null'.
리턴 bool

TryMatchJSONTerminalValue() 공개 정적인 메소드

Matches a JSON value: a "string", null, a number (double value), true or false. This method ignores the actual value and does not set any error if match fails.
public static TryMatchJSONTerminalValue ( this @this ) : bool
@this this
리턴 bool

TryMatchJSONValue() 공개 정적인 메소드

Matches a JSON value: a "string", null, a number (double value), true or false. Not error is set if match fails.
public static TryMatchJSONValue ( this @this, object &value ) : bool
@this this
value object The parsed value. Can be null.
리턴 bool

프로퍼티 상세

RegexDouble 정적으로 공개적으로 프로퍼티

The Regex that TryMatchDoubleValue(StringMatcher) uses to avoid calling double.TryParse(string, out double) when resolving the value is useless.
static public Regex,System.Text.RegularExpressions RegexDouble
리턴 System.Text.RegularExpressions.Regex