crawlserv++  [under development]
Application for crawling and analyzing textual content of websites.
crawlservpp::Helper::Container Namespace Reference

Namespace for global container helper function templates. More...

Functions

template<typename T >
static void append (T &to, const T &from, typename T::size_type startAt, typename T::size_type endAt)
 Appends (part of) an iterable container to another container. More...
 
template<typename T >
static void append (T &to, const T &from, typename T::size_type startAt)
 Appends (part of) an iterable container to another iterable container. More...
 
template<typename T >
static void append (T &to, const T &from)
 Appends an iterable container to another iterable container. More...
 
template<typename T >
static void moveInto (T &to, T &from)
 Moves the elements of an iterable container into another iterable container. More...
 
template<typename T >
static void moveInto (T &to, T &from, typename T::size_type at)
 Moves the elements of an iterable container into another iterable container. More...
 
template<typename T >
static void eraseFirst (T &container, typename T::size_type n)
 Erases the first elements of an iterable container. More...
 
template<typename T >
static T::size_type bytes (const T &container)
 Returns the number of bytes in an iterable container. More...
 

Detailed Description

Namespace for global container helper function templates.

Function Documentation

◆ append() [1/3]

template<typename T >
static void crawlservpp::Helper::Container::append ( T &  to,
const T &  from,
typename T::size_type  startAt,
typename T::size_type  endAt 
)
static

Appends (part of) an iterable container to another container.

Parameters
toThe container to append elements to.
fromThe container to append elements from.
startAtThe first element in from to append.
endAtThe last element in from to appemd.

Referenced by crawlservpp::Module::Analyzer::Database::checkSources(), crawlservpp::Main::Database::connect(), crawlservpp::Network::Downloader::getError(), crawlservpp::Module::Crawler::Thread::onReset(), and crawlservpp::Data::PickleDict::writeTo().

◆ append() [2/3]

template<typename T >
static void crawlservpp::Helper::Container::append ( T &  to,
const T &  from,
typename T::size_type  startAt 
)
static

Appends (part of) an iterable container to another iterable container.

Parameters
toThe container to append elements to.
fromThe container to append elements from.
startAtThe first element in from to append.

◆ append() [3/3]

template<typename T >
static void crawlservpp::Helper::Container::append ( T &  to,
const T &  from 
)
static

Appends an iterable container to another iterable container.

Parameters
toThe container to append elements to.
fromThe container to append elements from.

◆ bytes()

template<typename T >
static T::size_type crawlservpp::Helper::Container::bytes ( const T &  container)
static

Returns the number of bytes in an iterable container.

Note
The type of the elements in the container must provide a size() member function, returning the number of bytes in the element

Referenced by crawlservpp::Data::Corpus::clear(), crawlservpp::Network::Downloader::getError(), and crawlservpp::Helper::Utf8::length().

◆ eraseFirst()

template<typename T >
static void crawlservpp::Helper::Container::eraseFirst ( T &  container,
typename T::size_type  n 
)
static

Erases the first elements of an iterable container.

Parameters
containerThe container to erase elements from.
nThe number of elements to be erased from the beginning of the container.

Referenced by crawlservpp::Module::Analyzer::Database::checkSources().

◆ moveInto() [1/2]

template<typename T >
static void crawlservpp::Helper::Container::moveInto ( T &  to,
T &  from 
)
static

Moves the elements of an iterable container into another iterable container.

Appends the elements at the end of the target container.

Parameters
toThe container to move into.
fromThe container to move from.

Referenced by crawlservpp::Data::Corpus::clear(), crawlservpp::Query::Container::reserveForSubSets(), and crawlservpp::Data::PickleDict::writeTo().

◆ moveInto() [2/2]

template<typename T >
static void crawlservpp::Helper::Container::moveInto ( T &  to,
T &  from,
typename T::size_type  at 
)
static

Moves the elements of an iterable container into another iterable container.

Inserts the elements at the given position.

Parameters
toThe container to move into.
fromThe container to move from.
atThe position at which the new elements will be inserted into to.