Add the source files QListObject.cs, QListParser.cs, and QListSerializer.cs to your project.
using QList;
var obj = new QListObject();
obj["name"] = "Alice";
obj["age"] = 30;
obj["isActive"] = true;
obj["scores"] = new List<object> { 95, 88, 76 };
var address = new QListObject();
address["city"] = "Wonderland";
address["zip"] = "12345";
obj["address"] = address;
var serializer = new QListSerializer();
string serialized = serializer.Serialize(obj);
// Example Output:
// {name="Alice";age=30;isActive=true;scores=[95,88,76];address={city="Wonderland";zip="12345";};}
var parser = new QListParser();
QListObject parsed = parser.Parse(serialized);
string name = parsed["name"] as string; // "Alice"
{
name="Alice";
age=30;
isActive=true;
scores=[95,88,76];
address={city="Wonderland";zip="12345";};
}
Dictionary<string, object> Properties - Stores the object's key-value pairs.object this[string key] - Indexer for getting/setting properties.string Serialize(QListObject obj) - Serializes a QListObject to a string.QListObject Parse(string input) - Parses a string into a QListObject.