Fauna v10 .NET/C# Driver 1.0.1
 
Loading...
Searching...
No Matches
Public Member Functions | Properties | List of all members
Fauna.Serialization.Utf8FaunaReader Struct Reference

Represents a reader that provides fast, non-cached, forward-only access to serialized data. More...

Public Member Functions

 Utf8FaunaReader (ReadOnlySequence< byte > bytes)
 Initializes a new Utf8FaunaReader to read from a ReadOnlySequence of bytes.
 
 Utf8FaunaReader (string str)
 Initializes a new Utf8FaunaReader to read from a string.
 
void Skip ()
 Skips the value of the current token.
 
bool Read ()
 Reads the next token from the source.
 
object? GetValue ()
 Gets the value of the current token.
 
string? GetString ()
 Retrieves a string value from the current token.
 
bool GetBoolean ()
 Retrieves a boolean value from the current JSON token.
 
DateOnly GetDate ()
 Retrieves a DateOnly value from the current token.
 
float GetFloat ()
 Retrieves a float value from the current token.
 
double GetDouble ()
 Retrieves a double value from the current token.
 
decimal GetDoubleAsDecimal ()
 Retrieves a decimal value from the current token.
 
byte GetByte ()
 Retrieves an byte value from the current token.
 
byte[] GetBytes ()
 Retrieves a byte array value from the current token.
 
sbyte GetUnsignedByte ()
 Retrieves an unsigned byte value from the current token.
 
int GetInt ()
 Retrieves an integer value from the current token.
 
uint GetUnsignedInt ()
 Retrieves an unsigned integer value from the current token.
 
short GetShort ()
 Retrieves an short value from the current token.
 
ushort GetUnsignedShort ()
 Retrieves an unsigned short value from the current token.
 
long GetLong ()
 Retrieves a long value from the current token.
 
Module GetModule ()
 Retrieves a Module object from the current token.
 
EventSource GetEventSource ()
 Retrieves an EventSource token string from the current token.
 
DateTime GetTime ()
 Retrieves a DateTime value from the current token.
 
string TryGetString (out string value)
 Tries to retrieve a string value from the current token.
 
bool TryGetBoolean (out bool value)
 Tries to retrieve a boolean value from the current token.
 
DateTime TryGetDateTime (out DateTime value)
 Tries to retrieve a DateTime value from the current token.
 
double TryGetDouble (out double value)
 Tries to retrieve a double value from the current token.
 
int TryGetInt (out int value)
 Tries to retrieve an integer value from the current token.
 
long TryGetLong (out long value)
 Tries to retrieve a long value from the current token.
 
Module TryGetModule (out Module value)
 Tries to retrieve a Module object from the current token.
 

Properties

TokenType CurrentTokenType [get]
 Gets the type of the current token.
 

Detailed Description

Represents a reader that provides fast, non-cached, forward-only access to serialized data.

Definition at line 13 of file Utf8FaunaReader.cs.

Constructor & Destructor Documentation

◆ Utf8FaunaReader() [1/2]

Fauna.Serialization.Utf8FaunaReader.Utf8FaunaReader ( ReadOnlySequence< byte >  bytes)

Initializes a new Utf8FaunaReader to read from a ReadOnlySequence of bytes.

Parameters
bytesThe sequence of bytes to read from.

Definition at line 47 of file Utf8FaunaReader.cs.

◆ Utf8FaunaReader() [2/2]

Fauna.Serialization.Utf8FaunaReader.Utf8FaunaReader ( string  str)

Initializes a new Utf8FaunaReader to read from a string.

Parameters
strThe string to read from.

Definition at line 57 of file Utf8FaunaReader.cs.

Member Function Documentation

◆ GetBoolean()

bool Fauna.Serialization.Utf8FaunaReader.GetBoolean ( )

Retrieves a boolean value from the current JSON token.

Returns
A boolean representation of the current token's value.

Definition at line 208 of file Utf8FaunaReader.cs.

◆ GetByte()

