// Copyright (c) 2022, NVIDIA CORPORATION. All rights reserved.
//
// NVIDIA CORPORATION and its licensors retain all intellectual property
// and proprietary rights in and to this software, related documentation
// and any modifications thereto. Any use, reproduction, disclosure or
// distribution of this software and related documentation without an express
// license agreement from NVIDIA CORPORATION is strictly prohibited.
//
// --------- Warning: This is a build system generated file. ----------
//

//! @file
//!
//! @brief This file was generated by <i>omni.bind</i>.

#include <omni/core/OmniAttr.h>
#include <omni/core/Interface.h>
#include <omni/core/ResultError.h>

#include <functional>
#include <utility>
#include <type_traits>

#ifndef OMNI_BIND_INCLUDE_INTERFACE_IMPL


template <>
class omni::core::Generated<omni::experimental::IUrl_abi> : public omni::experimental::IUrl_abi
{
public:
    OMNI_PLUGIN_INTERFACE("omni::experimental::IUrl")

    /**
     * Clears this URL
     */
    void clear() noexcept;

    /**
     * Return the string representation of this URL
     */
    omni::string to_string() noexcept;

    /**
     * Return the string representation of this URL, but with valid UTF-8 characters
     * decoded. This will leave invalid UTF-8 byte sequences and certain ASCII characters
     * encoded; including control codes, and characters that are reserved by the URL
     * specification as sub-delimiters.
     */
    omni::string to_string_utf8() noexcept;

    /**
     * Sets this URL from a string
     */
    void from_string(const omni::string& url_string) noexcept;

    /**
     * Sets this URL from a posix file path
     * The scheme will be "file" and the path will be the normalized and encoded file path
     * Normalization includes removing redundant path segments such as "//", "/./" and
     * collapsing ".." segments if possible. For example, it will convert "a/b/../" to "a"
     */
    void from_filepath_posix(const omni::string& filepath) noexcept;

    /**
     * Sets this URL from a windows file path
     * The scheme will be "file" and the path will be the normalized and encoded file path
     * Path normalization includes everything from "from_filepath_posix_abi" plus:
     * - The drive letter is made uppercase
     * - Path separators are converted from \\ to /
     * - UNC paths such as "\\\\server\\share\path" or "\\\\?\\C:\\path" are handled correctly
     */
    void from_filepath_windows(const omni::string& filepath) noexcept;

    /**
     * Sets this URL from a file path based on the native OS.
     * This calls either from_filepath_posix_abi or from_filepath_windows_abi
     */
    void from_filepath_native(const omni::string& filepath) noexcept;

    /**
     * Returns true if the URL has a scheme component.
     * "scheme" is the part before the first colon, for example "http" or "omniverse".
     * A URL without a scheme component can only be a relative reference.
     *
     * @see get_scheme()
     * @see set_scheme()
     */
    bool has_scheme() noexcept;

    /**
     * Returns true if the URL has an authority component.
     * "authority" is the part between the // and /
     * For example "user@server:port"
     *
     * @see get_authority_encoded()
     * @see set_authority_encoded()
     * @see has_userinfo()
     * @see has_host()
     * @see has_port()
     */
    bool has_authority() noexcept;

    /**
     * Returns true if the URL has a userinfo sub-component.
     * "userinfo" is the part of the authority before @
     *
     * @see get_userinfo()
     * @see set_userinfo()
     * @see has_authority()
     */
    bool has_userinfo() noexcept;

    /**
     * Returns true if the URL has a host sub-component.
     * "host" is the part of the authority between @ and :
     *
     * @see get_host()
     * @see set_host()
     * @see has_authority()
     */
    bool has_host() noexcept;

    /**
     * Returns true if the URL has a port sub-component.
     * "port" is the part of the authority after :
     *
     * @see get_port()
     * @see set_port()
     * @see has_authority()
     */
    bool has_port() noexcept;

    /**
     * Returns true if the URL has a path component.
     * "path" is the part after _abi(and including) /
     * For example "/path/to/my/file.txt"
     *
     * @see get_path_encoded()
     * @see set_path_encoded()
     * @see set_path_decoded()
     */
    bool has_path() noexcept;

