Skip to content

gearintelligent/GI.CSharpJSON

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

CSharpJSON

JSON Data Management

Basic usage

import GI;
...

class Test {
  void Main() {
    // Init
    JSON data = new JSON(JSONType.Object);
    
    // Set
    data["string"] = new JSON("Bar");
    data["number"] = new JSON(100);
    data["bool"] = new JSON(true);
    data["null"] = new JSON();
    data.ObjAdd("time", new JSON(DateTime.Now));
    
    // Get
    int num = data["number"].NumberValue;
    string str = data["string"].StringValue;
    bool bol = data["bool"].BoolValue;
    object obj = data["null"].Value;
  }
}

Basic deserialize / parse

import GI;
...

class Test {
  void Main() {
    string jstr = "{\"foo\": \"bar\", \"num\": 5}";
    JSON data = JSON.Parse(jstr);
  }
}

Basic serialize / encode

import GI;
...

class Test {
  void Main() {
    JSON data = new JSON("foo");
    MessageBox.Show(data.ToString());
  }
}

Contribute are welcome XD

About

JSON Data Management

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages