mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 09:06:54 +02:00
Initial commit
This commit is contained in:
42
arm9/source/romBrowser/FileInfo.h
Normal file
42
arm9/source/romBrowser/FileInfo.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
#include "fat/ff.h"
|
||||
#include "fat/FastFileRef.h"
|
||||
#include "FileType/FileType.h"
|
||||
|
||||
class InternalFileInfo;
|
||||
|
||||
class FileInfo
|
||||
{
|
||||
public:
|
||||
FileInfo() { }
|
||||
FileInfo(const FileInfo& fileInfo);
|
||||
FileInfo(const TCHAR* fileName, const FileType* type, const FastFileRef& fastFileRef);
|
||||
|
||||
FileInfo &operator=(FileInfo&& rhs)
|
||||
{
|
||||
if (this != &rhs)
|
||||
{
|
||||
_name = std::move(rhs._name);
|
||||
_type = rhs._type;
|
||||
_fastFileRef = rhs._fastFileRef;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
const TCHAR* GetFileName() const { return _name.get(); }
|
||||
const FileType* GetFileType() const { return _type; }
|
||||
u32 GetFileSize() const { return _fastFileRef.GetFileSize(); }
|
||||
|
||||
InternalFileInfo* CreateInternalFileInfo() const
|
||||
{
|
||||
return _type->CreateInternalFileInfo(_fastFileRef);
|
||||
}
|
||||
|
||||
const FastFileRef& GetFastFileRef() const { return _fastFileRef; }
|
||||
|
||||
private:
|
||||
std::unique_ptr<TCHAR[]> _name;
|
||||
const FileType* _type;
|
||||
FastFileRef _fastFileRef;
|
||||
};
|
||||
Reference in New Issue
Block a user