C# Class AcTools.Utils.Helpers.FlexibleParser

显示文件 Open project: gro-ove/actools Class Usage Examples

Public Methods

Method Description
ParseDouble ( string s ) : double

Throws an exception if can’t parse!

ParseDouble ( string s, double defaultValue ) : double
ParseInt ( string s ) : int

Throws an exception if can’t parse!

ParseInt ( string s, int defaultValue ) : int
ParseLong ( string s ) : long

Throws an exception if can’t parse!

ParseLong ( string s, long defaultValue ) : long
ParseTime ( string s ) : int

Throws an exception if can’t parse!

ParseTime ( string s, int defaultValue ) : int
TryParseDouble ( [ s, double &value ) : bool
TryParseDouble ( string s ) : double?
TryParseInt ( [ s, int &value ) : bool
TryParseInt ( string s ) : int?
TryParseLong ( string s, long &value ) : bool
TryParseLong ( string s ) : long?
TryParseTime ( [ value, int &totalSeconds ) : bool

Parse value from “12:34” to seconds from “00:00”

TryParseTime ( string s ) : int?

Private Methods

Method Description
ReplaceDouble ( [ s, double value ) : string

Method Details

ParseDouble() public static method

Throws an exception if can’t parse!
public static ParseDouble ( string s ) : double
s string
return double

ParseDouble() public static method

public static ParseDouble ( string s, double defaultValue ) : double
s string
defaultValue double
return double

ParseInt() public static method

Throws an exception if can’t parse!
public static ParseInt ( string s ) : int
s string
return int

ParseInt() public static method

public static ParseInt ( string s, int defaultValue ) : int
s string
defaultValue int
return int

ParseLong() public static method

Throws an exception if can’t parse!
public static ParseLong ( string s ) : long
s string
return long

ParseLong() public static method

public static ParseLong ( string s, long defaultValue ) : long
s string
defaultValue long
return long

ParseTime() public static method

Throws an exception if can’t parse!
public static ParseTime ( string s ) : int
s string
return int

ParseTime() public static method

public static ParseTime ( string s, int defaultValue ) : int
s string
defaultValue int
return int

TryParseDouble() public static method

public static TryParseDouble ( [ s, double &value ) : bool
s [
value double
return bool

TryParseDouble() public static method

public static TryParseDouble ( string s ) : double?
s string
return double?

TryParseInt() public static method

public static TryParseInt ( [ s, int &value ) : bool
s [
value int
return bool

TryParseInt() public static method

public static TryParseInt ( string s ) : int?
s string
return int?

TryParseLong() public static method

public static TryParseLong ( string s, long &value ) : bool
s string
value long
return bool

TryParseLong() public static method

public static TryParseLong ( string s ) : long?
s string
return long?

TryParseTime() public static method

Parse value from “12:34” to seconds from “00:00”
public static TryParseTime ( [ value, int &totalSeconds ) : bool
value [ Value in “12:34” (or “12:34:56”) format.
totalSeconds int Seconds from “00:00”.
return bool

TryParseTime() public static method

public static TryParseTime ( string s ) : int?
s string
return int?