MCPcopy Create free account
hub / github.com/FastLED/FastLED / open

Method open

src/fl/stl/fstream.cpp.hpp:28–44  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26}
27
28void ifstream::open(const char* path, ios::openmode mode) {
29 close();
30
31 // Build fopen mode string
32 const char* fmode = (mode & ios::binary) ? "rb" : "r";
33
34 mHandle = fl::make_shared<detail::posix_filebuf>(path, fmode);
35
36 if (mHandle->is_open()) {
37 if (mode & ios::ate) {
38 mHandle->seek(0, seek_dir::end);
39 }
40 updateState();
41 } else {
42 updateState();
43 }
44}
45
46void ifstream::close() {
47 if (mHandle && mHandle->is_open()) {

Callers 15

FsArduinoClass · 0.45
handleToolsActionChangeFunction · 0.45
StubFileHandleMethod · 0.45
excludes_from_fileFunction · 0.45
run_clang_format_diffFunction · 0.45
mainFunction · 0.45
install_esbuildFunction · 0.45
mainFunction · 0.45

Calls 3

closeFunction · 0.50
is_openMethod · 0.45
seekMethod · 0.45

Tested by 2

FL_TEST_FILEFunction · 0.36
FL_TEST_FILEFunction · 0.36