kodi
Public Member Functions | List of all members
NPT_HttpUrl Class Reference
Inheritance diagram for NPT_HttpUrl:
Inheritance graph
[legend]
Collaboration diagram for NPT_HttpUrl:
Collaboration graph
[legend]

Public Member Functions

 NPT_HttpUrl (const char *host, NPT_UInt16 port, const char *path, const char *query=NULL, const char *fragment=NULL)
 
 NPT_HttpUrl (const char *url, bool ignore_scheme=false)
 
NPT_String ToString (bool with_fragment=true) const override
 Return the string representation of the URL. More...
 
- Public Member Functions inherited from NPT_Url
 NPT_Url ()
 Default constructor. More...
 
 NPT_Url (const char *url, NPT_UInt16 default_port=0)
 Construct a URL by parsing an input string in its fully encoded form. More...
 
 NPT_Url (const char *scheme, const char *host, NPT_UInt16 port, const char *path, const char *query=NULL, const char *fragment=NULL)
 Construct a URL from its components. More...
 
NPT_Result Parse (const char *url, NPT_UInt16 default_port=0)
 Parse a URL from its fully encoded form. More...
 
NPT_Result ParsePathPlus (const char *path_plus)
 Parse just the path plus optional query and fragment from a fully encoded form. More...
 
const NPT_StringGetHost () const
 Returns the host part of the URL, in its encoded form.
 
NPT_UInt16 GetPort () const
 Returns the port number of the URL.
 
const NPT_StringGetPath () const
 Returns the path part of the URL, in its encoded form.
 
NPT_String GetPath (bool decoded) const
 Returns the path part of the URL, in its encoded or decoded form.
 
const NPT_StringGetQuery () const
 Returns the query part of the URL, in its encoded form.
 
const NPT_StringGetFragment () const
 Returns the fragment part of the URL, in its encoded form.
 
virtual bool IsValid () const
 Returns whether the URL is valid or not. More...
 
void Reset ()
 Resets a URL to an uninitialized state.
 
bool HasQuery () const
 Returns whether the URL has a query part or not. More...
 
bool HasFragment () const
 Returns whether the URL has a fragment part or not. More...
 
NPT_Result SetHost (const char *host)
 Sets the host part of the URL. More...
 
NPT_Result SetPort (NPT_UInt16 port)
 Sets the port number of the URL. More...
 
NPT_Result SetPath (const char *path, bool encoded=false)
 Sets the path part of the URL. More...
 
NPT_Result SetQuery (const char *query, bool encoded=false)
 Sets the query part of the URL. More...
 
NPT_Result SetFragment (const char *fragment, bool encoded=false)
 Sets the fragment part of the URL. More...
 
virtual NPT_String ToRequestString (bool with_fragment=false) const
 Return the string representation of the URL in a way that can be used in an HTTP request (i.e just the portion of the URL starting with the path) More...
 
virtual NPT_String ToStringWithDefaultPort (NPT_UInt16 default_port, bool with_fragment=true) const
 Return the string representation of the URL. More...
 
- Public Member Functions inherited from NPT_Uri
const NPT_StringGetScheme () const
 
void SetScheme (const char *scheme)
 
NPT_Result SetSchemeFromUri (const char *uri)
 
SchemeId GetSchemeId () const
 

Additional Inherited Members

- Public Types inherited from NPT_Uri
enum  SchemeId { SCHEME_ID_UNKNOWN, SCHEME_ID_HTTP, SCHEME_ID_HTTPS }
 
- Static Public Member Functions inherited from NPT_Uri
static NPT_String PercentEncode (const char *str, const char *chars, bool encode_percents=true)
 
static NPT_String PercentDecode (const char *str)
 
static SchemeId ParseScheme (const NPT_String &scheme)
 
- Static Public Attributes inherited from NPT_Uri
static const char *const PathCharsToEncode = NPT_URI_ALWAYS_ENCODE "?#[]"
 
static const char *const QueryCharsToEncode = NPT_URI_ALWAYS_ENCODE "#[]"
 
static const char *const FragmentCharsToEncode = NPT_URI_ALWAYS_ENCODE "[]"
 
static const char *const UnsafeCharsToEncode = NPT_URI_ALWAYS_ENCODE
 
- Protected Attributes inherited from NPT_Url
NPT_String m_Host
 
bool m_HostIsIpv6Address
 
NPT_UInt16 m_Port
 
NPT_String m_Path
 
bool m_HasQuery
 
NPT_String m_Query
 
bool m_HasFragment
 
NPT_String m_Fragment
 
- Protected Attributes inherited from NPT_Uri
NPT_String m_Scheme
 
SchemeId m_SchemeId
 

Member Function Documentation

◆ ToString()

NPT_String NPT_HttpUrl::ToString ( bool  with_fragment = true) const
overridevirtual

Return the string representation of the URL.

Parameters
with_fragmentBoolean flag specifiying whether the fragment part of the URL should be included in the returned string or not.

Reimplemented from NPT_Url.


The documentation for this class was generated from the following files: