Fauna .NET Driver 0.1.0-beta
 
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.
 
double GetDouble ()
 Retrieves a double value from the current token.
 
decimal GetDoubleAsDecimal ()
 Retrieves a decimal value from the current token.
 
int GetInt ()
 Retrieves an integer 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.
 
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 12 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 44 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 54 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 200 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 216 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 234 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 252 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 270 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 288 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 306 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 179 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 317 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 159 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 92 of file Utf8FaunaReader.cs.

◆ Skip()

void Fauna.Serialization.Utf8FaunaReader.Skip ( )

Skips the value of the current token.

Definition at line 65 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 346 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 356 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 366 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 376 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 386 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 396 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 336 of file Utf8FaunaReader.cs.

Property Documentation

◆ CurrentTokenType

TokenType Fauna.Serialization.Utf8FaunaReader.CurrentTokenType
get

Gets the type of the current token.

Definition at line 32 of file Utf8FaunaReader.cs.


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