Fauna v10 .NET/C# Driver 0.2.0-beta
 
Loading...
Searching...
No Matches
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.
 
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.
 
Stream GetStream ()
 Retrieves a Stream 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 45 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 55 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 201 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 289 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 217 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 253 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 271 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 235 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 325 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 395 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 413 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 361 of file Utf8FaunaReader.cs.

◆ GetStream()

Stream Fauna.Serialization.Utf8FaunaReader.GetStream ( )

Retrieves a Stream token string from the current token.

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

Definition at line 424 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 180 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 435 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 307 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 343 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 378 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 160 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 93 of file Utf8FaunaReader.cs.

◆ Skip()

void Fauna.Serialization.Utf8FaunaReader.Skip ( )

Skips the value of the current token.

Definition at line 66 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 464 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 474 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 484 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 494 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 504 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 514 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 454 of file Utf8FaunaReader.cs.

Property Documentation

◆ CurrentTokenType

TokenType Fauna.Serialization.Utf8FaunaReader.CurrentTokenType
get

Gets the type of the current token.

Definition at line 33 of file Utf8FaunaReader.cs.


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