MCPcopy Create free account
hub / github.com/colmap/colmap / SplitFileExtension

Function SplitFileExtension

src/colmap/util/file.cc:88–108  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86}
87
88void SplitFileExtension(const std::string& path,
89 std::string* root,
90 std::string* ext) {
91 const auto parts = StringSplit(path, ".");
92 THROW_CHECK_GT(parts.size(), 0);
93 if (parts.size() == 1) {
94 *root = parts[0];
95 *ext = "";
96 } else {
97 *root = "";
98 for (size_t i = 0; i < parts.size() - 1; ++i) {
99 *root += parts[i] + ".";
100 }
101 *root = root->substr(0, root->length() - 1);
102 if (parts.back() == "") {
103 *ext = "";
104 } else {
105 *ext = "." + parts.back();
106 }
107 }
108}
109
110void FileCopy(const std::filesystem::path& src_path,
111 const std::filesystem::path& dst_path,

Callers 2

ExportCamFunction · 0.85
TESTFunction · 0.85

Calls 2

StringSplitFunction · 0.85
sizeMethod · 0.80

Tested by 1

TESTFunction · 0.68