byte Fauna.Serialization.Utf8FaunaReader.GetByte ( )

Retrieves an byte value from the current token.

Returns
A byte representation of the current token's value.

Definition at line 296 of file Utf8FaunaReader.cs.

◆ GetBytes()

byte[] Fauna.Serialization.Utf8FaunaReader.GetBytes ( )

Retrieves a byte array value from the current token.

Returns
A byte array representation of the current token's value.

Definition at line 314 of file Utf8FaunaReader.cs.

◆ GetDate()

DateOnly Fauna.Serialization.Utf8FaunaReader.GetDate ( )

Retrieves a DateOnly value from the current token.

Returns
A DateOnly representation of the current token's value.

Definition at line 224 of file Utf8FaunaReader.cs.

◆ GetDouble()

double Fauna.Serialization.Utf8FaunaReader.GetDouble ( )

Retrieves a double value from the current token.

Returns
A double representation of the current token's value.

Definition at line 260 of file Utf8FaunaReader.cs.

◆ GetDoubleAsDecimal()

decimal Fauna.Serialization.Utf8FaunaReader.GetDoubleAsDecimal ( )

Retrieves a decimal value from the current token.

Returns
A decimal representation of the current token's value.

Definition at line 278 of file Utf8FaunaReader.cs.

◆ GetEventSource()

EventSource Fauna.Serialization.Utf8FaunaReader.GetEventSource ( )

Retrieves an EventSource token string from the current token.

Returns
A EventSource of the current token's value.

Definition at line 449 of file Utf8FaunaReader.cs.

◆ GetFloat()

float Fauna.Serialization.Utf8FaunaReader.GetFloat ( )

Retrieves a float value from the current token.

Returns
A float representation of the current token's value.

Definition at line 242 of file Utf8FaunaReader.cs.

◆ GetInt()

int Fauna.Serialization.Utf8FaunaReader.GetInt ( )

Retrieves an integer value from the current token.

Returns
An integer representation of the current token's value.

Definition at line 350 of file Utf8FaunaReader.cs.

◆ GetLong()

long Fauna.Serialization.Utf8FaunaReader.GetLong ( )

Retrieves a long value from the current token.

Returns
A long representation of the current token's value.

Definition at line 420 of file Utf8FaunaReader.cs.

◆ GetModule()

Module Fauna.Serialization.Utf8FaunaReader.GetModule ( )

Retrieves a Module object from the current token.

Returns
A Module representation of the current token's value.

Definition at line 438 of file Utf8FaunaReader.cs.

◆ GetShort()

short Fauna.Serialization.Utf8FaunaReader.GetShort ( )

Retrieves an short value from the current token.

Returns
An short representation of the current token's value.

Definition at line 386 of file Utf8FaunaReader.cs.

◆ GetString()

string? Fauna.Serialization.Utf8FaunaReader.GetString ( )

Retrieves a string value from the current token.

Returns
A string representation of the current token's value.

Definition at line 186 of file Utf8FaunaReader.cs.

◆ GetTime()

DateTime Fauna.Serialization.Utf8FaunaReader.GetTime ( )

Retrieves a DateTime value from the current token.

Returns
A DateTime representation of the current token's value.

Definition at line 460 of file Utf8FaunaReader.cs.

◆ GetUnsignedByte()

sbyte Fauna.Serialization.Utf8FaunaReader.GetUnsignedByte ( )

Retrieves an unsigned byte value from the current token.

Returns
An unsigned byte representation of the current token's value.

Definition at line 332 of file Utf8FaunaReader.cs.

◆ GetUnsignedInt()

uint Fauna.Serialization.Utf8FaunaReader.GetUnsignedInt ( )

Retrieves an unsigned integer value from the current token.

Returns
An unsigned integer representation of the current token's value.

Definition at line 368 of file Utf8FaunaReader.cs.

◆ GetUnsignedShort()

ushort Fauna.Serialization.Utf8FaunaReader.GetUnsignedShort ( )

Retrieves an unsigned short value from the current token.

Returns
An unsigned short representation of the current token's value.

