mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 19:45:41 -04:00
[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:
parent
5ed38edbec
commit
6b30dd5b70
@ -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());
|
||||
}
|
||||
|
@ -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 **/
|
||||
|
Loading…
Reference in New Issue
Block a user