openMSX
DiskName.cc
Go to the documentation of this file.
1 #include "DiskName.hh"
2 #include "serialize.hh"
3 
4 namespace openmsx {
5 
7  : name(std::move(name_))
8 {
9 }
10 
11 DiskName::DiskName(Filename name_, std::string extra_)
12  : name(std::move(name_))
13  , extra(std::move(extra_))
14 {
15 }
16 
17 std::string DiskName::getOriginal() const
18 {
19  return name.getOriginal() + extra;
20 }
21 
22 std::string DiskName::getResolved() const
23 {
24  return name.getResolved() + extra;
25 }
26 
28 {
29  name.updateAfterLoadState();
30 }
31 
32 bool DiskName::empty() const
33 {
34  return name.empty() && extra.empty();
35 }
36 
37 template<typename Archive>
38 void 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:18
bool empty() const
Convenience method to test for empty filename.
Definition: Filename.cc:21
const std::string & getResolved() const &
Definition: Filename.hh:47
const std::string & getOriginal() const
Definition: Filename.hh:46
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:9
#define INSTANTIATE_SERIALIZE_METHODS(CLASS)
Definition: serialize.hh:998