25 template<
typename String>
26 requires(!std::same_as<Filename, std::remove_cvref_t<String>>)
28 : originalFilename(std::forward<String>(filename))
29 , resolvedFilename(originalFilename) {}
31 template<
typename String>
33 : originalFilename(
std::forward<String>(filename))
34 , resolvedFilename(FileOperations::getAbsolutePath(
35 context.resolve(originalFilename))) {}
37 [[nodiscard]]
const std::string&
getOriginal()
const {
return originalFilename; }
38 [[nodiscard]]
const std::string&
getResolved() const & {
return resolvedFilename; }
39 [[nodiscard]] std::string
getResolved() && {
return std::move(resolvedFilename); }
52 [[nodiscard]]
bool empty()
const;
59 resolvedFilename = std::move(resolved);
64 return resolvedFilename == other.resolvedFilename;
67 template<
typename Archive>
68 void serialize(Archive& ar,
unsigned version);
73 std::string originalFilename;
74 std::string resolvedFilename;
This class represents a filename.
void setResolved(std::string resolved)
Change the resolved part of this filename E.g.
const std::string & getOriginal() const
bool empty() const
Convenience method to test for empty filename.
Filename(String &&filename, const FileContext &context)
void serialize(Archive &ar, unsigned version)
const std::string & getResolved() const &
bool operator==(const Filename &other) const
Filename(String &&filename)
void updateAfterLoadState()
After a loadstate we prefer to use the exact same file as before savestate.
std::string getResolved() &&
This file implemented 3 utility functions: