[libromdata] IsoPartition: Mark findLastSlash() and parseTimestamp() as static.

They don't depend on any data in IsoPartitionPrivate.

TODO: HSFS/CDI support?
This commit is contained in:
David Korth 2025-06-07 15:52:29 -04:00
parent 5ed38edbec
commit 6b30dd5b70
2 changed files with 19 additions and 3 deletions

View File

@ -14,6 +14,9 @@
#include "../iso_structs.h"
#include "hsfs_structs.h"
// TESTING
#include "../disc/IsoPartition.hpp"
// Other rom-properties libraries
#include "librpbase/Achievements.hpp"
#include "librpbase/disc/PartitionFile.hpp"
@ -911,6 +914,17 @@ int ISO::loadFieldData(void)
d->s_udf_version);
}
// TESTING: readdir()
IsoPartition *iso = new IsoPartition(d->file, 0, 0);
auto dirp = iso->opendir("/NT3x");
printf("dirp: %p\n", dirp);
const IFst::DirEnt *dirent;
while ((dirent = iso->readdir(dirp)) != nullptr) {
printf("- type %d, name: %s\n", dirent->type, dirent->name);
}
int ret = iso->closedir(dirp);
printf("closedir: %d\n", ret);
// Finished reading the field data.
return static_cast<int>(d->fields.count());
}

View File

@ -19,6 +19,8 @@ using namespace LibRpText;
using std::string;
using std::unordered_map;
// TODO: HSFS/CDI support?
namespace LibRomData {
class IsoPartitionPrivate
@ -56,7 +58,7 @@ public:
* @param path Path.
* @return Last slash or backslash, or nullptr if not found.
*/
inline const char *findLastSlash(const char *path)
static inline const char *findLastSlash(const char *path)
{
const char *sl = strrchr(path, '/');
const char *const bs = strrchr(path, '\\');
@ -65,7 +67,7 @@ public:
sl = bs;
}
}
return (sl ? sl : bs);
return (sl) ? sl : bs;
}
/**
@ -97,7 +99,7 @@ public:
* @param isofiletime File timestamp.
* @return Unix time.
*/
time_t parseTimestamp(const ISO_Dir_DateTime_t *isofiletime);
static time_t parseTimestamp(const ISO_Dir_DateTime_t *isofiletime);
};
/** IsoPartitionPrivate **/