MCPcopy Create free account
hub / github.com/CVCUDA/CV-CUDA / GetFunctionName

Function GetFunctionName

src/nvcv/util/CheckError.cpp:28–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26namespace nvcv::util {
27
28static std::string_view GetFunctionName(const std::string_view &stmt)
29{
30 static std::regex rgx("^([A-Za-z0-9_]+)\\(.*$");
31
32 std::match_results<std::string_view::const_iterator> match;
33 if (regex_match(stmt.begin(), stmt.end(), match, rgx))
34 {
35 // With C++20 we can construct the string_view with the range directly
36 return std::string_view(match[1].first, std::distance(match[1].first, match[1].second));
37 }
38 else
39 {
40 return "";
41 }
42}
43
44namespace detail {
45const char *GetCheckMessage(char *buf, int bufsize)

Callers 1

FormatErrorMessageFunction · 0.85

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected