Skip to content

xuan25/Json

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Json

Single file Json parser and serializer

Json.Value.Object rootObject = new Json.Value.Object()
{
    { "count", 4 },
    { "items",
        new Json.Value.Array()
        {
            new Json.Value.Object()
            {
                { "id", 1 },
                { "ip", "8.8.8.8" },
                { "provider", "Google" },
            },
            new Json.Value.Object()
            {
                { "id", 2 },
                { "ip", "8.8.4.4" },
                { "provider", "Google" },
            },
            new Json.Value.Object()
            {
                { "id", 3 },
                { "ip", "1.1.1.1" },
                { "provider", "Cloudflare" },
            },
            new Json.Value.Object()
            {
                { "id", 4 },
                { "ip", "1.0.0.1" },
                { "provider", "Cloudflare" },
            },
        }
    }
};

string jsonStr = rootObject.ToString();

Json.Value parsedObject = Json.Parser.Parse(jsonStr);

About

Single file Json parser and serializer

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages