| 63 | } |
| 64 | |
| 65 | StringView 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 | |
| 92 | void Settings::set(const StringView& _name, const StringView& _value) |
| 93 | { |
nothing calls this directly
no test coverage detected