Definition at line 403 of file Utf8FaunaReader.cs.

◆ GetValue()

object? Fauna.Serialization.Utf8FaunaReader.GetValue ( )

Gets the value of the current token.

Returns
The value of the current token, or null if no value is associated with the token.
Exceptions
SerializationExceptionThrown when an error occurs during token value retrieval.

Definition at line 165 of file Utf8FaunaReader.cs.

◆ Read()

bool Fauna.Serialization.Utf8FaunaReader.Read ( )

Reads the next token from the source.

Returns
true if the token was read successfully; otherwise, false.

Definition at line 95 of file Utf8FaunaReader.cs.

◆ Skip()

void Fauna.Serialization.Utf8FaunaReader.Skip ( )

Skips the value of the current token.

Definition at line 68 of file Utf8FaunaReader.cs.

◆ TryGetBoolean()

bool Fauna.Serialization.Utf8FaunaReader.TryGetBoolean ( out bool  value)

Tries to retrieve a boolean value from the current token.

Parameters
valueWhen this method returns, contains the boolean value, if the conversion succeeded, or false if the conversion failed.
Returns
true if the token's value could be converted to a boolean; otherwise, false.

Definition at line 489 of file Utf8FaunaReader.cs.

◆ TryGetDateTime()

DateTime Fauna.Serialization.Utf8FaunaReader.TryGetDateTime ( out DateTime  value)

Tries to retrieve a DateTime value from the current token.

Parameters
valueWhen this method returns, contains the DateTime value, if the conversion succeeded, or the default DateTime value if the conversion failed.
Returns
true if the token's value could be converted to a DateTime; otherwise, false.

Definition at line 499 of file Utf8FaunaReader.cs.

◆ TryGetDouble()

double Fauna.Serialization.Utf8FaunaReader.TryGetDouble ( out double  value)

Tries to retrieve a double value from the current token.

Parameters
valueWhen this method returns, contains the double value, if the conversion succeeded, or 0.0 if the conversion failed.
Returns
true if the token's value could be converted to a double; otherwise, false.

Definition at line 509 of file Utf8FaunaReader.cs.

◆ TryGetInt()

int Fauna.Serialization.Utf8FaunaReader.TryGetInt ( out int  value)

Tries to retrieve an integer value from the current token.

Parameters
valueWhen this method returns, contains the integer value, if the conversion succeeded, or 0 if the conversion failed.
Returns
true if the token's value could be converted to an integer; otherwise, false.

Definition at line 519 of file Utf8FaunaReader.cs.

◆ TryGetLong()

long Fauna.Serialization.Utf8FaunaReader.TryGetLong ( out long  value)

Tries to retrieve a long value from the current token.

Parameters
valueWhen this method returns, contains the long value, if the conversion succeeded, or 0 if the conversion failed.
Returns
true if the token's value could be converted to a long; otherwise, false.

Definition at line 529 of file Utf8FaunaReader.cs.

◆ TryGetModule()

Module Fauna.Serialization.Utf8FaunaReader.TryGetModule ( out Module  value)

Tries to retrieve a Module object from the current token.

Parameters
valueWhen this method returns, contains the Module object, if the conversion succeeded, or null if the conversion failed.
Returns
true if the token's value could be converted to a Module; otherwise, false.

Definition at line 539 of file Utf8FaunaReader.cs.

◆ TryGetString()

string Fauna.Serialization.Utf8FaunaReader.TryGetString ( out string  value)

Tries to retrieve a string value from the current token.

Parameters
valueWhen this method returns, contains the string value, if the conversion succeeded, or null if the conversion failed.
Returns
true if the token's value could be converted to a string; otherwise, false.

Definition at line 479 of file Utf8FaunaReader.cs.

Property Documentation

◆ CurrentTokenType

TokenType Fauna.Serialization.Utf8FaunaReader.CurrentTokenType
get

Gets the type of the current token.

Definition at line 34 of file Utf8FaunaReader.cs.


The documentation for this struct was generated from the following file: