mirror of https://github.com/AxioDL/metaforce.git
ProjectPath bug fixes
This commit is contained in:
parent
c9f7d67318
commit
d4ce1d4913
|
@ -1 +1 @@
|
|||
Subproject commit ce80446e8b0fb82dc0afa6e2dd7f98303083c2da
|
||||
Subproject commit 579ddc822c769998bdefa527476e13f834beee91
|
|
@ -359,6 +359,8 @@ static inline void SNPrintf(SystemChar* str, size_t maxlen, const SystemChar* fo
|
|||
|
||||
static inline int StrCmp(const SystemChar* str1, const SystemChar* str2)
|
||||
{
|
||||
if (!str1 || !str2)
|
||||
return str1 != str2;
|
||||
#if HECL_UCS2
|
||||
return wcscmp(str1, str2);
|
||||
#else
|
||||
|
@ -368,6 +370,8 @@ static inline int StrCmp(const SystemChar* str1, const SystemChar* str2)
|
|||
|
||||
static inline int StrNCmp(const SystemChar* str1, const SystemChar* str2, size_t count)
|
||||
{
|
||||
if (!str1 || !str2)
|
||||
return str1 != str2;
|
||||
#if HECL_UCS2
|
||||
return wcsncmp(str1, str2, count);
|
||||
#else
|
||||
|
@ -377,6 +381,8 @@ static inline int StrNCmp(const SystemChar* str1, const SystemChar* str2, size_t
|
|||
|
||||
static inline int StrCaseCmp(const SystemChar* str1, const SystemChar* str2)
|
||||
{
|
||||
if (!str1 || !str2)
|
||||
return str1 != str2;
|
||||
#if HECL_UCS2
|
||||
return _wcsicmp(str1, str2);
|
||||
#else
|
||||
|
@ -912,7 +918,7 @@ public:
|
|||
{
|
||||
size_t pos = m_relPath.rfind(_S('/'));
|
||||
if (pos == SystemString::npos)
|
||||
return {};
|
||||
return m_relPath;
|
||||
return {m_relPath.c_str() + pos + 1, m_relPath.size() - pos - 1};
|
||||
}
|
||||
std::string_view getLastComponentUTF8() const
|
||||
|
@ -920,11 +926,11 @@ public:
|
|||
size_t pos = m_relPath.rfind(_S('/'));
|
||||
#if HECL_UCS2
|
||||
if (pos == SystemString::npos)
|
||||
return {};
|
||||
return m_utf8RelPath;
|
||||
return {m_utf8RelPath.c_str() + pos + 1, size_t(m_utf8RelPath.size() - pos - 1)};
|
||||
#else
|
||||
if (pos == SystemString::npos)
|
||||
return {};
|
||||
return m_relPath;
|
||||
return {m_relPath.c_str() + pos + 1, size_t(m_relPath.size() - pos - 1)};
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -432,7 +432,7 @@ static void VisitDirectory(const ProjectPath& dir,
|
|||
std::vector<std::unique_ptr<IDataSpec>>& specInsts,
|
||||
CookProgress& progress, ClientProcess* cp)
|
||||
{
|
||||
if (dir.getLastComponent()[0] == _S('.'))
|
||||
if (dir.getLastComponent().size() > 1 && dir.getLastComponent()[0] == _S('.'))
|
||||
return;
|
||||
|
||||
std::map<SystemString, ProjectPath> children;
|
||||
|
|
|
@ -170,7 +170,8 @@ Time ProjectPath::getModtime() const
|
|||
}
|
||||
else if (S_ISDIR(theStat.st_mode))
|
||||
{
|
||||
hecl::DirectoryEnumerator de(m_absPath);
|
||||
hecl::DirectoryEnumerator de(m_absPath, hecl::DirectoryEnumerator::Mode::DirsThenFilesSorted,
|
||||
false, false, true);
|
||||
for (const hecl::DirectoryEnumerator::Entry& ent : de)
|
||||
{
|
||||
if (!hecl::Stat(ent.m_path.c_str(), &theStat))
|
||||
|
@ -218,7 +219,8 @@ static void _recursiveGlob(Database::Project& proj,
|
|||
/* Compile component into regex */
|
||||
SystemRegex regComp(comp, SystemRegex::ECMAScript);
|
||||
|
||||
hecl::DirectoryEnumerator de(itStr);
|
||||
hecl::DirectoryEnumerator de(itStr, hecl::DirectoryEnumerator::Mode::DirsThenFilesSorted,
|
||||
false, false, true);
|
||||
for (const hecl::DirectoryEnumerator::Entry& ent : de)
|
||||
{
|
||||
if (std::regex_match(ent.m_name, regComp))
|
||||
|
@ -242,14 +244,16 @@ static void _recursiveGlob(Database::Project& proj,
|
|||
|
||||
void ProjectPath::getDirChildren(std::map<SystemString, ProjectPath>& outPaths) const
|
||||
{
|
||||
hecl::DirectoryEnumerator de(m_absPath);
|
||||
hecl::DirectoryEnumerator de(m_absPath, hecl::DirectoryEnumerator::Mode::DirsThenFilesSorted,
|
||||
false, false, true);
|
||||
for (const hecl::DirectoryEnumerator::Entry& ent : de)
|
||||
outPaths[ent.m_name] = ProjectPath(*this, ent.m_name);
|
||||
}
|
||||
|
||||
hecl::DirectoryEnumerator ProjectPath::enumerateDir() const
|
||||
{
|
||||
return hecl::DirectoryEnumerator(m_absPath);
|
||||
return hecl::DirectoryEnumerator(m_absPath, hecl::DirectoryEnumerator::Mode::DirsThenFilesSorted,
|
||||
false, false, true);
|
||||
}
|
||||
|
||||
void ProjectPath::getGlobResults(std::vector<ProjectPath>& outPaths) const
|
||||
|
|
Loading…
Reference in New Issue