C and C++ web framework.
http://rapida.vilor.one/docs
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
1.2 KiB
67 lines
1.2 KiB
/* SPDX-License-Identifier: GPL-3.0-or-later */ |
|
/* Copyright 2022 Ivan Polyakov */ |
|
|
|
#ifndef RAPIDA_QUERY_HXX_ENTRY |
|
#define RAPIDA_QUERY_HXX_ENTRY |
|
|
|
#include "KeyVal.hxx" |
|
#include "query.h" |
|
|
|
namespace rpd { |
|
/*! |
|
* \brief Query storage in key-value format. |
|
*/ |
|
class Query : public KeyVal { |
|
public: |
|
/*! |
|
* \brief Default constructor. |
|
* |
|
* Just calls parent default costructor. |
|
*/ |
|
Query() |
|
: KeyVal() |
|
{ |
|
} |
|
|
|
/*! |
|
* \brief Constructor. |
|
* |
|
* \param keyval Key-value storage to base on it. |
|
* |
|
* Just calls parent constructor with base key-value storage. |
|
*/ |
|
Query(rpd_keyval *keyval) |
|
: KeyVal(keyval) |
|
{ |
|
} |
|
|
|
/*! |
|
* \brief Parse query string into the key-val pairs. |
|
* |
|
* \param query Query string. |
|
* |
|
* \return Status code. 0 is success. |
|
*/ |
|
int parse(const char *query) |
|
{ |
|
return rpd_query_parse(keyval(), query); |
|
} |
|
|
|
/*! |
|
* \brief Convert key-val pairs to query string. |
|
* |
|
* \return Query string. |
|
*/ |
|
char *c_str() const |
|
{ |
|
return rpd_query_str(keyval()); |
|
} |
|
|
|
/*! |
|
* \brief Destructor. |
|
*/ |
|
virtual ~Query() { } |
|
}; |
|
} |
|
|
|
#endif // RAPIDA_QUERY_HXX_ENTRY
|
|
|