    /**
     * Returns true if the URL has a query component.
     * "query" is the part after ? but before #
     *
     * @see get_query_encoded()
     * @see set_query_encoded()
     * @see set_query_decoded()
     */
    bool has_query() noexcept;

    /**
     * Returns true if the URL has a fragment component.
     * "fragment" is the part after #
     *
     * @see get_fragment_encoded()
     * @see set_fragment_encoded()
     * @see set_fragment_decoded()
     */
    bool has_fragment() noexcept;

    /**
     * Returns the scheme.
     * The scheme will always be fully decoded and in lower case.
     *
     * @see has_scheme()
     * @see set_scheme()
     */
    omni::string get_scheme() noexcept;

    /**
     * Returns the authority, which may contain percent-encoded data
     * For example if the 'userinfo' contains : or @ it must be percent-encoded.
     *
     * @see set_authority_encoded()
     * @see get_userinfo()
     * @see get_host()
     * @see get_port()
     */
    omni::string get_authority_encoded() noexcept;

    /**
     * Returns the userinfo, fully decoded.
     *
     * @see get_authority_encoded()
     * @see set_userinfo()
     * @see has_userinfo()
     */
    omni::string get_userinfo() noexcept;

    /**
     * Returns the host, fully decoded.
     *
     * @see get_authority_encoded()
     * @see set_host()
     * @see has_host()
     */
    omni::string get_host() noexcept;

    /**
     * Returns the port number
     *
     * @see get_authority_encoded()
     * @see set_port()
     * @see has_port()
     */
    uint16_t get_port() noexcept;

    /**
     * Returns the percent-encoded path component.
     *
     * @see get_path_utf8()
     * @see set_path_encoded()
     * @see set_path_decoded()
     * @see has_path()
     */
    omni::string get_path_encoded() noexcept;

    /**
     * Returns the path component with all printable ascii and valid UTF-8 characters decoded
     * Invalid UTF-8 and ASCII control codes will still be percent-encoded.
     * It's generally safe to print the result of this function on screen and in log files.
     *
     * @see get_path_encoded()
     * @see set_path_encoded()
     * @see set_path_decoded()
     * @see has_path()
     */
    omni::string get_path_utf8() noexcept;

    /**
     * Returns the percent-encoded query component.
     *
     * @see get_query_encoded()
     * @see set_query_encoded()
     * @see set_query_decoded()
     * @see has_query()
     */
    omni::string get_query_encoded() noexcept;

    /**
     * Returns the percent-encoded fragment component.
     *
     * @see get_fragment_encoded()
     * @see set_fragment_encoded()
     * @see set_fragment_decoded()
     * @see has_fragment()
     */
    omni::string get_fragment_encoded() noexcept;

    /**
     * Sets the scheme.
     *
     * @see has_scheme()
     * @see get_scheme()
     */
    void set_scheme(const omni::string& scheme) noexcept;

    /**
     * Sets the authority, which is expected to have all the sub-components percent-encoded.
     * If characters that _MUST_ be encoded are detected, they will be percent-encoded, however the percent sign itself
     * will _NOT_ be encoded.
     *
     * @see get_authority_encoded()
     * @see set_userinfo()
     * @see set_host()
     * @see set_port()
     */
    void set_authority_encoded(const omni::string& authority) noexcept;

    /**
     * Sets the userinfo. This function expects the userinfo is not already percent-encoded.
     *
     * @see set_authority_encoded()
     * @see get_userinfo()
     * @see has_userinfo()
     */
    void set_userinfo(const omni::string& userinfo) noexcept;

    /**
     * Sets the host. This function expects the host is not already percent-encoded.
     *
     * @see set_authority_encoded()
     * @see get_host()
     * @see has_host()
     */
    void set_host(const omni::string& host) noexcept;

    /**
     * Sets the port number
     *
     * @see set_authority_encoded()
     * @see get_port()
     * @see has_port()
     */
    void set_port(uint16_t port) noexcept;

    /**
     * Sets the path, which is already percent-encoded.
     * If characters that _MUST_ be encoded are detected, they will be percent-encoded, however the percent sign itself
     * will _NOT_ be encoded.
     *
     * @see get_path_encoded()
     * @see set_path_decoded()
     * @see has_path()
     */
    void set_path_encoded(const omni::string& path_encoded) noexcept;

