toRaw
Returned value may point into buffer or be the original string.
Function parameters
Parameters
Type definitions in this namespace
Types
Returned value may point into `buffer` or be the original string.
Functions
- getHost
- Returned value may point into `buffer` or be the original string.
- getHostAlloc
- Returned value may point into `buffer` or be the original string.
- percentDecodeBackwards
- Percent decodes all %XX where XX is a valid hex number.
- percentDecodeInPlace
- Percent decodes all %XX where XX is a valid hex number.
- parseAfterScheme
- Parses the URI or returns an error.
- parse
- The return value will contain strings pointing into the original `text`.
- resolveInPlace
- Resolves a URI against a base URI, conforming to
Error sets in this namespace
Error Sets
= 255
Values
- host_name_max
- = 255
Source
Implementation
pub fn toRaw(component: Component, buffer: []u8) error{NoSpaceLeft}![]const u8 {
return switch (component) {
.raw => |raw| raw,
.percent_encoded => |percent_encoded| if (std.mem.indexOfScalar(u8, percent_encoded, '%')) |_|
try std.fmt.bufPrint(buffer, "{f}", .{std.fmt.alt(component, .formatRaw)})
else
percent_encoded,
};
}