Safeheron-SGX-Native-Development-Framework v1.2.0
Loading...
Searching...
No Matches
ssgx::config_t Namespace Reference

This module is designed to be able to directly read configuration file data in enclave. More...

Classes

class  TomlConfig
 A trusted wrapper around the untrusted toml library More...
 
struct  TomlKey
 Represents a key used in TOML data mappings. More...
 

Functions

template<typename T >
std::vector< TomlKeyMakeArgs (T first)
 Creates a vector of TomlKey objects from a single key.
 
template<typename T , typename... Types>
std::vector< TomlKeyMakeArgs (T first, Types... args)
 Creates a vector of TomlKey objects from multiple keys.
 

Detailed Description

This module is designed to be able to directly read configuration file data in enclave.

The configuration file should be written in the TOML v1.0.0 format.

Toml file example
string1 = "hello world"
string2 = """
Roses are red
Violets are blue"""
string3 = """The quick brown fox \
jumps over the lazy dog."""
string4 = 'Tom "Dubs" Preston-Werner'
hex1 = 0xDEADBEEF # hexadecimal
oct1 = 0o12345670 # octal
bin1 = 0b11010110 # binary
dec1 = 36_414_884 # Decimal
colors = ["red", "blue", "yellow", "green"]
number = [-9,-8,-7,-6,-5,-4,-3,-2,-1,0,1,2,3,4,+5,+6,+7,+8,+9]
fruits = [
[ ["apple", "banana", "orange"], ["lemon", "peach"] ],
[ ["pear", "grapes", "strawberry"], ["watermelon", pineapple", "mango"] ],
"An apple a day keeps the doctor away",
{apple = "red", banana = "yellow", peach = "pink"}
]
[animal]
dog.name = "Tina"
dog.age = 4
cat = {name = "Gulu", age = 2}
people = [{name = "Tony", age = 19}, {name = "Jone", age = 21}, {name =
"Lucy", age = 25}]
See also
https://github.com/ToruNiina/toml11/tree/v3.8.1

Function Documentation

◆ MakeArgs() [1/2]

template<typename T >
std::vector< TomlKey > ssgx::config_t::MakeArgs ( T first)

Creates a vector of TomlKey objects from a single key.

Template Parameters
TThe type of the key, either const char* or int
Parameters
[in]firstThe first key in the key-value mapping
Returns
A vector containing the single key

◆ MakeArgs() [2/2]

template<typename T , typename... Types>
std::vector< TomlKey > ssgx::config_t::MakeArgs ( T first,
Types... args )

Creates a vector of TomlKey objects from multiple keys.

Template Parameters
TThe type of the first key, either const char* or int
TypesAdditional types for the other keys
Parameters
[in]firstThe first key in the key-value mapping
[in]argsAdditional keys in the mapping
Returns
A vector containing all keys