MCPcopy Create free account
hub / github.com/OpenBoardView/OpenBoardView / check_fileext

Function check_fileext

src/openboardview/utils.cpp:52–56  ·  view source on GitHub ↗

Extract extension from filename and check against given fileext fileext must be lowercase

Source from the content-addressed store, hash-verified

50// Extract extension from filename and check against given fileext
51// fileext must be lowercase
52bool check_fileext(const filesystem::path &filepath, const std::string fileext) {
53 std::string ext{filepath.extension().string()}; // extract file ext
54 std::transform(ext.begin(), ext.end(), ext.begin(), ::tolower); // make ext lowercase
55 return ext == fileext;
56}
57
58// Returns true if the given str was found in buf
59bool find_str_in_buf(const std::string str, const std::vector<char> &buf) {

Callers 2

LoadFileMethod · 0.85
loadMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected