You've already forked pico-launcher
mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-01-09 16:28:48 -08:00
32 lines
787 B
C++
32 lines
787 B
C++
#include "common.h"
|
|
#include <string.h>
|
|
#include "FileInfoManager.h"
|
|
|
|
FileInfoManager::FileInfoManager(std::unique_ptr<const FileInfo*[]> items, u32 itemCount, const ICoverRepository& coverRepository)
|
|
: _items(std::move(items)), _itemCount(itemCount)
|
|
, _extraFileInfo(std::make_unique<ExtraFileInfo[]>(itemCount))
|
|
, _coverRepository(coverRepository) { }
|
|
|
|
FileInfoManager::~FileInfoManager()
|
|
{
|
|
for (u32 i = 0; i < _itemCount; i++)
|
|
{
|
|
ReleaseFileInfo(i);
|
|
}
|
|
}
|
|
|
|
int FileInfoManager::GetItemIndex(const char* fileName)
|
|
{
|
|
if (fileName == nullptr)
|
|
{
|
|
return -1;
|
|
}
|
|
for (u32 i = 0; i < _itemCount; i++)
|
|
{
|
|
if (strcmp(fileName, _items[i]->GetFileName()) == 0)
|
|
{
|
|
return i;
|
|
}
|
|
}
|
|
return -1;
|
|
} |