Skip to content

Commit

Permalink
encoded_path -> raw_path, etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
danielaparker committed Dec 6, 2024
1 parent 2fedb48 commit 4bfe6a7
Show file tree
Hide file tree
Showing 4 changed files with 327 additions and 137 deletions.
52 changes: 44 additions & 8 deletions doc/ref/corelib/uri.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ Constructs a `uri` by parsing the given string.
jsoncons::string_view path,
jsoncons::string_view query,
jsoncons::string_view fragment)
Constructs a `uri` from the given non-encoded parts.
Constructs a `uri` from the given unescaped parts.

uri(const uri& other, uri_fragment_part_t, jsoncons::string_view fragment);
Constructs a `uri` from `other`, replacing it's fragment part with (non-encoded) `fragment`.
Constructs a `uri` from `other`, replacing it's fragment part with (unescaped) `fragment`.

uri(const uri& other);
Copy constructor.
Expand All @@ -47,7 +47,7 @@ Returns the scheme part of this URI. The scheme is the first part of the URI, be
std::string userinfo() const;
Returns the decoded userinfo part of this URI.

jsoncons::string_view encoded_userinfo() const noexcept;
jsoncons::string_view raw_userinfo() const noexcept;
Returns the encoded userinfo part of this URI.

jsoncons::string_view host() const noexcept;
Expand All @@ -59,31 +59,67 @@ Returns the port number of this URI.
std::string authority() const;
Returns the decoded authority part of this URI.

jsoncons::string_view encoded_authority() const noexcept;
jsoncons::string_view raw_authority() const noexcept;
Returns the encoded authority part of this URI.

std::string path() const;
Returns the decoded path part of this URI.

jsoncons::string_view encoded_path() const noexcept;
jsoncons::string_view raw_path() const noexcept;
Returns the encoded path part of this URI.

std::string query() const;
Returns the decoded query part of this URI.

jsoncons::string_view encoded_query() const noexcept;
jsoncons::string_view raw_query() const noexcept;
Returns the encoded query part of this URI.

std::string fragment() const;
Returns the decoded fragment part of this URI.

jsoncons::string_view encoded_fragment() const noexcept;
jsoncons::string_view raw_fragment() const noexcept;
Returns the encoded fragment part of this URI.

bool is_absolute() const noexcept;
Returns true if this URI is absolute, false if it is relative.
An absolute URI has a scheme part.

bool is_opaque() const noexcept;
Returns true if this URI is opaque, otherwise false.
An opaque URI is an absolute URI whose scheme-specific part does not begin with a slash character ('/').

uri base() const noexcept;
Returns the base uri. The base uri includes the scheme, userinfo, host, port, and path parts,
but not the query or fragment.

bool has_scheme() const noexcept;
Returns true if this URI has a scheme part, otherwise false.

bool has_userinfo() const noexcept;
Returns true if this URI has a userinfo part, otherwise false.

bool has_authority() const noexcept;
Returns true if this URI has an authority part, otherwise false.

bool has_host() const noexcept;
Returns true if this URI has a host part, otherwise false.

bool has_port() const noexcept;
Returns true if this URI has a port number, otherwise false.

bool has_path() const noexcept;
Returns true if this URI has a path part, otherwise false.

bool has_query() const noexcept;
Returns true if this URI has a query part, otherwise false.

bool has_fragment() const noexcept;
Returns true if this URI has a fragment part, otherwise false.

uri resolve(const uri& reference) const;
Resolve `reference` as a URI relative to this URI.

const std::string& string() const;
const std::string& string() const noexcept;
Returns a URI string.

static uri parse(const std::string& str, std::error_code& ec);
Expand Down
Loading

0 comments on commit 4bfe6a7

Please sign in to comment.