summaryrefslogtreecommitdiff
path: root/tomlplusplus/examples/example.toml
diff options
context:
space:
mode:
authorMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 18:44:05 +0300
committerMehmet Samet Duman <yongdohyun@projecttick.org>2026-04-02 18:44:05 +0300
commit0b24459ac12b6cf9fd5a401d647796ca254a8fa8 (patch)
treef2fd66e2476976a51e2a51330fd95dc6e87b24c1 /tomlplusplus/examples/example.toml
parentb85e90fc3480da0e6a48da73201a0b22488cc650 (diff)
parent1c8b7466e4946fcc3bf20484c0e1d001202cca5a (diff)
downloadProject-Tick-0b24459ac12b6cf9fd5a401d647796ca254a8fa8.tar.gz
Project-Tick-0b24459ac12b6cf9fd5a401d647796ca254a8fa8.zip
Add 'tomlplusplus/' from commit '1c8b7466e4946fcc3bf20484c0e1d001202cca5a'
git-subtree-dir: tomlplusplus git-subtree-mainline: b85e90fc3480da0e6a48da73201a0b22488cc650 git-subtree-split: 1c8b7466e4946fcc3bf20484c0e1d001202cca5a
Diffstat (limited to 'tomlplusplus/examples/example.toml')
-rw-r--r--tomlplusplus/examples/example.toml102
1 files changed, 102 insertions, 0 deletions
diff --git a/tomlplusplus/examples/example.toml b/tomlplusplus/examples/example.toml
new file mode 100644
index 0000000000..9612b5301f
--- /dev/null
+++ b/tomlplusplus/examples/example.toml
@@ -0,0 +1,102 @@
+# This is a TOML document. Boom.
+
+title = "TOML Example"
+
+# plain signed integers
+int1 = -9223372036854775808
+int2 = 9223372036854775807
+
+# floats
+flt1 = 0.00000000001
+flt2 = 1e-11
+flt3 = 11.0
+flt4 = +1.0
+
+# hexadecimal with prefix `0x`
+hex1 = 0xDEADBEEF
+hex2 = 0xdeadbeef
+hex3 = 0xdead_beef
+
+# octal with prefix `0o`
+oct1 = 0o01234567
+oct2 = 0o755 # useful for Unix file permissions
+
+# binary with prefix `0b`
+bin1 = 0b11010110 # 214
+
+# local dates and times
+tim1 = 07:32:00
+tim2 = 00:32:00.100000000
+dat1 = 1979-05-27
+
+# offset date-times
+odt1 = 1979-05-27T07:32:00Z
+odt2 = 1979-05-27T00:32:00-07:00
+odt3 = 1979-05-27T00:32:00.999999-07:00
+
+# strings
+str1 = """
+This is a
+multi-line
+string.
+"""
+str2 = "This is also\na multi-line\nstring."
+str3 = 'C:\highway\to\the\danger\zone'
+kosme = "κόσμε" # unicode!
+
+arr = [ 'this', 'is', 'a', 'long', 'array', 'with', 16, 'elements.', 'it', 'should', 'be', 'printed', 'as', 'a', 'multiline', 'array.']
+
+tab = { this = 'is', an = 'inline', table = 'yay'}
+
+dotted.keys.are = "supported"
+dotted.and = "implemented as tables"
+
+[owner]
+name = "Mark Gillard"
+dob = 1987-03-16 10:20:00+09:30
+
+ [[owner.pets]]
+ name = "Brian"
+ species = "cat"
+
+ [[owner.pets]]
+ name = "Skippy"
+ species = "kangaroo"
+
+[database]
+server = "192.168.1.1"
+ports = [ 8001, 8001, 8002 ]
+connection_max = 5000
+enabled = true
+
+[servers]
+
+ # You can indent as you please. Tabs or spaces. TOML don't care.
+ [servers.alpha]
+ ip = "10.0.0.1"
+ dc = "eqdc10"
+
+ [servers.beta]
+ ip = "10.0.0.2"
+ dc = "eqdc10"
+ country = "中国" # This should be parsed as UTF-8
+
+[clients]
+data = [ ["gamma", "delta"], [1, 2] ] # just an update to make sure parsers support it
+
+# Line breaks are OK when inside arrays
+hosts = [
+ "alpha",
+ "omega"
+]
+
+# Products
+
+ [[products]]
+ name = "Hammer"
+ sku = 738594937
+
+ [[products]]
+ name = "Nail"
+ sku = 284758393
+ color = "gray"