MCPcopy Create free account
hub / github.com/TactilityProject/Tactility / label_set_text_file

Function label_set_text_file

Tactility/Source/lvgl/LabelUtils.cpp:7–19  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5namespace tt::lvgl {
6
7bool label_set_text_file(lv_obj_t* label, const char* filepath) {
8 std::unique_ptr<uint8_t[]> text;
9 file::getLock(filepath)->withLock([&text, filepath] {
10 text = file::readString(filepath);
11 });
12
13 if (text != nullptr) {
14 lv_label_set_text(label, reinterpret_cast<const char*>(text.get()));
15 return true;
16 } else {
17 return false;
18 }
19}
20
21} // namespace

Callers

nothing calls this directly

Calls 4

getLockFunction · 0.85
readStringFunction · 0.85
withLockMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected