Ark Server API (ASE) - Wiki
Loading...
Searching...
No Matches
Poco::Net::NameValueCollection Class Reference

#include <NameValueCollection.h>

+ Inheritance diagram for Poco::Net::NameValueCollection:
+ Collaboration diagram for Poco::Net::NameValueCollection:

Public Types

using HeaderMap = Poco::ListMap<std::string, std::string>
 
using Iterator = HeaderMap::Iterator
 
using ConstIterator = HeaderMap::ConstIterator
 

Public Member Functions

 NameValueCollection ()
 
 NameValueCollection (const NameValueCollection &nvc)
 Creates an empty NameValueCollection.
 
 NameValueCollection (NameValueCollection &&nvc) noexcept
 Creates a NameValueCollection by copying another one.
 
virtual ~NameValueCollection ()
 Creates a NameValueCollection by moving another one.
 
NameValueCollectionoperator= (const NameValueCollection &nvc)
 Destroys the NameValueCollection.
 
NameValueCollectionoperator= (NameValueCollection &&nvc) noexcept
 Assigns the name-value pairs of another NameValueCollection to this one.
 
void swap (NameValueCollection &nvc)
 Moves the name-value pairs of another NameValueCollection to this one.
 
const std::string & operator[] (const std::string &name) const
 Swaps the NameValueCollection with another one.
 
void set (const std::string &name, const std::string &value)
 
void add (const std::string &name, const std::string &value)
 Sets the value of the (first) name-value pair with the given name.
 
const std::string & get (const std::string &name) const
 Adds a new name-value pair with the given name and value.
 
const std::string & get (const std::string &name, const std::string &defaultValue) const
 
bool has (const std::string &name) const
 
ConstIterator find (const std::string &name) const
 
ConstIterator begin () const
 
ConstIterator end () const
 
bool empty () const
 
std::size_t size () const
 Returns true iff the header does not have any content.
 
void erase (const std::string &name)
 
void clear ()
 Removes all name-value pairs with the given name.
 

Private Attributes

HeaderMap _map
 Removes all name-value pairs and their values.
 

Detailed Description

A collection of name-value pairs that are used in various internet protocols like HTTP and SMTP.

The name is case-insensitive.

There can be more than one name-value pair with the same name.

Definition at line 31 of file NameValueCollection.h.

Member Typedef Documentation

◆ ConstIterator

◆ HeaderMap

using Poco::Net::NameValueCollection::HeaderMap = Poco::ListMap<std::string, std::string>

Definition at line 41 of file NameValueCollection.h.

◆ Iterator

Constructor & Destructor Documentation

◆ NameValueCollection() [1/3]

Poco::Net::NameValueCollection::NameValueCollection ( )

◆ NameValueCollection() [2/3]

Poco::Net::NameValueCollection::NameValueCollection ( const NameValueCollection & nvc)

Creates an empty NameValueCollection.

◆ NameValueCollection() [3/3]

Poco::Net::NameValueCollection::NameValueCollection ( NameValueCollection && nvc)
noexcept

Creates a NameValueCollection by copying another one.

◆ ~NameValueCollection()

virtual Poco::Net::NameValueCollection::~NameValueCollection ( )
virtual

Creates a NameValueCollection by moving another one.

Member Function Documentation

◆ add()

void Poco::Net::NameValueCollection::add ( const std::string & name,
const std::string & value )

Sets the value of the (first) name-value pair with the given name.

◆ begin()

ConstIterator Poco::Net::NameValueCollection::begin ( ) const

Returns an iterator pointing to the first name-value pair with the given name.

◆ clear()

void Poco::Net::NameValueCollection::clear ( )

Removes all name-value pairs with the given name.

◆ empty()

bool Poco::Net::NameValueCollection::empty ( ) const

Returns an iterator pointing to the end of the name-value pair collection.

◆ end()

ConstIterator Poco::Net::NameValueCollection::end ( ) const

Returns an iterator pointing to the begin of the name-value pair collection.

◆ erase()

void Poco::Net::NameValueCollection::erase ( const std::string & name)

Returns the number of name-value pairs in the collection.

◆ find()

ConstIterator Poco::Net::NameValueCollection::find ( const std::string & name) const

Returns true if there is at least one name-value pair with the given name.

◆ get() [1/2]

const std::string & Poco::Net::NameValueCollection::get ( const std::string & name) const

Adds a new name-value pair with the given name and value.

◆ get() [2/2]

const std::string & Poco::Net::NameValueCollection::get ( const std::string & name,
const std::string & defaultValue ) const

Returns the value of the first name-value pair with the given name.

Throws a NotFoundException if the name-value pair does not exist.

◆ has()

bool Poco::Net::NameValueCollection::has ( const std::string & name) const

Returns the value of the first name-value pair with the given name. If no value with the given name has been found, the defaultValue is returned.

◆ operator=() [1/2]

NameValueCollection & Poco::Net::NameValueCollection::operator= ( const NameValueCollection & nvc)

Destroys the NameValueCollection.

◆ operator=() [2/2]

NameValueCollection & Poco::Net::NameValueCollection::operator= ( NameValueCollection && nvc)
noexcept

Assigns the name-value pairs of another NameValueCollection to this one.

◆ operator[]()

const std::string & Poco::Net::NameValueCollection::operator[] ( const std::string & name) const

Swaps the NameValueCollection with another one.

◆ set()

void Poco::Net::NameValueCollection::set ( const std::string & name,
const std::string & value )

Returns the value of the (first) name-value pair with the given name.

Throws a NotFoundException if the name-value pair does not exist.

◆ size()

std::size_t Poco::Net::NameValueCollection::size ( ) const

Returns true iff the header does not have any content.

◆ swap()

void Poco::Net::NameValueCollection::swap ( NameValueCollection & nvc)

Moves the name-value pairs of another NameValueCollection to this one.

+ Here is the caller graph for this function:

Member Data Documentation

◆ _map

HeaderMap Poco::Net::NameValueCollection::_map
private

Removes all name-value pairs and their values.

Definition at line 116 of file NameValueCollection.h.


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