5#include <vitrio/export.hpp>
37 std::numeric_limits<std::size_t>::max();
76 std::
size_t hash() const noexcept;
86 const std::
string&
get_key() const noexcept;
113 lhs.get_key() == rhs.get_key();
119 return !(lhs == rhs);
125 if (lhs.get_key() < rhs.get_key())
129 else if (lhs.get_key() == rhs.get_key())
131 return lhs.get_index_in_stack() < rhs.get_index_in_stack();
157 if (location.has_index_in_stack())
159 os << (location.get_index_in_stack() + 1) <<
'@';
161 return os << location.get_key();
166 std::size_t m_index_in_stack;
189bool parse_image_location(
const std::string &text, image_location &result);
202std::string to_string(
const image_location &location);
210struct hash<vitrio::image_location>
212 std::size_t operator()(
216 return location.hash();
Address of an image file, or of one image or volume of a stack.
Definition image_location.hpp:29
const std::string & get_key() const noexcept
Get the key of the file.
std::size_t get_index_in_stack() const noexcept
Get the index of the image or volume within the stack.
image_location() noexcept
Construct a location with an empty key and no index.
static constexpr std::size_t no_stack_index
Index addressing the file as a whole rather than one image or volume of it.
Definition image_location.hpp:36
image_location(std::string key, std::size_t index_in_stack=no_stack_index)
Construct a location from its components.
std::size_t hash() const noexcept
Get the hash value for this location.
bool has_index_in_stack() const noexcept
Check whether this addresses one image or volume of its file rather than the file as a whole.