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_;
24 Directive(std::string_view from, std::string_view to,
int status);
25 std::uint16_t rewrite(std::string&)
const;
26 std::string error()
const;
27 bool valid()
const {
return error().empty(); }
32 std::vector<Directive> directives_;
36 explicit File(std::string_view to_parse);
38 bool valid()
const {
return error().empty(); }
39 std::string
const& error()
const {
return error_; }
40 std::uint16_t rewrite(std::string& missing_path)
const;
43 bool parse_line(std::string_view,
int);
Definition: redirects.h:13
Directive(std::string_view from, std::string_view to, int status)
Definition: redirects.h:31