File: example.toml

package info (click to toggle)
tomlplusplus 3.3.0%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,184 kB
  • sloc: cpp: 35,145; ansic: 2,220; python: 983; makefile: 25; sh: 17
file content (102 lines) | stat: -rw-r--r-- 1,887 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
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"