Namespaces
Records
Functions
-
std::string CanonicalizeURL (const std::string & url)Canonicalizes a URL, if possible. Otherwise, returns an empty string/
Defined at line 17 of file ../../src/lib/pkg_url/url_resolver.cc
-
std::string GetSchemeFromURL (const std::string & url)Returns the scheme portion of the URL, if any.
Defined at line 23 of file ../../src/lib/pkg_url/url_resolver.cc
-
zx::result<fidl::ClientEnd<fuchsia_io::Directory>> OpenServiceRoot (std::string_view path)Opens the directory containing incoming services in the component's incoming
namespace.
`path` must be absolute, containing a leading "/". Defaults to "/svc".
# Errors
* `ZX_ERR_BAD_PATH`: `path` is too long.
* `ZX_ERR_NOT_FOUND`: `path` was not found in the incoming namespace.
Defined at line 10 of file ../../sdk/lib/component/incoming/cpp/protocol.cc
-
zx::result<fidl::ClientEnd<fuchsia_io::Directory>> OpenDirectory (std::string_view path, fuchsia_io::wire::Flags flags)Opens the directory specified by `path` with given `flags` in the component's incoming namespace.
`path` must be absolute, containing a leading "/". If `flags` is omitted, defaults to read-only.
# Errors
* `ZX_ERR_BAD_PATH`: `path` is too long.
* `ZX_ERR_NOT_FOUND`: `path` was not found in the incoming namespace.
* `ZX_ERR_INVALID_ARGS`: `flags` includes a non-directory protocol.
Defined at line 25 of file ../../sdk/lib/component/incoming/cpp/directory.h
-
std::string GetPathFromURL (const std::string & url)Resolves a URL into a path, if possible. Otherwise, returns an empty string.
Defined at line 33 of file ../../src/lib/pkg_url/url_resolver.cc
-
template <typename Protocol>zx::result<fidl::ClientEnd<Protocol>> Clone (fidl::UnownedClientEnd<Protocol> client)Typed channel wrapper around |fuchsia.unknown/Cloneable.Clone|.
Given an unowned client end |client|, returns an owned clone as a new connection using protocol
request pipelining.
|client| must be a channel that supports |fuchsia.unknown/Cloneable|, for example:
```
// |client| could be |fidl::ClientEnd| or |fidl::UnownedClientEnd|.
auto clone = component::Clone(client);
```
By default, this function will verify that the protocol type supports cloning
(i.e. satisfies the protocol requirement above).
Defined at line 33 of file ../../sdk/lib/component/incoming/cpp/clone.h
-
std::string GetURLFromPath (const std::string & path)Returns a file:// URL for the given path.
Defined at line 39 of file ../../src/lib/pkg_url/url_resolver.cc
-
zx::result<fidl::ClientEnd<fuchsia_io::Directory>> OpenDirectoryAt (fidl::UnownedClientEnd<fuchsia_io::Directory> dir, std::string_view path, fuchsia_io::wire::Flags flags)Opens the directory specified by `path` relative to `dir` with given `flags`. `path` must be
relative, and point to a valid entry under `dir`. If `flags` is omitted, defaults to read-only.
The operation completes asynchronously, which means a `zx::ok()` result does *not* ensure `path`
actually exists. Errors are communicated via an epitaph on the returned channel.
# Errors
* `ZX_ERR_INVALID_ARGS`: `path` is too long or `flags` includes a non-directory protocol.
Defined at line 39 of file ../../sdk/lib/component/incoming/cpp/directory.h
-
template <typename Protocol, typename = std::enable_if_t<fidl::IsProtocolV<Protocol>>>zx::result<> Connect (fidl::ServerEnd<Protocol> server_end, std::string_view path)Connects to the FIDL Protocol in the component's incoming namespace.
`server_end` is the channel used for the server connection.
`path` must be absolute, containing a leading "/". Default to "/svc/{name}"
where `{name}` is the fully qualified name of the FIDL Protocol.
The operation completes asynchronously, which means a zx::ok() result does
not ensure that the requested protocol actually exists.
# Errors
* `ZX_ERR_INVALID_ARGS`: `path` is too long.
* `ZX_ERR_NOT_FOUND`: A prefix of `path` cannot be found in the namespace.
Defined at line 46 of file ../../sdk/lib/component/incoming/cpp/protocol.h
-
template <typename Protocol>zx::result<fidl::ClientEnd<Protocol>> Clone (const fidl::ClientEnd<Protocol> & client)Overload of |component::Clone| to emulate implicit conversion from a
|const fidl::ClientEnd
&
| into |fidl::UnownedClientEnd|. C++ cannot consider
actual implicit conversions when performing template argument deduction.
Defined at line 50 of file ../../sdk/lib/component/incoming/cpp/clone.h
-
template <typename Service, typename = std::enable_if_t<fidl::IsServiceV<Service>>>zx::result<typename Service::ServiceClient> OpenService (std::string_view instance)Opens a connection to the given instance of the provided FIDL service. The
result, if successful, is a `Service::ServiceClient` that exposes methods
that connect to the various members of the FIDL service.
`instance ` must be an entry in incoming namespace's service directory.
Defaults to `default`.
# Errors
* `ZX_ERR_NOT_FOUND`: `instance` was not found in the incoming namespace.
* `ZX_ERR_INVALID_ARGS`: `instance` is more than 255 characters long.
# Example
```C++
using Echo = fuchsia_echo::Echo;
using EchoService = fuchsia_echo::EchoService;
zx::result
<EchoService
::ServiceClient> open_result =
component::OpenService
<EchoService
>();
ASSERT_TRUE(open_result.is_ok());
EchoService::ServiceClient service = open_result.take_value();
zx::result
<fidl
::ClientEnd
<Echo
>> connect_result = service.ConnectFoo();
ASSERT_TRUE(connect_result.is_ok());
fidl::WireSyncClient
<Echo
> client{connect_result.take_value()};
```
Defined at line 51 of file ../../sdk/lib/component/incoming/cpp/service.h
-
template <typename Protocol>fidl::ClientEnd<Protocol> MaybeClone (fidl::UnownedClientEnd<Protocol> client)Unchecked wrapper around |component::Clone|. Prefer using |component::Clone| over this function.
Unlike |component::Clone|, this function ignores transport errors on |client|, and returns an
invalid client end on failure.
Defined at line 59 of file ../../sdk/lib/component/incoming/cpp/clone.h
-
template <typename Protocol, typename = std::enable_if_t<fidl::IsProtocolV<Protocol>>>zx::result<fidl::ClientEnd<Protocol>> Connect (std::string_view path)Connects to the FIDL Protocol in the component's incoming namespace and
returns a client end.
`path` must be absolute, containing a leading "/". Default to "/svc/{name}"
where `{name}` is the fully qualified name of the FIDL Protocol.
The operation completes asynchronously, which means a zx::ok() result does
not ensure that the requested protocol actually exists.
# Errors
* `ZX_ERR_INVALID_ARGS`: `path` is too long.
* `ZX_ERR_NOT_FOUND`: A prefix of `path` cannot be found in the namespace.
Defined at line 66 of file ../../sdk/lib/component/incoming/cpp/protocol.h
-
template <typename Protocol>fidl::ClientEnd<Protocol> MaybeClone (const fidl::ClientEnd<Protocol> & client)Overload of |component::MaybeClone| to emulate implicit conversion from a
|const fidl::ClientEnd
&
| into |fidl::UnownedClientEnd|. C++ cannot consider
actual implicit conversions when performing template argument deduction.
Defined at line 71 of file ../../sdk/lib/component/incoming/cpp/clone.h
-
template <typename Service, typename = std::enable_if_t<fidl::IsServiceV<Service>>>zx::result<typename Service::ServiceClient> OpenServiceAt (fidl::UnownedClientEnd<fuchsia_io::Directory> dir, std::string_view instance)Opens a connection to the given instance of the provide FIDL service. The
result, if successful, is a `Service::ServiceClient` that exposes methods
that connect to the various members of the FIDL service.
`instance ` must be an entry in the directory `svc_dir`. Defaults to
`default`.
# Errors
* `ZX_ERR_NOT_FOUND`: `instance` was not found in the incoming namespace.
* `ZX_ERR_INVALID_ARGS`: `instance` is more than 255 characters long.
Defined at line 77 of file ../../sdk/lib/component/incoming/cpp/service.h
-
template <typename Protocol, typename = std::enable_if_t<fidl::IsProtocolV<Protocol>>>zx::result<> ConnectAt (fidl::UnownedClientEnd<fuchsia_io::Directory> svc_dir, fidl::ServerEnd<Protocol> server_end, std::string_view name)Connects to the FIDL Protocol in the directory `svc_dir`.
`server_end` is the channel used for the server connection.
`name` must be a valid entry in `svc_dir`.
The operation completes asynchronously, which means a zx::ok() result does
not ensure that the requested protocol actually exists.
# Errors
* `ZX_ERR_INVALID_ARGS`: `name` is too long.
Defined at line 89 of file ../../sdk/lib/component/incoming/cpp/protocol.h
-
template <typename ServiceMember, typename = std::enable_if_t<fidl::IsServiceMemberV<ServiceMember>>>std::string MakeServiceMemberPath (std::string_view instance)Gets the relative path to a service member.
This is in the format of:
`ServiceName/instance/Name`
This relative path can be appended to `/svc/` to construct a full path.
Defined at line 101 of file ../../sdk/lib/component/incoming/cpp/service.h
-
template <typename Protocol, typename = std::enable_if_t<fidl::IsProtocolV<Protocol>>>zx::result<fidl::ClientEnd<Protocol>> ConnectAt (fidl::UnownedClientEnd<fuchsia_io::Directory> svc_dir, std::string_view name)Connects to the FIDL Protocol in the directory `svc_dir`. Returns a client
end to the protocol connection.
`name` must be a valid entry in `svc_dir`.
The operation completes asynchronously, which means a zx::ok() result does
not ensure that the requested protocol actually exists.
# Errors
* `ZX_ERR_INVALID_ARGS`: `name` is too long.
Defined at line 108 of file ../../sdk/lib/component/incoming/cpp/protocol.h
-
template <typename ServiceMember, typename = std::enable_if_t<fidl::IsServiceMemberV<ServiceMember>>>zx::result<> ConnectAtMember (fidl::UnownedClientEnd<fuchsia_io::Directory> svc_dir, fidl::ServerEnd<typename ServiceMember::ProtocolType> server_end, std::string_view instance)Connects to the FIDL Protocol of the provided |ServiceMember| in the
directory `svc_dir`. Specifically, the FIDL Protocol used is one pointed to
|ServiceMember::ProtocolType|.
`server_end` is the channel used for the server connection.
`instance` is an instance name in the directory `svc_dir`.
# Errors
* `ZX_ERR_BAD_PATH`: `instance` is too long.
* `ZX_ERR_NOT_FOUND`: No entry was found using the provided `instance`.
Defined at line 123 of file ../../sdk/lib/component/incoming/cpp/service.h
-
template <typename ServiceMembertypename = std::enable_if_t<fidl::IsServiceMemberV<ServiceMember>>>zx::result<fidl::ClientEnd<typename ServiceMember::ProtocolType>> ConnectAtMember (fidl::UnownedClientEnd<fuchsia_io::Directory> svc_dirstd::string_view instance)Connects to the FIDL Protocol of the provided |ServiceMember| in the
directory `svc_dir`. Specifically, the FIDL Protocol used is one pointed to
|ServiceMember::ProtocolType|. Returns a client end to the protocol
connection.
`server_end` is the channel used for the server connection.
`instance` is an instance name in the directory `svc_dir`.
# Errors
* `ZX_ERR_BAD_PATH`: `instance` is too long.
* `ZX_ERR_NOT_FOUND`: No entry was found using the provided `instance`.
Defined at line 145 of file ../../sdk/lib/component/incoming/cpp/service.h
Variables
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
bool const IsStructuredConfigV
Defined at line 21 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h
const auto IsStructuredConfigV
Defined at line 22 of file ../../sdk/lib/component/outgoing/cpp/structured_config.h