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