rj-action-library/Runtime/Text/JSON/JSON.cs

35 lines
769 B
C#

using System.Collections;
using System.Collections.Generic;
using System.Text;
namespace Rokojori
{
public class JSON
{
public static string Stringify( JSONData jsonData )
{
return jsonData.Stringify();
}
public static JSONData Parse( string jsonString )
{
return new JSONParser().Parse( jsonString );
}
public static string StringifyObject( object value )
{
var serializer = new JSONSerializer( new JSONSerializationSettings() );
return serializer.Serialize( value );
}
public static T ParseObject<T>( string jsonString ) where T:new()
{
var deserializer = new JSONDeserializer( new JSONSerializationSettings() );
return deserializer.Deserialize<T>( jsonString );
}
}
}