2010-12-08 08:26:18 +01:00
|
|
|
#ifndef SHAREDCONTENTMAP_H
|
|
|
|
#define SHAREDCONTENTMAP_H
|
|
|
|
|
|
|
|
#include "includes.h"
|
|
|
|
|
2010-12-10 04:50:08 +01:00
|
|
|
//class for handling a content.map from a wii nand
|
2010-12-08 08:26:18 +01:00
|
|
|
class SharedContentMap
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
SharedContentMap( QByteArray old = QByteArray() );
|
|
|
|
|
|
|
|
//checks that the content map is sane
|
|
|
|
//size should be correct, contents should be in numerical order
|
|
|
|
//if a path is given, it will check that the hashes in the map match up with the contents in the folder
|
|
|
|
bool Check( const QString &path = QString() );
|
|
|
|
|
2010-12-10 04:50:08 +01:00
|
|
|
//gets a string containing the 8 letter app that matches the given hash.
|
|
|
|
//returns an empty string if the hash is not found in the map
|
2010-12-08 08:26:18 +01:00
|
|
|
QString GetAppFromHash( QByteArray hash );
|
2010-12-10 04:50:08 +01:00
|
|
|
|
|
|
|
//gets the first available u32 that is not already in the map and returns it as a string
|
2010-12-08 08:26:18 +01:00
|
|
|
QString GetNextEmptyCid();
|
|
|
|
|
2010-12-10 04:50:08 +01:00
|
|
|
//adds an entry to the end of the map
|
|
|
|
//! this function doesnt check if the entry already exists
|
2010-12-08 08:26:18 +01:00
|
|
|
void AddEntry( const QString &app, const QByteArray &hash );
|
|
|
|
|
2010-12-10 04:50:08 +01:00
|
|
|
//get the entire data ready for writing to a wii nand
|
2010-12-08 08:26:18 +01:00
|
|
|
const QByteArray Data(){ return data; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
QByteArray data;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SHAREDCONTENTMAP_H
|