Namespaces

Records

Functions

  • uint64_t GetThreadId ()

    Defined at line 15 of file ../../src/lib/android/libbase/override/threads.cc

  • std::string StringPrintf (const char * fmt)

    Returns a string corresponding to printf-like formatting of the arguments.

  • void StringAppendF (std::string * dst, const char * fmt)

    Appends a printf-like formatting of the arguments to 'dst'.

  • std::string GetProperty (const std::string & key, const std::string & default_value)

    Returns the current value of the system property `key`,

    or `default_value` if the property is empty or doesn't exist.

    Defined at line 10 of file ../../src/lib/android/libbase/override/properties.cc

  • void StringAppendV (std::string * dst, const char * format, va_list ap)

    Appends a printf-like formatting of the arguments to 'dst'.

  • bool GetBoolProperty (const std::string & key, bool default_value)

    Returns true if the system property `key` has the value "1", "y", "yes", "on", or "true",

    false for "0", "n", "no", "off", or "false", or `default_value` otherwise.

    Defined at line 14 of file ../../src/lib/android/libbase/override/properties.cc

  • std::vector<std::string> Split (const std::string & s, const std::string & delimiters)

    Splits a string into a vector of strings.

    The string is split at each occurrence of a character in delimiters.

    The empty string is not a valid delimiter list.

  • std::string SystemErrorCodeToString (int error_code)

    Returns a string describing the given system error code. |error_code| must

    be errno on Unix or GetLastError()/WSAGetLastError() on Windows. Passing

    errno on Windows has undefined behavior.

  • template <typename T>
    T GetIntProperty (const std::string & key, T default_value, T min, T max)

    Returns the signed integer corresponding to the system property `key`.

    If the property is empty, doesn't exist, doesn't have an integer value, or is outside

    the optional bounds, returns `default_value`.

  • template <typename T>
    T GetUintProperty (const std::string & key, T default_value, T max)

    Returns the unsigned integer corresponding to the system property `key`.

    If the property is empty, doesn't exist, doesn't have an integer value, or is outside

    the optional bound, returns `default_value`.

  • std::vector<std::string> Tokenize (const std::string & s, const std::string & delimiters)

    Splits a string into a vector of string tokens.

    The string is split at each occurrence of a character in delimiters.

    Coalesce runs of delimiter bytes and ignore delimiter bytes at the start or

    end of string. In other words, return only nonempty string tokens.

    Use when you don't care about recovering the original string with Join().

    Example:

    Tokenize(" foo bar ", " ") => {"foo", "bar"}

    Join(Tokenize(" foo bar", " "), " ") => "foo bar"

    The empty string is not a valid delimiter list.

  • bool SetProperty (const std::string & key, const std::string & value)

    Sets the system property `key` to `value`.

  • template <class E>
    unexpected<E> <deduction guide for unexpected> (E )
  • bool StartsWith (std::string_view s, std::string_view prefix)

    Tests whether 's' starts with 'prefix'.

  • bool StartsWith (std::string_view s, char prefix)
  • bool StartsWithIgnoreCase (std::string_view s, std::string_view prefix)
  • bool EndsWith (std::string_view s, std::string_view suffix)

    Tests whether 's' ends with 'suffix'.

  • bool EndsWith (std::string_view s, char suffix)
  • bool EndsWithIgnoreCase (std::string_view s, std::string_view suffix)
  • bool EqualsIgnoreCase (std::string_view lhs, std::string_view rhs)

    Tests whether 'lhs' equals 'rhs', ignoring case.

  • std::string StringReplace (std::string_view s, std::string_view from, std::string_view to, bool all)

    Replaces `from` with `to` in `s`, once if `all == false`, or as many times as

    there are matches if `all == true`.

  • std::string ErrnoNumberAsString (int errnum)

    Converts an errno number to its error message string.

  • template <typename... Args>
    Error<E, include_message, type-parameter-0-2> ErrorfImpl (fmt::format_string<Args...> fmt, const Args &... args)
  • template <typename... Args>
    Error<E, include_message, type-parameter-0-2> ErrnoErrorfImpl (fmt::format_string<Args...> fmt, const Args &... args)
  • template <typename T>
    bool ParseUint (const char * s, T * out, T max, bool allow_suffixes)

    Parses the unsigned decimal or hexadecimal integer in the string 's' and sets

    'out' to that value if it is specified. Optionally allows the caller to define

    a 'max' beyond which otherwise valid values will be rejected. Returns boolean

    success; 'out' is untouched if parsing fails.

    Defined at line 37 of file ../../third_party/android/platform/system/libbase/include/android-base/parseint.h

  • template <typename F>
    auto make_scope_guard (F && f)

    Defined at line 63 of file ../../third_party/android/platform/system/libbase/include/android-base/scopeguard.h

  • template <typename T>
    std::string Trim (T && t)

    Defined at line 63 of file ../../third_party/android/platform/system/libbase/include/android-base/strings.h

  • template <typename T>
    bool ParseUint (const std::string & s, T * out, T max, bool allow_suffixes)

    TODO: string_view

    Defined at line 82 of file ../../third_party/android/platform/system/libbase/include/android-base/parseint.h

  • template <typename T>
    bool ParseByteCount (const char * s, T * out, T max)

    Defined at line 89 of file ../../third_party/android/platform/system/libbase/include/android-base/parseint.h

  • template <typename T>
    bool ParseByteCount (const std::string & s, T * out, T max)

    TODO: string_view

    Defined at line 96 of file ../../third_party/android/platform/system/libbase/include/android-base/parseint.h

  • template <typename ContainerT, typename SeparatorT>
    std::string Join (ContainerT && things, SeparatorT separator)

    Joins a container of things into a single string, using the given separator.

    Defined at line 102 of file ../../third_party/android/platform/system/libbase/include/android-base/strings.h

  • ResultError<Errno> MakeResultErrorWithCode (std::string && message, Errno code)
  • template <typename T>
    bool ParseInt (const char * s, T * out, T min, T max)

    Parses the signed decimal or hexadecimal integer in the string 's' and sets

    'out' to that value if it is specified. Optionally allows the caller to define

    a 'min' and 'max' beyond which otherwise valid values will be rejected. Returns

    boolean success; 'out' is untouched if parsing fails.

    Defined at line 106 of file ../../third_party/android/platform/system/libbase/include/android-base/parseint.h

  • template <typename T>
    bool ParseInt (const std::string & s, T * out, T min, T max)

    TODO: string_view

    Defined at line 136 of file ../../third_party/android/platform/system/libbase/include/android-base/parseint.h

  • template <typename E>
    auto format_as (ResultError<E, true> error)

    Defined at line 163 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h

  • template <class T1, class E1, class T2, class E2>
    bool operator!= (const expected<T1, E1> & x, const expected<T2, E2> & y)
  • template <class T1, class E1, class E2>
    bool operator!= (const expected<T1, E1> & , const unexpected<E2> & )
  • template <class T1, class E1, class E2>
    bool operator!= (const unexpected<E2> & , const expected<T1, E1> & )
  • template <class E1, class E2>
    bool operator!= (const unexpected<E1> & e1, const unexpected<E2> & e2)
  • template <typename E>
    bool operator== (const ResultError<E> & lhs, const ResultError<E> & rhs)

    Defined at line 184 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h

  • template <typename E>
    bool operator!= (const ResultError<E> & lhs, const ResultError<E> & rhs)

    Defined at line 189 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h

  • bool ConsumePrefix (std::string_view * s, std::string_view prefix)

    Removes `prefix` from the start of the given string and returns true (if

    it was present), false otherwise.

    Defined at line 190 of file ../../third_party/android/platform/system/libbase/include/android-base/strings.h

  • template <typename E>
    std::ostream & operator<< (std::ostream & os, const ResultError<E> & t)

    Defined at line 194 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h

  • template <typename Closer>
    bool Pipe (unique_fd_impl<Closer> * read, unique_fd_impl<Closer> * write, int flags)

    See pipe(2).

    This helper hides the details of converting to unique_fd, and also hides the

    fact that macOS doesn't support O_CLOEXEC or O_NONBLOCK directly.

    Defined at line 194 of file ../../third_party/android/platform/system/libbase/include/android-base/unique_fd.h

  • bool ConsumeSuffix (std::string_view * s, std::string_view suffix)

    Removes `suffix` from the end of the given string and returns true (if

    it was present), false otherwise.

    Defined at line 198 of file ../../third_party/android/platform/system/libbase/include/android-base/strings.h

  • template <typename Closer>
    bool Socketpair (int domain, int type, int protocol, unique_fd_impl<Closer> * left, unique_fd_impl<Closer> * right)

    See socketpair(2).

    This helper hides the details of converting to unique_fd.

    Defined at line 234 of file ../../third_party/android/platform/system/libbase/include/android-base/unique_fd.h

  • template <typename Closer>
    bool Socketpair (int type, unique_fd_impl<Closer> * left, unique_fd_impl<Closer> * right)

    See socketpair(2).

    This helper hides the details of converting to unique_fd.

    Defined at line 248 of file ../../third_party/android/platform/system/libbase/include/android-base/unique_fd.h

  • FILE * Fdopen (unique_fd && ufd, const char * mode)

    See fdopen(3).

    Using fdopen with unique_fd correctly is more annoying than it should be,

    because fdopen doesn't close the file descriptor received upon failure.

    Defined at line 255 of file ../../third_party/android/platform/system/libbase/include/android-base/unique_fd.h

  • DIR * Fdopendir (unique_fd && ufd)

    See fdopendir(3).

    Using fdopendir with unique_fd correctly is more annoying than it should be,

    because fdopen doesn't close the file descriptor received upon failure.

    Defined at line 267 of file ../../third_party/android/platform/system/libbase/include/android-base/unique_fd.h

  • Error<Errno> ErrnoError ()

    Defined at line 283 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h

  • template <typename E>
    E ErrorCode (E code)

    Defined at line 288 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h

  • template <typename T, typename E, typename... Args>
    E ErrorCode (E code, T && t, const Args &... args)

    Return the error code of the last ResultError object, if any.

    Otherwise, return `code` as it is.

    Defined at line 295 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h

  • template <typename... Args>
    ResultError<Errno> ErrorfImpl (fmt::format_string<Args...> fmt, const Args &... args)

    Defined at line 306 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h

  • template <typename... Args>
    ResultError<Errno> ErrnoErrorfImpl (fmt::format_string<Args...> fmt, const Args &... args)

    Defined at line 312 of file ../../third_party/android/platform/system/libbase/include/android-base/result.h

  • template <class T1, class E1, class T2, class E2>
    bool operator!= (const expected<T1, E1> & x, const expected<T2, E2> & y)

    Defined at line 394 of file ../../third_party/android/platform/system/libbase/include/android-base/expected.h

  • template <class T1, class E1, class E2>
    bool operator!= (const expected<T1, E1> & x, const unexpected<E2> & y)

    Defined at line 408 of file ../../third_party/android/platform/system/libbase/include/android-base/expected.h

  • template <class E1, class E2>
    bool operator== (const expected<void, E1> & x, const expected<void, E2> & y)

    Defined at line 509 of file ../../third_party/android/platform/system/libbase/include/android-base/expected.h

  • template <class T1, class E1, class E2>
    bool operator== (const expected<T1, E1> & x, const expected<void, E2> & y)

    Defined at line 516 of file ../../third_party/android/platform/system/libbase/include/android-base/expected.h

  • template <class E1, class T2, class E2>
    bool operator== (const expected<void, E1> & x, const expected<T2, E2> & y)

    Defined at line 523 of file ../../third_party/android/platform/system/libbase/include/android-base/expected.h

  • template <class E1, class E2>
    bool operator== (const expected<void, E1> & x, const expected<void, E2> & y)

    expected equality operators

  • template <class E1, class E2>
    bool operator== (const unexpected<E1> & e1, const unexpected<E2> & e2)
  • template <class T1, class E1, class T2, class E2>
    bool operator== (const expected<T1, E1> & x, const expected<T2, E2> & y)

    Defined at line 387 of file ../../third_party/android/platform/system/libbase/include/android-base/expected.h

  • template <class T1, class E1, class E2>
    bool operator== (const expected<T1, E1> & x, const unexpected<E2> & y)

    Comparison with unexpected

    <E

    >

    Defined at line 400 of file ../../third_party/android/platform/system/libbase/include/android-base/expected.h

  • template <class T1, class E1, class E2>
    bool operator== (const unexpected<E2> & x, const expected<T1, E1> & y)

    Defined at line 404 of file ../../third_party/android/platform/system/libbase/include/android-base/expected.h

  • template <class T1, class E1, class E2>
    bool operator!= (const unexpected<E2> & x, const expected<T1, E1> & y)

    Defined at line 412 of file ../../third_party/android/platform/system/libbase/include/android-base/expected.h

  • template <class T, class E, typename = decltype(
                                    std::declval<expected<T, E>&>().swap(std::declval<expected<T, E>&>()))>
    void swap (expected<T, E> & x, expected<T, E> & y)

    Defined at line 531 of file ../../third_party/android/platform/system/libbase/include/android-base/expected.h

  • template <class E1, class E2>
    bool operator== (const unexpected<E1> & e1, const unexpected<E2> & e2)

    Defined at line 596 of file ../../third_party/android/platform/system/libbase/include/android-base/expected.h

  • template <class E1, class E2>
    bool operator!= (const unexpected<E1> & e1, const unexpected<E2> & e2)

    Defined at line 602 of file ../../third_party/android/platform/system/libbase/include/android-base/expected.h

  • template <class T1, class E1, class T2, class E2>
    bool operator== (const expected<T1, E1> & x, const expected<T2, E2> & y)

    expected equality operators

  • template <class T1, class E1, class E2>
    bool operator== (const expected<T1, E1> & , const unexpected<E2> & )

    Comparison with unexpected

    <E

    >

  • template <class T1, class E1, class E2>
    bool operator== (const unexpected<E2> & , const expected<T1, E1> & )
  • template <class E1>
    void swap (unexpected<E1> & xunexpected<E1> & y)

    Defined at line 608 of file ../../third_party/android/platform/system/libbase/include/android-base/expected.h

Variables

const unexpect_t unexpect

Defined at line 68 of file ../../third_party/android/platform/system/libbase/include/android-base/expected.h