    /**
     * Sets the path, which is NOT already percent-encoded.
     * If characters that _MUST_ be encoded are detected, they will be percent-encoded, including the percent sign
     * itself
     *
     * @see get_path_encoded()
     * @see set_path_encoded()
     * @see has_path()
     */
    void set_path_decoded(const omni::string& path_decoded) noexcept;

    /**
     * Sets the query, which is already percent-encoded.
     * If characters that _MUST_ be encoded are detected, they will be percent-encoded, however the percent sign itself
     * will _NOT_ be encoded.
     *
     * @see get_query_encoded()
     * @see set_query_decoded()
     * @see has_query()
     */
    void set_query_encoded(const omni::string& query_encoded) noexcept;

    /**
     * Sets the query, which is NOT already percent-encoded.
     * If characters that _MUST_ be encoded are detected, they will be percent-encoded, including the percent sign
     * itself
     *
     * @see get_query_encoded()
     * @see set_query_encoded()
     * @see has_query()
     */
    void set_query_decoded(const omni::string& query_decoded) noexcept;

    /**
     * Sets the fragment, which is already percent-encoded.
     * If characters that _MUST_ be encoded are detected, they will be percent-encoded, however the percent sign itself
     * will _NOT_ be encoded.
     *
     * @see get_fragment_encoded()
     * @see set_fragment_decoded()
     * @see has_fragment()
     */
    void set_fragment_encoded(const omni::string& fragment_encoded) noexcept;

    /**
     * Sets the fragment, which is NOT already percent-encoded.
     * If characters that _MUST_ be encoded are detected, they will be percent-encoded, including the percent sign
     * itself
     *
     * @see get_fragment_encoded()
     * @see set_fragment_encoded()
     * @see has_fragment()
     */
    void set_fragment_decoded(const omni::string& fragment_decoded) noexcept;

    /**
     * Create a new IUrl object that represents the shortest possible URL that makes @p other_url relative to this URL.
     *
     * Relative URLs are described in section 5.2 "Relative Resolution" of RFC-3986
     *
     * @param other_url URL to make a relative URL to.
     *
     * @return A new IUrl object that is the relative URL between this URL and @p other_url.
     */
    omni::core::ObjectPtr<omni::experimental::IUrl> make_relative(
        omni::core::ObjectParam<omni::experimental::IUrl> other_url) noexcept;

    /**
     * Creates a new IUrl object that is the result of resolving the provided @p relative_url with this URL as the base
     * URL.
     *
     * The algorithm for doing the combination is described in section 5.2 "Relative Resolution" of RFC-3986.
     *
     * @param relative_url URL to resolve with this URL as the base URL.
     *
     * @return A new IUrl object that is the result of resolving @p relative_url with this URL.
     */
    omni::core::ObjectPtr<omni::experimental::IUrl> resolve_relative(
        omni::core::ObjectParam<omni::experimental::IUrl> relative_url) noexcept;
};

#endif

#ifndef OMNI_BIND_INCLUDE_INTERFACE_DECL

inline void omni::core::Generated<omni::experimental::IUrl_abi>::clear() noexcept
{
    clear_abi();
}

inline omni::string omni::core::Generated<omni::experimental::IUrl_abi>::to_string() noexcept
{
    return to_string_abi();
}

