namespace Cef3
{
using System;
using System.Collections.Generic;
using System.Text;
using Cef3.Interop;
///
/// URL component parts.
///
public sealed class CefUrlParts
{
///
/// The complete URL specification.
///
public string Spec { get; set; }
///
/// Scheme component not including the colon (e.g., "http").
///
public string Scheme { get; set; }
///
/// User name component.
///
public string UserName { get; set; }
///
/// Password component.
///
public string Password { get; set; }
///
/// Host component. This may be a hostname, an IPv4 address or an IPv6 literal
/// surrounded by square brackets (e.g., "[2001:db8::1]").
///
public string Host { get; set; }
///
/// Port number component.
///
public string Port { get; set; }
///
/// Origin contains just the scheme, host, and port from a URL. Equivalent to
/// clearing any username and password, replacing the path with a slash, and
/// clearing everything after that. This value will be empty for non-standard
/// URLs.
///
public string Origin { get; set; }
///
/// Path component including the first slash following the host.
///
public string Path { get; set; }
///
/// Query string component (i.e., everything following the '?').
///
public string Query { get; set; }
internal static unsafe CefUrlParts FromNative(cef_urlparts_t* n_parts)
{
var result = new CefUrlParts();
result.Spec = cef_string_t.ToString(&n_parts->spec);
result.Scheme = cef_string_t.ToString(&n_parts->scheme);
result.UserName = cef_string_t.ToString(&n_parts->username);
result.Password = cef_string_t.ToString(&n_parts->password);
result.Host = cef_string_t.ToString(&n_parts->host);
result.Port = cef_string_t.ToString(&n_parts->port);
result.Origin = cef_string_t.ToString(&n_parts->origin);
result.Path = cef_string_t.ToString(&n_parts->path);
result.Query = cef_string_t.ToString(&n_parts->query);
return result;
}
internal unsafe cef_urlparts_t ToNative()
{
var result = new cef_urlparts_t();
cef_string_t.Copy(Spec, &result.spec);
cef_string_t.Copy(Scheme, &result.scheme);
cef_string_t.Copy(UserName, &result.username);
cef_string_t.Copy(Password, &result.password);
cef_string_t.Copy(Host, &result.host);
cef_string_t.Copy(Port, &result.port);
cef_string_t.Copy(Origin, &result.origin);
cef_string_t.Copy(Path, &result.path);
cef_string_t.Copy(Query, &result.query);
return result;
}
}
}