MCPcopy Create free account
hub / github.com/PlatformLab/NanoLog / open

Method open

runtime/Log.cc:1074–1094  ·  view source on GitHub ↗

* Opens a compressed log with contents created by Encoder. * * \param filename * Compressed log file to open * \return * True if success, false if the log file is not valid or cannot be opened */

Source from the content-addressed store, hash-verified

1072 * True if success, false if the log file is not valid or cannot be opened
1073 */
1074bool
1075Log::Decoder::open(const char *filename) {
1076 inputFd = fopen(filename, "rb");
1077 good = false;
1078
1079 if (!inputFd)
1080 return false;
1081
1082 if(!readDictionary(inputFd, true)) {
1083 fclose(inputFd);
1084 inputFd = nullptr;
1085 return false;
1086 }
1087
1088 this->filename = std::string(filename);
1089 numBufferFragmentsRead = 0;
1090 numCheckpointsRead = 1;
1091 logMsgsPrinted = 0;
1092 good = true;
1093 return true;
1094}
1095/**
1096 * Decoder destructor
1097 */

Callers 5

mainFunction · 0.80
TEST_FFunction · 0.80
ifstreamReadHelperFunction · 0.80
freadHelperFunction · 0.80
fgetcFnFunction · 0.80

Calls

no outgoing calls

Tested by 1

TEST_FFunction · 0.64