inline omni::string omni::core::Generated<omni::experimental::IUrl_abi>::to_string_utf8() noexcept
{
    return to_string_utf8_abi();
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::from_string(const omni::string& url_string) noexcept
{
    from_string_abi(url_string);
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::from_filepath_posix(const omni::string& filepath) noexcept
{
    from_filepath_posix_abi(filepath);
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::from_filepath_windows(const omni::string& filepath) noexcept
{
    from_filepath_windows_abi(filepath);
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::from_filepath_native(const omni::string& filepath) noexcept
{
    from_filepath_native_abi(filepath);
}

inline bool omni::core::Generated<omni::experimental::IUrl_abi>::has_scheme() noexcept
{
    return has_scheme_abi();
}

inline bool omni::core::Generated<omni::experimental::IUrl_abi>::has_authority() noexcept
{
    return has_authority_abi();
}

inline bool omni::core::Generated<omni::experimental::IUrl_abi>::has_userinfo() noexcept
{
    return has_userinfo_abi();
}

inline bool omni::core::Generated<omni::experimental::IUrl_abi>::has_host() noexcept
{
    return has_host_abi();
}

inline bool omni::core::Generated<omni::experimental::IUrl_abi>::has_port() noexcept
{
    return has_port_abi();
}

inline bool omni::core::Generated<omni::experimental::IUrl_abi>::has_path() noexcept
{
    return has_path_abi();
}

inline bool omni::core::Generated<omni::experimental::IUrl_abi>::has_query() noexcept
{
    return has_query_abi();
}

inline bool omni::core::Generated<omni::experimental::IUrl_abi>::has_fragment() noexcept
{
    return has_fragment_abi();
}

inline omni::string omni::core::Generated<omni::experimental::IUrl_abi>::get_scheme() noexcept
{
    return get_scheme_abi();
}

inline omni::string omni::core::Generated<omni::experimental::IUrl_abi>::get_authority_encoded() noexcept
{
    return get_authority_encoded_abi();
}

inline omni::string omni::core::Generated<omni::experimental::IUrl_abi>::get_userinfo() noexcept
{
    return get_userinfo_abi();
}

inline omni::string omni::core::Generated<omni::experimental::IUrl_abi>::get_host() noexcept
{
    return get_host_abi();
}

inline uint16_t omni::core::Generated<omni::experimental::IUrl_abi>::get_port() noexcept
{
    return get_port_abi();
}

inline omni::string omni::core::Generated<omni::experimental::IUrl_abi>::get_path_encoded() noexcept
{
    return get_path_encoded_abi();
}

inline omni::string omni::core::Generated<omni::experimental::IUrl_abi>::get_path_utf8() noexcept
{
    return get_path_utf8_abi();
}

inline omni::string omni::core::Generated<omni::experimental::IUrl_abi>::get_query_encoded() noexcept
{
    return get_query_encoded_abi();
}

inline omni::string omni::core::Generated<omni::experimental::IUrl_abi>::get_fragment_encoded() noexcept
{
    return get_fragment_encoded_abi();
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::set_scheme(const omni::string& scheme) noexcept
{
    set_scheme_abi(scheme);
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::set_authority_encoded(const omni::string& authority) noexcept
{
    set_authority_encoded_abi(authority);
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::set_userinfo(const omni::string& userinfo) noexcept
{
    set_userinfo_abi(userinfo);
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::set_host(const omni::string& host) noexcept
{
    set_host_abi(host);
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::set_port(uint16_t port) noexcept
{
    set_port_abi(port);
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::set_path_encoded(const omni::string& path_encoded) noexcept
{
    set_path_encoded_abi(path_encoded);
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::set_path_decoded(const omni::string& path_decoded) noexcept
{
    set_path_decoded_abi(path_decoded);
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::set_query_encoded(const omni::string& query_encoded) noexcept
{
    set_query_encoded_abi(query_encoded);
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::set_query_decoded(const omni::string& query_decoded) noexcept
{
    set_query_decoded_abi(query_decoded);
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::set_fragment_encoded(
    const omni::string& fragment_encoded) noexcept
{
    set_fragment_encoded_abi(fragment_encoded);
}

inline void omni::core::Generated<omni::experimental::IUrl_abi>::set_fragment_decoded(
    const omni::string& fragment_decoded) noexcept
{
    set_fragment_decoded_abi(fragment_decoded);
}

inline omni::core::ObjectPtr<omni::experimental::IUrl> omni::core::Generated<omni::experimental::IUrl_abi>::make_relative(
    omni::core::ObjectParam<omni::experimental::IUrl> other_url) noexcept
{
    return omni::core::steal(make_relative_abi(other_url.get()));
}

inline omni::core::ObjectPtr<omni::experimental::IUrl> omni::core::Generated<omni::experimental::IUrl_abi>::resolve_relative(
    omni::core::ObjectParam<omni::experimental::IUrl> relative_url) noexcept
{
    return omni::core::steal(resolve_relative_abi(relative_url.get()));
}

#endif

#undef OMNI_BIND_INCLUDE_INTERFACE_DECL
#undef OMNI_BIND_INCLUDE_INTERFACE_IMPL
