Records

Functions

  • zx::result<> WatchDirectoryForItems (const fidl::ClientEnd<fuchsia_io::Directory> & dir, ItemCallback callback)

    Call the callback for each item in the directory, and wait for new items.

    This function will not call the callback for the '.' file in a directory.

    If the callback returns a status other than `ZX_OK`, watching stops.

    If the callback returns std::nullopt the watching will continue, otherwise the

    watching will stop and zx::ok() will be returned to the caller.

    Defined at line 53 of file ../../sdk/lib/device-watcher/cpp/device-watcher.h

  • template <typename T>
    zx::result<T> WatchDirectoryForItems (fidl::UnownedClientEnd<fuchsia_io::Directory> dir, fit::function<std::optional<T> (std::string_view)> callback)

    A templated version of this function.

    If the callback returns std::nullopt the watching will continue, otherwise the

    watching will stop and the return value will be returned to the caller.

    Defined at line 63 of file ../../sdk/lib/device-watcher/cpp/device-watcher.h

  • template <typename T>
    zx::result<T> WatchDirectoryForItems (const fidl::ClientEnd<fuchsia_io::Directory> & dir, fit::function<std::optional<T> (std::string_view)> callback)

    A templated version of this function.

    If the callback returns std::nullopt the watching will continue, otherwise the

    watching will stop and the return value will be returned to the caller.

    Defined at line 90 of file ../../sdk/lib/device-watcher/cpp/device-watcher.h

  • zx::result<zx::channel> RecursiveWaitForFile (int dir_fd, const char * path, zx::duration timeout)

    Waits for the relative |path| starting in the directory represented by |dir_fd| to appear,

    and opens it.

    This method does not take ownership of |dir_fd|.

    TODO(https://fxbug.dev/42068369): Remove `timeout`.

    Defined at line 201 of file ../../sdk/lib/device-watcher/cpp/device-watcher.cc

  • zx::result<zx::channel> RecursiveWaitForFile (const char * path, zx::duration timeout)

    Waits for the absolute |path| to appear, and opens it.

    NOTE: This only works for absolute paths,

    otherwise it will return ZX_ERR_NOT_SUPPORTED.

    TODO(https://fxbug.dev/42068369): Remove `timeout`.

    Defined at line 208 of file ../../sdk/lib/device-watcher/cpp/device-watcher.cc

  • zx::result<> WatchDirectoryForItems (fidl::UnownedClientEnd<fuchsia_io::Directory> dirItemCallback callback)

    Call the callback for each item in the directory, and wait for new items.

    This function will not call the callback for the '.' file in a directory.

    If the callback returns a status other than `ZX_OK`, watching stops.

    If the callback returns std::nullopt the watching will continue, otherwise the

    watching will stop and zx::ok() will be returned to the caller.

    Defined at line 241 of file ../../sdk/lib/device-watcher/cpp/device-watcher.cc