MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / IsMdfFile

Function IsMdfFile

lib/mdflib/mdflib/src/mdfreader.cpp:38–53  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36namespace mdf {
37
38bool IsMdfFile(const std::string &filename) {
39 std::filebuf file;
40
41 try {
42 file.open(filename, std::ios_base::in | std::ios_base::binary);
43 } catch (const std::exception&) {
44 return false;
45 }
46
47 if (!file.is_open()) {
48 return false;
49 }
50 const bool is_mdf = IsMdfFile(file);
51 file.close();
52 return is_mdf;
53}
54
55bool IsMdfFile(std::streambuf &buffer) {
56

Callers 6

SetUpTestSuiteMethod · 0.85
TEST_FFunction · 0.85
SetUpTestSuiteMethod · 0.85
OnDropFilesMethod · 0.85
mdflibrary.cppFile · 0.85
MakeFileListMethod · 0.85

Calls 6

strnicmpFunction · 0.85
is_openMethod · 0.80
FileIdMethod · 0.80
openMethod · 0.45
closeMethod · 0.45
ReadMethod · 0.45

Tested by 3

SetUpTestSuiteMethod · 0.68
TEST_FFunction · 0.68
SetUpTestSuiteMethod · 0.68