MCPcopy Create free account
hub / github.com/Alexays/Waybar / getFileContents

Method getFileContents

src/util/css_reload_helper.cpp:29–40  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

27 : m_cssFile(std::move(cssFile)), m_callback(std::move(callback)) {}
28
29std::string waybar::CssReloadHelper::getFileContents(const std::string& filename) {
30 if (filename.empty()) {
31 return {};
32 }
33
34 std::ifstream file(filename);
35 if (!file.is_open()) {
36 return {};
37 }
38
39 return {(std::istreambuf_iterator<char>(file)), std::istreambuf_iterator<char>()};
40}
41
42std::string waybar::CssReloadHelper::findPath(const std::string& filename) {
43 // try path and fallback to looking relative to the config

Callers

nothing calls this directly

Calls 1

emptyMethod · 0.80

Tested by

no test coverage detected