crawlserv++  [under development]
Application for crawling and analyzing textual content of websites.
crawlservpp::Wrapper::URIQueryList Class Reference

RAII wrapper for the URI query list used by uriparser. More...

#include <URIQueryList.hpp>

Construction and Destruction

 URIQueryList ()=default
 Default constructor. More...
 
virtual ~URIQueryList ()
 Destructor clearing the underlying query list if necessary. More...
 

Getters

UriQueryListA * get () noexcept
 Gets a pointer to the underlying query list. More...
 
const UriQueryListA * getc () const noexcept
 Gets a const pointer to the underlying query list. More...
 
UriQueryListA ** getPtr () noexcept
 Gets a pointer to the pointer containing the address of the underlying query list. More...
 
bool valid () const noexcept
 Checks whether the underlying query list is valid. More...
 

Cleanup

void clear () noexcept
 Clears the underlying query list if necessary. More...
 

Copy and Move

The class is not copyable, only moveable.

 URIQueryList (URIQueryList &)=delete
 Deleted copy constructor. More...
 
URIQueryListoperator= (URIQueryList &)=delete
 Deleted copy assignment operator. More...
 
 URIQueryList (URIQueryList &&other) noexcept
 Move constructor. More...
 
URIQueryListoperator= (URIQueryList &&other) noexcept
 Move assignment operator. More...
 

Detailed Description

RAII wrapper for the URI query list used by uriparser.

Accepts an externally created URI query list and automatically frees it on destruction, avoiding memory leaks.

At the moment, this class is used exclusively by Parsing::URI::getSubUrl().

For more information about the uriparser API, see its GitHub repository.

Note
This class does not have ownership of the underlying pointer.

Constructor & Destructor Documentation

◆ URIQueryList() [1/3]

crawlservpp::Wrapper::URIQueryList::URIQueryList ( )
default

Default constructor.

◆ ~URIQueryList()

crawlservpp::Wrapper::URIQueryList::~URIQueryList ( )
inlinevirtual

Destructor clearing the underlying query list if necessary.

References clear().

◆ URIQueryList() [2/3]

crawlservpp::Wrapper::URIQueryList::URIQueryList ( URIQueryList )
delete

Deleted copy constructor.

◆ URIQueryList() [3/3]

crawlservpp::Wrapper::URIQueryList::URIQueryList ( URIQueryList &&  other)
inlinenoexcept

Move constructor.

Moves the query list from the specified location into this instance of the class.

Note
The other query list will be invalidated by this move.
Parameters
otherThe query list to move from.
See also
valid

Member Function Documentation

◆ clear()

void crawlservpp::Wrapper::URIQueryList::clear ( )
inlinenoexcept

Clears the underlying query list if necessary.

Referenced by operator=(), and ~URIQueryList().

◆ get()

UriQueryListA * crawlservpp::Wrapper::URIQueryList::get ( )
inlinenoexcept

Gets a pointer to the underlying query list.

Returns
A pointer to the underlying query list or nullptr if no query list has been assigned or the query list has already been freed.

◆ getc()

const UriQueryListA * crawlservpp::Wrapper::URIQueryList::getc ( ) const
inlinenoexcept

Gets a const pointer to the underlying query list.

Returns
A const pointer to the underlying query list or nullptr if no query list has been assigned or the query list has already been freed.

Referenced by crawlservpp::Parsing::URI::getSubUri().

◆ getPtr()

UriQueryListA ** crawlservpp::Wrapper::URIQueryList::getPtr ( )
inlinenoexcept

Gets a pointer to the pointer containing the address of the underlying query list.

Returns
A pointer to the pointer containing the address of the underlying query list or a pointer to a pointer containing nullptr if no query list has been assigned or the query list has already been freed.

Referenced by crawlservpp::Parsing::URI::getSubUri().

◆ operator=() [1/2]

URIQueryList& crawlservpp::Wrapper::URIQueryList::operator= ( URIQueryList )
delete

Deleted copy assignment operator.

◆ operator=() [2/2]

URIQueryList & crawlservpp::Wrapper::URIQueryList::operator= ( URIQueryList &&  other)
inlinenoexcept

Move assignment operator.

Moves the query list from the specified location into this instance of the class.

Note
The other query list will be invalidated by this move.
Nothing will be done if used on itself.
Parameters
otherThe query list to move from.
Returns
A reference to the instance containing the query list after moving (i.e. *this).
See also
valid

References clear().

◆ valid()

bool crawlservpp::Wrapper::URIQueryList::valid ( ) const
inlinenoexcept

Checks whether the underlying query list is valid.

Returns
true, if the query list is valid. False otherwise.

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