92 std::string::size_type lastSlash = filename.find_last_of(
'\\');
94 std::string::size_type lastSlash = filename.find_last_of(
'/');
96 if (lastSlash != std::string::npos)
97 return filename.substr(0, lastSlash);
103 const std::string& newExt,
bool stripDot) {
104 std::string::size_type lastDot = filename.find_last_of(
'.');
105 if (lastDot != std::string::npos) {
107 return filename.substr(0, lastDot) + newExt;
109 return filename.substr(0, lastDot + 1) + newExt;
120 std::vector<std::string> result;
125 WIN32_FIND_DATA FData;
126 if ((hFind = FindFirstFile(pattern, &FData)) != INVALID_HANDLE_VALUE) {
128 result.push_back(FData.cFileName);
129 }
while (FindNextFile(hFind, &FData));
133#elif (defined(UNIX) || defined(CYGWIN)) && !defined(ANDROID)
136 wordexp(pattern, &p, 0);
142 for (
int k = 0; (k < 100) && (p.we_wordc == 0); k++) {
145 wordexp(pattern, &p, WRDE_APPEND);
149 result.reserve(p.we_wordc);
150 for (
size_t i = 0; i < p.we_wordc; ++i) result.push_back(p.we_wordv[i]);