FrameIT
JSONsavable Class Reference

Classes

class  JsonAutoPostProcessAttribute
 
class  JsonAutoPreProcessAttribute
 
class  JsonSeparateAttribute
 

Static Public Member Functions

static bool WriteToJsonFile (string filePath, object objectToWrite)
 Writes the given object instance to a Json file, recursively, including public members, excluding [JsonIgnore]. More...
 
static bool ReadFromJsonFile< T > (out T payload, string filePath)
 Reads an object instance from an Json file. More...
 

Detailed Description

Does not yet work with collections

Member Function Documentation

◆ ReadFromJsonFile< T >()

static bool JSONsavable.ReadFromJsonFile< T > ( out T  payload,
string  filePath 
)
static

Reads an object instance from an Json file.

Object type must have a parameterless constructor.

Template Parameters
TThe type of object to read from the file.
Parameters
filePathThe file path to read the object instance from.
Returns
Returns a new instance of the object read from the Json file.
Type Constraints
T :new() 

◆ WriteToJsonFile()

static bool JSONsavable.WriteToJsonFile ( string  filePath,
object  objectToWrite 
)
static

Writes the given object instance to a Json file, recursively, including public members, excluding [JsonIgnore].

Object type must have a parameterless constructor.

Only public properties and variables will be written to the file. These can be any type though, even other non-abstract classes.

Parameters
filePathThe file path to write the object instance to.
objectToWriteThe object instance to write to the file.

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