| 12345678910111213141516171819202122232425262728293031 |
- #pragma once
- #include <string>
- #include <string_view>
- #include <jvalidate/detail/compare.h>
- namespace jvalidate::detail {
- class URI {
- private:
- std::string content_;
- public:
- URI() = default;
- explicit URI(std::string_view content) : content_(content) {
- if (content_.back() == '#') {
- content_.pop_back();
- }
- }
- explicit operator std::string const &() const { return content_; }
- bool empty() const { return content_.empty(); }
- friend std::ostream & operator<<(std::ostream & os, URI const & self) {
- return os << self.content_;
- }
- auto operator<=>(URI const & lhs) const = default;
- };
- }
|