Class JsonUtility
public static class JsonUtility
- Inheritance
-
JsonUtility
- Inherited Members
Methods
ReadFileSkipBOM(string, out Utf8JsonReader, JsonReaderOptions)
Reads all bytes from a file and creates a Utf8JsonReader from the file contents, skipping the UTF-8 BOM if it is present.
public static void ReadFileSkipBOM(string fileName, out Utf8JsonReader reader, JsonReaderOptions options)
Parameters
fileNamestringreaderUtf8JsonReaderoptionsJsonReaderOptions
Exceptions
- FileNotFoundException
- PathTooLongException
- DirectoryNotFoundException
- IOException
- UnauthorizedAccessException
- NotSupportedException
- SecurityException
ReadTopLevelProperties(ref Utf8JsonReader, ReadTopLevelPropertiesHandler<object?>?)
Find all top-level properties on the current object.
public static int ReadTopLevelProperties(ref Utf8JsonReader reader, JsonUtility.ReadTopLevelPropertiesHandler<object?>? action)
Parameters
readerUtf8JsonReaderactionJsonUtility.ReadTopLevelPropertiesHandler<object>
Returns
ReadTopLevelProperties<TState>(ref Utf8JsonReader, ref TState, ReadTopLevelPropertiesHandler<TState>?)
Find all top-level properties on the current object.
public static int ReadTopLevelProperties<TState>(ref Utf8JsonReader reader, ref TState state, JsonUtility.ReadTopLevelPropertiesHandler<TState>? action)
Parameters
readerUtf8JsonReaderstateTStateactionJsonUtility.ReadTopLevelPropertiesHandler<TState>
Returns
Type Parameters
TState
SkipToProperty(ref Utf8JsonReader, string, bool)
Find the first, next property matching the given the propertyName.
public static bool SkipToProperty(ref Utf8JsonReader reader, string propertyName, bool ignoreCase = true)
Parameters
readerUtf8JsonReaderpropertyNamestringignoreCasebool
Returns
Remarks
After calling this method, you can use .GetValue() on the reader.
StartIndenting(Utf8JsonWriter)
Starts indenting until disposed. Use this with a using statement.
public static JsonIndent StartIndenting(this Utf8JsonWriter writer)
Parameters
writerUtf8JsonWriter
Returns
StopIndenting(Utf8JsonWriter)
Stops indenting until disposed. Use this with a using statement.
public static JsonIndent StopIndenting(this Utf8JsonWriter writer)
Parameters
writerUtf8JsonWriter