openMSX
|
This class represents a filename. More...
#include <Filename.hh>
Public Member Functions | |
Filename ()=default | |
Filename (Filename &&)=default | |
Filename & | operator= (Filename &&)=default |
Filename & | operator= (const Filename &)=default |
Filename (const Filename &f) | |
Filename (Filename &f) | |
template<typename String > | |
Filename (String &&filename) | |
template<typename String > | |
Filename (String &&filename, const FileContext &context) | |
const std::string & | getOriginal () const |
const std::string & | getResolved () const & |
std::string | getResolved () && |
void | updateAfterLoadState () |
After a loadstate we prefer to use the exact same file as before savestate. More... | |
bool | empty () const |
Convenience method to test for empty filename. More... | |
void | setResolved (std::string resolved) |
Change the resolved part of this filename E.g. More... | |
bool | operator== (const Filename &other) const |
template<typename Archive > | |
void | serialize (Archive &ar, unsigned version) |
This class represents a filename.
A filename is resolved in a certain context. It is possible to query both the resolved and unresolved filename.
Most file operations will want the resolved name, but for example for savestates we (also) want the unresolved name.
Definition at line 17 of file Filename.hh.
|
default |
|
default |
|
inline |
Definition at line 28 of file Filename.hh.
|
inline |
Definition at line 33 of file Filename.hh.
|
inlineexplicit |
Definition at line 36 of file Filename.hh.
|
inline |
Definition at line 41 of file Filename.hh.
bool openmsx::Filename::empty | ( | ) | const |
Convenience method to test for empty filename.
In any case getOriginal().empty() and getResolved().empty() return the same result. This method is a shortcut to either of these.
Definition at line 21 of file Filename.cc.
References empty(), getOriginal(), and getResolved().
Referenced by openmsx::DiskName::empty(), empty(), openmsx::SoundDevice::recordChannel(), openmsx::HD::serialize(), openmsx::LaserdiscPlayer::serialize(), and updateAfterLoadState().
|
inline |
Definition at line 46 of file Filename.hh.
Referenced by empty(), openmsx::DiskName::getOriginal(), and openmsx::DiskChanger::serialize().
|
inline |
Definition at line 48 of file Filename.hh.
|
inline |
Definition at line 47 of file Filename.hh.
Referenced by empty(), openmsx::HDCommand::execute(), openmsx::WavImageCache::get(), openmsx::DiskName::getResolved(), openmsx::HD::HD(), openmsx::CassettePlayer::serialize(), openmsx::HD::serialize(), openmsx::LaserdiscPlayer::serialize(), and openmsx::HD::switchImage().
|
inline |
Definition at line 72 of file Filename.hh.
void openmsx::Filename::serialize | ( | Archive & | ar, |
unsigned | version | ||
) |
Definition at line 28 of file Filename.cc.
Referenced by openmsx::DiskChanger::serialize().
|
inline |
Change the resolved part of this filename E.g.
on loadstate when we didn't find the original file, but another file with a matching checksum.
Definition at line 67 of file Filename.hh.
Referenced by openmsx::CassettePlayer::serialize().
void openmsx::Filename::updateAfterLoadState | ( | ) |
After a loadstate we prefer to use the exact same file as before savestate.
But if that file is not available (possibly because snapshot is loaded on a different host machine), we fallback to the original filename.
Definition at line 8 of file Filename.cc.
References empty(), openmsx::FileOperations::exists(), openmsx::FileOperations::getAbsolutePath(), and openmsx::userFileContext().
Referenced by openmsx::CassettePlayer::serialize(), openmsx::HD::serialize(), and openmsx::DiskName::updateAfterLoadState().