MCPcopy Create free account
hub / github.com/IppClub/Dora-SSR / get

Method get

Source/3rdParty/bx/src/settings.cpp:65–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63}
64
65StringView Settings::get(const StringView& _name) const
66{
67 ini_t* ini = INI_T(m_ini);
68
69 FilePath uri(_name);
70 const StringView path(strTrim(uri.getPath(), "/") );
71 const StringView& fileName(uri.getFileName() );
72 int32_t section = INI_GLOBAL_SECTION;
73
74 if (!path.isEmpty() )
75 {
76 section = ini_find_section(ini, path.getPtr(), path.getLength() );
77 if (INI_NOT_FOUND == section)
78 {
79 section = INI_GLOBAL_SECTION;
80 }
81 }
82
83 int32_t property = ini_find_property(ini, section, fileName.getPtr(), fileName.getLength() );
84 if (INI_NOT_FOUND == property)
85 {
86 return StringView();
87 }
88
89 return ini_property_value(ini, section, property);
90}
91
92void Settings::set(const StringView& _name, const StringView& _value)
93{

Callers

nothing calls this directly

Calls 8

strTrimFunction · 0.85
ini_find_sectionFunction · 0.85
ini_find_propertyFunction · 0.85
ini_property_valueFunction · 0.85
getPathMethod · 0.65
StringViewClass · 0.50
isEmptyMethod · 0.45
getLengthMethod · 0.45

Tested by

no test coverage detected