RhythmGame 1.4.3
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
resource_managers::SongAssetStore Class Reference

#include <SongAssetStore.h>

Inheritance diagram for resource_managers::SongAssetStore:
Inheritance graph
[legend]
Collaboration diagram for resource_managers::SongAssetStore:
Collaboration graph
[legend]

Classes

struct  ArchiveEntry
 
class  Impl
 

Public Types

using WantsContents = std::function< bool(const std::filesystem::path &virtualPath)>
 
using EntryVisitor = std::function< void(ArchiveEntry entry)>
 

Public Member Functions

 SongAssetStore (QObject *parent=nullptr)
 
 ~SongAssetStore () override
 
auto read (const std::filesystem::path &virtualPath, const std::atomic_bool *stop=nullptr) const -> QByteArray
 
auto materialize (const std::filesystem::path &virtualPath, const std::atomic_bool *stop=nullptr) const -> std::filesystem::path
 
auto materializeRelative (const std::filesystem::path &virtualDirectory, const std::vector< std::filesystem::path > &relativePaths, const std::atomic_bool *stop=nullptr) const -> std::unordered_map< std::filesystem::path, std::filesystem::path >
 
void walkArchive (const std::filesystem::path &archivePath, const WantsContents &wantsContents, const EntryVisitor &visitor, std::atomic_bool *stop=nullptr) const
 
auto isArchived (const std::filesystem::path &virtualPath) const -> bool
 
auto isVirtual (const std::filesystem::path &virtualPath) const -> bool
 
Q_INVOKABLE QString imageSource (const QString &virtualDirectory, const QString &relativePath) const
 
Q_INVOKABLE QString localFile (const QString &virtualPath) const
 
Q_INVOKABLE QString containingFolder (const QString &virtualPath) const
 

Static Public Member Functions

static auto isArchivePath (const std::filesystem::path &path) -> bool
 
static auto isSupportedArchivePath (const std::filesystem::path &path) -> bool
 
static auto archiveSupportError (const std::filesystem::path &path) -> QString
 
static auto isSplitArchivePath (const std::filesystem::path &path) -> bool
 
static auto imageUrl (const std::filesystem::path &virtualPath) -> QString
 
static auto imageUrl (const QString &virtualDirectory, const QString &relativePath) -> QString
 
static auto audioUrl (const std::filesystem::path &virtualPath) -> QString
 
static auto isAudioUrl (const QString &source) -> bool
 
static auto pathFromUrl (const QString &source) -> std::filesystem::path
 

Detailed Description

Resolves song-library virtual paths across ordinary directories and ZIP archives. A path such as C:/songs/collection.zip/song/chart.bms is kept as the public identity; the archive boundary is handled inside this module.

Member Typedef Documentation

◆ EntryVisitor

◆ WantsContents

using resource_managers::SongAssetStore::WantsContents = std::function<bool(const std::filesystem::path& virtualPath)>

Constructor & Destructor Documentation

◆ SongAssetStore()

resource_managers::SongAssetStore::SongAssetStore ( QObject *  parent = nullptr)
explicit

◆ ~SongAssetStore()

resource_managers::SongAssetStore::~SongAssetStore ( )
overridedefault

Member Function Documentation

◆ archiveSupportError()

auto resource_managers::SongAssetStore::archiveSupportError ( const std::filesystem::path &  path) -> QString
static

◆ audioUrl()

auto resource_managers::SongAssetStore::audioUrl ( const std::filesystem::path &  virtualPath) -> QString
static

◆ containingFolder()

QString resource_managers::SongAssetStore::containingFolder ( const QString &  virtualPath) const

◆ imageSource()

QString resource_managers::SongAssetStore::imageSource ( const QString &  virtualDirectory,
const QString &  relativePath 
) const

◆ imageUrl() [1/2]

auto resource_managers::SongAssetStore::imageUrl ( const QString &  virtualDirectory,
const QString &  relativePath 
) -> QString
static

◆ imageUrl() [2/2]

auto resource_managers::SongAssetStore::imageUrl ( const std::filesystem::path &  virtualPath) -> QString
static

◆ isArchived()

auto resource_managers::SongAssetStore::isArchived ( const std::filesystem::path &  virtualPath) const -> bool

◆ isArchivePath()

auto resource_managers::SongAssetStore::isArchivePath ( const std::filesystem::path &  path) -> bool
static

◆ isAudioUrl()

auto resource_managers::SongAssetStore::isAudioUrl ( const QString &  source) -> bool
static

◆ isSplitArchivePath()

auto resource_managers::SongAssetStore::isSplitArchivePath ( const std::filesystem::path &  path) -> bool
static

◆ isSupportedArchivePath()

auto resource_managers::SongAssetStore::isSupportedArchivePath ( const std::filesystem::path &  path) -> bool
static

◆ isVirtual()

auto resource_managers::SongAssetStore::isVirtual ( const std::filesystem::path &  virtualPath) const -> bool

◆ localFile()

QString resource_managers::SongAssetStore::localFile ( const QString &  virtualPath) const

◆ materialize()

auto resource_managers::SongAssetStore::materialize ( const std::filesystem::path &  virtualPath,
const std::atomic_bool *  stop = nullptr 
) const -> std::filesystem::path

◆ materializeRelative()

auto resource_managers::SongAssetStore::materializeRelative ( const std::filesystem::path &  virtualDirectory,
const std::vector< std::filesystem::path > &  relativePaths,
const std::atomic_bool *  stop = nullptr 
) const -> std::unordered_map<std::filesystem::path, std::filesystem::path>

◆ pathFromUrl()

auto resource_managers::SongAssetStore::pathFromUrl ( const QString &  source) -> std::filesystem::path
static

◆ read()

auto resource_managers::SongAssetStore::read ( const std::filesystem::path &  virtualPath,
const std::atomic_bool *  stop = nullptr 
) const -> QByteArray

◆ walkArchive()

void resource_managers::SongAssetStore::walkArchive ( const std::filesystem::path &  archivePath,
const WantsContents &  wantsContents,
const EntryVisitor &  visitor,
std::atomic_bool *  stop = nullptr 
) const

The documentation for this class was generated from the following files: