|
drogon
C++14/17-based HTTP application framework
|
This class represents the attributes stored in the HTTP request. One can add/get any type of data to/from an Attributes object. More...
#include <drogon/Attribute.h>
Public Member Functions | |
| template<typename T> | |
| const T & | get (const std::string &key) const |
| Get the data identified by the key parameter. | |
| std::any & | operator[] (const std::string &key) |
| Get the 'any' object identified by the given key. | |
| void | insert (const std::string &key, const std::any &obj) |
| Insert a key-value pair. | |
| void | insert (const std::string &key, std::any &&obj) |
| Insert a key-value pair. | |
| void | erase (const std::string &key) |
| Erase the data identified by the given key. | |
| bool | find (const std::string &key) |
| Return true if the data identified by the key exists. | |
| void | clear () |
| Clear all attributes. | |
| Attributes ()=default | |
| Constructor, usually called by the framework. | |
This class represents the attributes stored in the HTTP request. One can add/get any type of data to/from an Attributes object.
|
inline |
Get the data identified by the key parameter.
|
inline |
Insert a key-value pair.
|
inline |
Insert a key-value pair.