MCPcopy Create free account
hub / github.com/WiVRn/WiVRn / parse_key_value

Function parse_key_value

common/utils/ini.cpp:40–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40static constexpr std::optional<wivrn::ini::key_value> parse_key_value(std::string_view section, std::string_view line)
41{
42 size_t equal_sign = line.find('=');
43 if (equal_sign == std::string_view::npos)
44 return {};
45
46 auto key = strip(line.substr(0, equal_sign)); // TODO locale
47 auto value = strip(line.substr(equal_sign + 1));
48
49 return wivrn::ini::key_value{
50 .section = section,
51 .key = key,
52 .locale = "",
53 .value = value,
54 };
55}
56
57std::optional<std::string_view> wivrn::ini::get_optional(std::string_view section, std::string_view key) const
58{

Callers 1

iniMethod · 0.85

Calls 2

stripFunction · 0.85
findMethod · 0.80

Tested by

no test coverage detected