mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-12-08 15:44:56 +00:00
Add HECL::Rename
This commit is contained in:
2
hecl/extern/Athena
vendored
2
hecl/extern/Athena
vendored
Submodule hecl/extern/Athena updated: 9c880813ac...cf3739fced
@@ -300,6 +300,15 @@ static inline FILE* Fopen(const SystemChar* path, const SystemChar* mode, FileLo
|
||||
return fp;
|
||||
}
|
||||
|
||||
static inline int Rename(const SystemChar* oldpath, const SystemChar* newpath)
|
||||
{
|
||||
#if HECL_UCS2
|
||||
return _wrename(oldpath, newpath);
|
||||
#else
|
||||
return rename(oldpath, newpath);
|
||||
#endif
|
||||
}
|
||||
|
||||
static inline int Stat(const SystemChar* path, Sstat* statOut)
|
||||
{
|
||||
#if HECL_UCS2
|
||||
@@ -664,6 +673,18 @@ public:
|
||||
Hash hash() const {return m_hash;}
|
||||
bool operator==(const ProjectRootPath& other) const {return m_hash == other.m_hash;}
|
||||
bool operator!=(const ProjectRootPath& other) const {return m_hash != other.m_hash;}
|
||||
|
||||
/**
|
||||
* @brief Obtain c-string of final path component
|
||||
* @return Final component c-string (may be empty)
|
||||
*/
|
||||
const SystemChar* getLastComponent() const
|
||||
{
|
||||
size_t pos = m_projRoot.rfind(_S('/'));
|
||||
if (pos == SystemString::npos)
|
||||
return m_projRoot.c_str() + m_projRoot.size();
|
||||
return m_projRoot.c_str() + pos + 1;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user