Age | Commit message (Collapse) | Author |
|
|
|
Get rid of the weird old signature:
- int StringType::to_int(bool& ok) const
And replace it with sensible new signature:
- Optional<int> StringType::to_int() const
|
|
Otherwise we can end up with percent-encoded nonsense in base64 data
which does not decode correctly.
|
|
|
|
And move canonicalized_path() to a static method on LexicalPath.
This is to make it clear that FileSystemPath/canonicalized_path() only
perform *lexical* canonicalization.
|
|
Previously, passing a fragment string ("#section3") to the complete_url
method would result in a URL that looked like
"file:///home/anon/www/#section3" which was obviously incorrect. Now the
result looks like "file:///home/anon/www/afrag.html#section3".
|
|
|
|
|
|
|
|
|
|
We should still accept file:/// in the URL parser. :^)
|
|
|
|
|
|
|
|
|
|
This is an utility to create a URL from a given string, which may be either a
URL such as http://example.com (which will be used as-is), or a file path such
as /etc/fstab (which will be transformed into file:///etc/fstab).
|
|
Not just http or https. This fixes "foo" being recognized as a valid URL with
protocol "foo", empty host and empty path.
|
|
This is a convenience helper that allows you to easily construct a
file:// URL from an absolute path.
|
|
|
|
|
|
This allows you to build URLs by calling setters on an empty URL and
actually get a valid URL at the end.
|
|
|
|
As suggested by Joshua, this commit adds the 2-clause BSD license as a
comment block to the top of every source file.
For the first pass, I've just added myself for simplicity. I encourage
everyone to add themselves as copyright holders of any file they've
added or modified in some significant way. If I've added myself in
error somewhere, feel free to replace it with the appropriate copyright
holder instead.
Going forward, all new source files should include a license header.
|
|
|
|
Using int was a mistake. This patch changes String, StringImpl,
StringView and StringBuilder to use size_t instead of int for lengths.
Obviously a lot of code needs to change as a result of this.
|
|
It's missing query string parsing from new URLs, but you can set the
query string programmatically, and it will be part of the URL when
serialized through to_string().
|
|
Completing a relative URL based on a base URL seems like generally
useful functionality.
|
|
|
|
|
|
|
|
Also add some setters since this class was very setter-less.
|
|
We're gonna need these as we start to write more networking programs.
|