A static class containing BSON utility methods.
More...
|
static string | GetFriendlyTypeName (Type type) |
| Gets a friendly class name suitable for use in error messages.
|
|
static byte[] | ParseHexString (string s) |
| Parses a hex string into its equivalent byte array.
|
|
static DateTime | ToDateTimeFromMillisecondsSinceEpoch (long millisecondsSinceEpoch) |
| Converts from number of milliseconds since Unix epoch to DateTime.
|
|
static string | ToHexString (byte[] bytes) |
| Converts a byte array to a hex string.
|
|
static DateTime | ToLocalTime (DateTime dateTime) |
| Converts a DateTime to local time (with special handling for MinValue and MaxValue).
|
|
static long | ToMillisecondsSinceEpoch (DateTime dateTime) |
| Converts a DateTime to number of milliseconds since Unix epoch.
|
|
static DateTime | ToUniversalTime (DateTime dateTime) |
| Converts a DateTime to UTC (with special handling for MinValue and MaxValue).
|
|
static bool | TryParseHexString (string s, out byte[] bytes) |
| Tries to parse a hex string to a byte array.
|
|
A static class containing BSON utility methods.
static string SequoiaDB.Bson.BsonUtils.GetFriendlyTypeName |
( |
Type |
type | ) |
|
|
inlinestatic |
Gets a friendly class name suitable for use in error messages.
- Parameters
-
- Returns
- A friendly class name.
static byte [] SequoiaDB.Bson.BsonUtils.ParseHexString |
( |
string |
s | ) |
|
|
inlinestatic |
Parses a hex string into its equivalent byte array.
- Parameters
-
s | The hex string to parse. |
- Returns
- The byte equivalent of the hex string.
static DateTime SequoiaDB.Bson.BsonUtils.ToDateTimeFromMillisecondsSinceEpoch |
( |
long |
millisecondsSinceEpoch | ) |
|
|
inlinestatic |
Converts from number of milliseconds since Unix epoch to DateTime.
- Parameters
-
millisecondsSinceEpoch | The number of milliseconds since Unix epoch. |
- Returns
- A DateTime.
static string SequoiaDB.Bson.BsonUtils.ToHexString |
( |
byte[] |
bytes | ) |
|
|
inlinestatic |
Converts a byte array to a hex string.
- Parameters
-
- Returns
- A hex string.
static DateTime SequoiaDB.Bson.BsonUtils.ToLocalTime |
( |
DateTime |
dateTime | ) |
|
|
inlinestatic |
Converts a DateTime to local time (with special handling for MinValue and MaxValue).
- Parameters
-
- Returns
- The DateTime in local time.
static long SequoiaDB.Bson.BsonUtils.ToMillisecondsSinceEpoch |
( |
DateTime |
dateTime | ) |
|
|
inlinestatic |
Converts a DateTime to number of milliseconds since Unix epoch.
- Parameters
-
- Returns
- Number of seconds since Unix epoch.
static DateTime SequoiaDB.Bson.BsonUtils.ToUniversalTime |
( |
DateTime |
dateTime | ) |
|
|
inlinestatic |
Converts a DateTime to UTC (with special handling for MinValue and MaxValue).
- Parameters
-
- Returns
- The DateTime in UTC.
static bool SequoiaDB.Bson.BsonUtils.TryParseHexString |
( |
string |
s, |
|
|
out byte[] |
bytes |
|
) |
| |
|
inlinestatic |
Tries to parse a hex string to a byte array.
- Parameters
-
s | The hex string. |
bytes | A byte array. |
- Returns
- True if the hex string was successfully parsed.
The documentation for this class was generated from the following file: