MCPcopy Create free account
hub / github.com/bcndev/bytecoin / get_filename_without_folder

Function get_filename_without_folder

src/platform/PathTools.cpp:179–189  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

177}
178
179std::string get_filename_without_folder(const std::string &path) {
180 size_t delim1 = path.rfind("/");
181#if defined(_WIN32)
182 size_t delim2 = path.rfind("\\");
183#else
184 size_t delim2 = std::string::npos;
185#endif
186 size_t delim_pos =
187 delim1 == std::string::npos ? delim2 : delim2 == std::string::npos ? delim1 : std::max(delim1, delim2);
188 return delim_pos != std::string::npos ? path.substr(delim_pos + 1) : path;
189}
190
191bool create_folders_if_necessary(const std::string &path) {
192#if defined(_WIN32)

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected