oml
English | 简体中文
Open Markup Language! A dynamic configuration scripting language that can embed script code in the configuration file to achieve dynamic configuration update.
Manual
rust
Install: Run cargo add oml
in the project directory
C++
Download and compile static libraries (or dynamic libraries)
git clone git@github.com:fawdlstty/oml.git
cd oml
cargo build --release --lib # debug: cargo build --lib
The static library (or dynamic library) is generated in the target/release
directory. Copy it to the C++ project and reference it
int
C#
Run command:
Example:
using System;
namespace test {
public class Program {
public static void Main () {
string src = """
[hello]
value = 12
name = $"hello {value + 12}"
""";
var eroot = oml.OmlExpr.from_str (src);
eroot ["hello"] ["value"].set_int (30);
var root = eroot.evalute ();
Console.WriteLine (root ["hello"] ["name"].as_str()); // hello 42
Console.ReadKey ();
}
}
}
Other features
The value is available when the conditions are met:
[hello]
value = 12
@if value == 12
name = $"hello {value}"