Pinecone (.pc) is a fast open-sourced configuration language with type annotations and comments
Line structure: key
: type
= value
Supported types: string
, int
, float
, boolean
Arrays are specified using square-brackets in type definition type[]
, value should be enclosed in square brackets and elements are split using commas [element0, element1]
Whitespace is ignored outside of brackets ("
or '
)
You can comment using //
// this is a comment and will be ignored
title: string = "Some Title" // you can also place comments here
version: string = "1.0.0"
someInt: int = 0
someFloat: float = 0.15
tags: string[] = ["tag01", "tag02"]
usePassword: boolean == false // you can also write 0 or 1
using PineconeSharp;
namespace PineconeDemo
{
public class Program
{
public static void Main()
{
try
{
var result = Parse("example.pc", new PineconeParseOptions());
Console.WriteLine(result["title"]);
Console.WriteLine(result["version"]);
Console.WriteLine(result["someInt"]);
Console.WriteLine(result["someFloat"]);
object[] tags = (object[])result["tags"];
for (int i = 0; i < tags.Length; i++)
Console.WriteLine(tags[i]);
Console.WriteLine(result["usePassword"]);
}
catch (Exception e)
{
Console.WriteLine(e);
}
}
}
}