MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / getFileExtension

Function getFileExtension

Common/helper_string.h:110–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110inline int getFileExtension(char *filename, char **extension) {
111 int string_length = static_cast<int>(strlen(filename));
112
113 while (filename[string_length--] != '.') {
114 if (string_length == 0) break;
115 }
116
117 if (string_length > 0) string_length += 2;
118
119 if (string_length == 0)
120 *extension = NULL;
121 else
122 *extension = &filename[string_length];
123
124 return string_length;
125}
126
127inline bool checkCmdLineFlag(const int argc, const char **argv,
128 const char *string_ref) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected