HF
This commit is contained in:
@ -276,7 +276,11 @@ namespace ia
|
||||
const auto count = last - first;
|
||||
res.reserve((count/stride) + 2);
|
||||
const auto end = start + count + 1;
|
||||
for(size_type i = start; i < end; i += stride) new (&res.m_data[res.m_count++]) value_type(Base::m_data[i]);
|
||||
for(size_type i = start; i < end; i += stride)
|
||||
{
|
||||
new (&res.m_data[res.m_count++]) value_type(Base::m_data[i]);
|
||||
if(!Base::m_data[i]) break;
|
||||
}
|
||||
res.back() = '\0';
|
||||
return IA_MOVE(res);
|
||||
}
|
||||
|
||||
@ -121,10 +121,10 @@ namespace ia
|
||||
if constexpr (includeExtension)
|
||||
return path.slice(t + 1, path.end());
|
||||
|
||||
return path.slice(t + 1, path.begin() + (path.rfind('.') - t) - 1);
|
||||
return path.slice(t + 1, path.rfind('.'));
|
||||
}
|
||||
|
||||
String ExtractDirectoryFromPath(IN CONST String &path)
|
||||
template<BOOL includeTrailingSlash> STATIC String ExtractDirectoryFromPath(IN CONST String &path)
|
||||
{
|
||||
constexpr char pathDelimiter = '/';
|
||||
|
||||
@ -132,7 +132,10 @@ namespace ia
|
||||
if (t == path.end())
|
||||
return "./";
|
||||
|
||||
return path.slice(0, t + 1);
|
||||
if CONSTEXPR (includeTrailingSlash)
|
||||
return path.slice(path.begin(), t + 1);
|
||||
else
|
||||
return path.slice(path.begin(), t);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user