5 #include <libutl/String.h> 67 virtual void steal(
Object& rhs);
73 virtual size_t innerAllocatedSize()
const;
81 return (_scheme ==
nullptr);
91 return (_scheme ==
nullptr) ?
emptyString : *_scheme;
104 return (_username ==
nullptr) ?
emptyString : *_username;
111 return (_password ==
nullptr) ?
emptyString : *_password;
118 return (_hostname ==
nullptr) ?
emptyString : *_hostname;
139 String fullFilename()
const;
145 return (_filename ==
nullptr) ?
emptyString : *_filename;
152 return (_extension ==
nullptr) ?
emptyString : *_extension;
156 size_t numSegments()
const;
165 String segment(
size_t id)
const;
171 size_t queryVarsCount()
const;
179 void queryVarNameValue(
size_t id,
String& name,
String& value)
const;
191 return (_fragment ==
nullptr) ?
emptyString : *_fragment;
201 void set(
const String& uri);
214 _scheme = scheme.clone();
226 _username = username.clone();
228 _password = password.clone();
236 _hostname = hostname.clone();
247 void setFullPath(
const String& fp);
254 _path = path.clone();
258 void addQueryVariable(
const String& name,
const String& value);
265 _filename = filename.clone();
273 _extension = extension.clone();
304 setFullPath(fullPath() + rhs);
311 setFullPath(fullPath() + rhs);
319 static String percentEncode(
const String& str,
bool isPath =
false);
328 static void utl_init();
331 static void utl_deInit();
void setHostname(const String &hostname)
Set the hostname.
String toString(const FwdIt &begin, const FwdIt &end, const String &sep, bool key=false)
Obtain a string representation of a sequence (via Object::toString()).
uint_t port() const
Get the port.
void setPath(const String &path)
Set the path.
void deInit()
De-initialize UTL++.
const String & extension() const
Get the extension.
URI & operator+=(const String &rhs)
Append the given string to the full path.
URI operator+(const char *rhs) const
Get a copy of self with the given string appended to the full path.
void setExtension(const String &extension)
Set the extension.
#define UTL_CLASS_DECL(DC, BC)
Declaration of standard UTL++ functionality for a non-template class.
void setFilename(const String &filename)
Set the filename.
SortedCollection that stores objects in an array.
const String emptyString
An empty string.
void copy(T *dest, const T *src, size_t len)
Copy one array of objects to another.
URI(const String &uri)
Constructor.
const String & scheme() const
Get the scheme.
Generic URI (Universal Resource Identifier).
const String & username() const
Get the username.
bool isRelative() const
Relative URI?
const String & filename() const
Get the filename.
const String & path() const
Get the path.
void setUserinfo(const String &username, const String &password)
Set the "userinfo" (username & password).
const String & fragment() const
Get the fragment identifier.
unsigned int uint_t
Unsigned integer.
URI operator+(const String &rhs) const
Get a copy of self with the given string appended to the full path.
void setScheme(const String &scheme)
Set the scheme.
URI & operator+=(const char *rhs)
Append the given string to the full path.
const String & hostname() const
Get the hostname.
const String & password() const
Get the password.
Root of UTL++ class hierarchy.
int compare(bool lhs, bool rhs)
Compare two boolean values.
void setFullPath(const String &fp)
Set the full path (path + filename + extension).
void setPort(uint_t port)
Set the port.
void init()
Initialize UTL++.