openMSX
DiskName.cc
Go to the documentation of this file.
1#include "DiskName.hh"
2#include "serialize.hh"
3
4namespace openmsx {
5
7 : name(std::move(name_))
8{
9}
10
11DiskName::DiskName(Filename name_, std::string extra_)
12 : name(std::move(name_))
13 , extra(std::move(extra_))
14{
15}
16
17std::string DiskName::getOriginal() const
18{
19 return name.getOriginal() + extra;
20}
21
22std::string DiskName::getResolved() const
23{
24 return name.getResolved() + extra;
25}
26
31
32bool DiskName::empty() const
33{
34 return name.empty() && extra.empty();
35}
36
37template<typename Archive>
38void DiskName::serialize(Archive& ar, unsigned /*version*/)
39{
40 ar.serialize("filename", name,
41 "extra", extra);
42}
44
45} // namespace openmsx
std::string getResolved() const
Definition DiskName.cc:22
void serialize(Archive &ar, unsigned version)
Definition DiskName.cc:38
DiskName(Filename name)
Definition DiskName.cc:6
void updateAfterLoadState()
Definition DiskName.cc:27
bool empty() const
Definition DiskName.cc:32
std::string getOriginal() const
Definition DiskName.cc:17
This class represents a filename.
Definition Filename.hh:20
const std::string & getOriginal() const
Definition Filename.hh:37
bool empty() const
Convenience method to test for empty filename.
Definition Filename.cc:21
const std::string & getResolved() const &
Definition Filename.hh:38
void updateAfterLoadState()
After a loadstate we prefer to use the exact same file as before savestate.
Definition Filename.cc:8
This file implemented 3 utility functions:
Definition Autofire.cc:11
STL namespace.
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)