Struct CStr64
- Namespace
- DatabentoDotNet.Dbn
- Assembly
- DatabentoDotNet.Dbn.dll
A fixed 64-byte NUL-padded C-string field: err and msg in the DBN v1 error and
system messages (302 and 303 bytes from v2 on).
public struct CStr64
- Inherited Members
Remarks
The buffer is part of the record's own wire bytes and is never decoded to a
string as part of decoding. AsSpan() and AsTextSpan()
allocate nothing; only ToString() does. See CStr.cs for why each width is
its own type.
Fields
Length
The field's fixed width on the wire, in bytes.
public const int Length = 64
Field Value
Methods
AsSpan()
All Length wire bytes, NUL padding included. The span points into the record, so it is valid only for as long as the record's own buffer is.
[UnscopedRef]
public readonly ReadOnlySpan<byte> AsSpan()
Returns
- ReadOnlySpan<byte>
The field's wire bytes.
AsTextSpan()
The bytes before the first NUL, or all Length of them when the text fills the field and leaves no room for a terminator. Allocates nothing.
[UnscopedRef]
public readonly ReadOnlySpan<byte> AsTextSpan()
Returns
- ReadOnlySpan<byte>
The field's text bytes, without NUL padding.
ToString()
Decodes the field to a string, without trailing NUL padding. This allocates — prefer AsTextSpan() on the decode path.
public override readonly string ToString()
Returns
- string
The decoded text.