-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
84 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
namespace nyingi.Kafa.Reader; | ||
|
||
public static class ColParser | ||
{ | ||
public static bool? ParseBool(this KafaReader.Col col) | ||
{ | ||
return bool.Parse(col.Value); | ||
} | ||
public static int? ParseInt(this KafaReader.Col col, IFormatProvider? formatProvider=null) | ||
{ | ||
return int.Parse(col.Value, formatProvider); | ||
} | ||
|
||
public static long? ParseLong(this KafaReader.Col col, IFormatProvider? formatProvider=null) | ||
{ | ||
return long.Parse(col.Value, formatProvider); | ||
} | ||
|
||
public static float? ParseFloat(this KafaReader.Col col, IFormatProvider? formatProvider=null) | ||
{ | ||
return float.Parse(col.Value, formatProvider); | ||
} | ||
|
||
public static double? ParseDouble(this KafaReader.Col col, IFormatProvider? formatProvider=null) | ||
{ | ||
return double.Parse(col.Value, formatProvider); | ||
} | ||
|
||
public static decimal? ParseDecimal(this KafaReader.Col col, IFormatProvider? formatProvider=null) | ||
{ | ||
return decimal.Parse(col.Value, formatProvider); | ||
} | ||
|
||
public static DateTime? ParseDateTime(this KafaReader.Col col, IFormatProvider? formatProvider=null) | ||
{ | ||
return DateTime.Parse(col.Value, formatProvider); | ||
} | ||
|
||
public static DateTimeOffset? ParseDateTimeOffSet(this KafaReader.Col col, IFormatProvider? formatProvider=null) | ||
{ | ||
return DateTimeOffset.Parse(col.Value, formatProvider); | ||
} | ||
|
||
public static Guid? ParseGuid(this KafaReader.Col col, IFormatProvider? formatProvider=null) | ||
{ | ||
return Guid.Parse(col.Value, formatProvider); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters