Lines Matching defs:file

5  * you may not use this file except in compliance with the License.
38 * @brief Helper to close a file handle
114 std::ifstream file;
117 file.exceptions(std::ifstream::failbit | std::ifstream::badbit |
121 file.open(path);
122 file >> name;
142 std::ifstream file;
147 file.exceptions(std::ifstream::failbit | std::ifstream::badbit |
155 file.open(path);
156 file.read(&val[0], 1);
163 "Invalid character in sysfs file FILE={FILE} CONTENTS={CONTENTS}",
175 "Failed to read sysfs file errno={ERRNO} FILENAME={FILENAME}",
198 std::ifstream file;
202 file.exceptions(std::ifstream::failbit | std::ifstream::badbit |
207 file.open(path);
208 file >> std::hex >> data;
217 "Failed to read sysfs file errno={ERRNO} FILENAME={FILENAME}",
238 std::ifstream file;
242 file.exceptions(std::ifstream::failbit | std::ifstream::badbit |
247 file.open(path);
248 file >> data;
254 "Failed to read sysfs file errno={ERRNO} FILENAME={FILENAME}",
274 std::unique_ptr<FILE, FileCloser> file{fopen(path.c_str(), "rb")};
276 if (file)
281 fread(data.data(), sizeof(decltype(data[0])), length, file.get());
286 if (feof(file.get()))
290 else if (ferror(file.get()))
294 "Failed to read sysfs file errno={ERRNO} FILENAME={FILENAME}",
312 std::ofstream file;
317 file.exceptions(std::ofstream::failbit | std::ofstream::badbit |
322 file.open(path);
323 file << value;
329 "Failed to write sysfs file errno={ERRNO} FILENAME={FILENAME}",
343 std::ofstream file;
348 file.exceptions(std::ofstream::failbit | std::ofstream::badbit |
354 file.open(path, std::ios::out | std::ios_base::binary);
355 lg2::debug("Write data to sysfs file FILENAME={FILENAME}", "FILENAME",
357 file.write(reinterpret_cast<const char*>(&data[0]), data.size());
363 "Failed to write binary data to sysfs file errno={ERRNO} FILENAME={FILENAME}",