1 #ifndef IPFS_REDIRECTS_H_
2 #define IPFS_REDIRECTS_H_
10 namespace ipfs ::redirects {
14 enum class ComponentType { LITERAL, PLACEHOLDER, SPLAT };
15 std::vector<std::pair<ComponentType, std::string>> components_;
20 Directive(std::string_view, std::string_view,
int);
21 std::uint16_t rewrite(std::string&)
const;
22 std::string error()
const;
23 bool valid()
const {
return error().empty(); }
28 std::vector<Directive> directives_;
32 explicit File(std::string_view to_parse);
34 bool valid()
const {
return error().empty(); }
35 std::string
const& error()
const {
return error_; }
36 std::uint16_t rewrite(std::string& missing_path)
const;
39 bool parse_line(std::string_view,
int);
Definition: redirects.h:13
Definition: redirects.h:27