Table of Contents

Class JsonData.Int

Namespace
PAC.Json

Represents an int in JSON data.

public class JsonData.Int : JsonData
Inheritance
JsonData.Int
Implements
Inherited Members

Constructors

Int(int)

public Int(int value)

Parameters

value int

Properties

value

public int value { get; set; }

Property Value

int

Methods

Parse(TextReader, bool)

Reads the TextReader, starting at the given index, and attempts to parse it as a JsonData.Int. If successful, the last read character will be the last character of the parsed JSON.

public static JsonData.Int Parse(TextReader reader, bool mustReadAll)

Parameters

reader TextReader
mustReadAll bool

If true, it will check that all the data in the reader was used when parsing. Setting this to false is useful for parsing JSON data inside a list or object.

Returns

JsonData.Int

Parse(string)

Attempts to parse the string into a JsonData.Int.

public static JsonData.Int Parse(string str)

Parameters

str string

Returns

JsonData.Int

Parse(string, ref int)

Reads the string, starting at the given index, and attempts to parse the string as a JsonData.Int. If successful, the index will be moved to the last digit of the int.

public static JsonData.Int Parse(string str, ref int index)

Parameters

str string
index int

Returns

JsonData.Int

ToJsonString(bool)

Converts it into a string in JSON format.

public string ToJsonString(bool pretty)

Parameters

pretty bool

If true, puts the string into pretty form - e.g. with indentations.

Returns

string

Operators

explicit operator Int(float)

public static explicit operator JsonData.Int(float value)

Parameters

value float

Returns

JsonData.Int

implicit operator int(Int)

public static implicit operator int(JsonData.Int jsonInt)

Parameters

jsonInt JsonData.Int

Returns

int

implicit operator float(Int)

public static implicit operator float(JsonData.Int jsonInt)

Parameters

jsonInt JsonData.Int

Returns

float

implicit operator Int(int)

public static implicit operator JsonData.Int(int value)

Parameters

value int

Returns

JsonData.Int