12 #ifndef DOCWIRE_FILE_EXTENSION_H
13 #define DOCWIRE_FILE_EXTENSION_H
39 std::transform(m_ext.begin(), m_ext.end(), m_ext.begin(), [](
char c) { return std::tolower(c); });
51 std::transform(m_ext.begin(), m_ext.end(), m_ext.begin(), [](
char c) { return std::tolower(c); });
63 std::transform(m_ext.begin(), m_ext.end(), m_ext.begin(), [](
char c) { return std::tolower(c); });
86 return m_ext == other.m_ext;
98 #ifdef __cpp_lib_three_way_comparison
99 return m_ext <=> other.m_ext;
101 if (m_ext < other.m_ext)
102 return std::strong_ordering::less;
103 else if (m_ext > other.m_ext)
104 return std::strong_ordering::greater;
106 return std::strong_ordering::equal;
A class representing a file extension.
file_extension(const std::string &ext)
Constructs a file_extension object from a string.
std::strong_ordering operator<=>(const file_extension &other) const
Compares two file extensions for equality, ignoring case.
bool operator==(const file_extension &other) const
Compares two file extensions for equality, ignoring case.
file_extension(const std::filesystem::path &p)
Constructs a file_extension object from a path.
std::string string() const
Returns the file extension as a string.
file_extension(const char *ext)
Constructs a file_extension object from a const literal.
The main namespace for the DocWire SDK.