-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIByteArrayValue.cs
More file actions
41 lines (37 loc) · 1.51 KB
/
Copy pathIByteArrayValue.cs
File metadata and controls
41 lines (37 loc) · 1.51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
using System.Diagnostics.CodeAnalysis;
using System.Net;
namespace DuckSQL.Types
{
internal interface IByteArrayValue : IComparable<IByteArrayValue>, IComparable
{
byte[] Data { get; }
DisplayFormat[] PossibleDisplayFormats { get; }
public enum DisplayFormat
{
Hex = 0, //Default hexadecimal format
IPv6, // 16 bytes
IPv4, // 4 bytes
Guid, // 16 bytes
Short, // 2 bytes
Integer, // 4 bytes
Long, // 8 bytes
Float, // 4 bytes
Double, // 8 bytes
ASCII, // ASCII text if printable (any size)
Base64, // Base64 encoded string (any size)
Size // Size information (any size)
}
bool ToImage([NotNullWhen(true)] out Image? image);
string ToStringTruncated(int desiredLength);
bool ToIPv6([NotNullWhen(true)] out IPAddress? ipAddress);
bool ToIPv4([NotNullWhen(true)] out IPAddress? ipAddress);
bool ToGuid([NotNullWhen(true)] out Guid? guid);
bool ToASCII([NotNullWhen(true)] out string? ascii);
bool ToShort([NotNullWhen(true)] out short? @short);
bool ToInteger([NotNullWhen(true)] out int? @int);
bool ToLong([NotNullWhen(true)] out long? @long);
bool ToFloat([NotNullWhen(true)] out float? @float);
bool ToDouble([NotNullWhen(true)] out double? @double);
void ToBase64(out string base64);
}
}