mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2025-05-06 17:51:36 +02:00
Removed drogon's exports.h.
This commit is contained in:
parent
13b2863908
commit
50c0f2115e
@ -1,42 +0,0 @@
|
|||||||
|
|
||||||
#ifndef DROGON_EXPORT_H
|
|
||||||
#define DROGON_EXPORT_H
|
|
||||||
|
|
||||||
#ifdef DROGON_STATIC_DEFINE
|
|
||||||
# define DROGON_EXPORT
|
|
||||||
# define DROGON_NO_EXPORT
|
|
||||||
#else
|
|
||||||
# ifndef DROGON_EXPORT
|
|
||||||
# ifdef drogon_EXPORTS
|
|
||||||
/* We are building this library */
|
|
||||||
# define DROGON_EXPORT
|
|
||||||
# else
|
|
||||||
/* We are using this library */
|
|
||||||
# define DROGON_EXPORT
|
|
||||||
# endif
|
|
||||||
# endif
|
|
||||||
|
|
||||||
# ifndef DROGON_NO_EXPORT
|
|
||||||
# define DROGON_NO_EXPORT
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef DROGON_DEPRECATED
|
|
||||||
# define DROGON_DEPRECATED __attribute__ ((__deprecated__))
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef DROGON_DEPRECATED_EXPORT
|
|
||||||
# define DROGON_DEPRECATED_EXPORT DROGON_EXPORT DROGON_DEPRECATED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef DROGON_DEPRECATED_NO_EXPORT
|
|
||||||
# define DROGON_DEPRECATED_NO_EXPORT DROGON_NO_EXPORT DROGON_DEPRECATED
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if 0 /* DEFINE_NO_DEPRECATED */
|
|
||||||
# ifndef DROGON_NO_DEPRECATED
|
|
||||||
# define DROGON_NO_DEPRECATED
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif /* DROGON_EXPORT_H */
|
|
@ -1,35 +0,0 @@
|
|||||||
link_libraries(${PROJECT_NAME})
|
|
||||||
|
|
||||||
set(benchmark_sources benchmark/BenchmarkCtrl.cc benchmark/JsonCtrl.cc
|
|
||||||
benchmark/main.cc)
|
|
||||||
|
|
||||||
add_executable(client client_example/main.cc)
|
|
||||||
add_executable(websocket_client websocket_client/WebSocketClient.cc)
|
|
||||||
add_executable(benchmark ${benchmark_sources})
|
|
||||||
add_executable(helloworld helloworld/main.cc
|
|
||||||
helloworld/HelloController.cc
|
|
||||||
helloworld/HelloViewController.cc)
|
|
||||||
drogon_create_views(helloworld
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/helloworld
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR})
|
|
||||||
add_executable(file_upload file_upload/file_upload.cc)
|
|
||||||
drogon_create_views(file_upload
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/file_upload
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR})
|
|
||||||
add_executable(login_session login_session/main.cc)
|
|
||||||
drogon_create_views(login_session
|
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/login_session
|
|
||||||
${CMAKE_CURRENT_BINARY_DIR})
|
|
||||||
|
|
||||||
set(example_targets
|
|
||||||
benchmark
|
|
||||||
client
|
|
||||||
websocket_client
|
|
||||||
helloworld
|
|
||||||
file_upload
|
|
||||||
login_session)
|
|
||||||
|
|
||||||
set_property(TARGET ${example_targets}
|
|
||||||
PROPERTY CXX_STANDARD ${DROGON_CXX_STANDARD})
|
|
||||||
set_property(TARGET ${example_targets} PROPERTY CXX_STANDARD_REQUIRED ON)
|
|
||||||
set_property(TARGET ${example_targets} PROPERTY CXX_EXTENSIONS OFF)
|
|
@ -13,7 +13,7 @@
|
|||||||
*/
|
*/
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <drogon/exports.h>
|
|
||||||
#include <trantor/utils/Date.h>
|
#include <trantor/utils/Date.h>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
#include <string>
|
#include <string>
|
||||||
@ -22,7 +22,7 @@ namespace drogon {
|
|||||||
/**
|
/**
|
||||||
* @brief this class represents a cookie entity.
|
* @brief this class represents a cookie entity.
|
||||||
*/
|
*/
|
||||||
class DROGON_EXPORT Cookie {
|
class Cookie {
|
||||||
public:
|
public:
|
||||||
/// Constructor
|
/// Constructor
|
||||||
/**
|
/**
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
#include <drogon/LocalHostFilter.h>
|
#include <drogon/LocalHostFilter.h>
|
||||||
#include <drogon/MultiPart.h>
|
#include <drogon/MultiPart.h>
|
||||||
#include <drogon/drogon_callbacks.h>
|
#include <drogon/drogon_callbacks.h>
|
||||||
#include <drogon/exports.h>
|
|
||||||
#include <drogon/plugins/Plugin.h>
|
#include <drogon/plugins/Plugin.h>
|
||||||
#include <drogon/utils/HttpConstraint.h>
|
#include <drogon/utils/HttpConstraint.h>
|
||||||
#include <drogon/utils/Utilities.h>
|
#include <drogon/utils/Utilities.h>
|
||||||
@ -59,7 +59,7 @@ using DefaultHandler =
|
|||||||
std::function<void(const HttpRequestPtr &,
|
std::function<void(const HttpRequestPtr &,
|
||||||
std::function<void(const HttpResponsePtr &)> &&)>;
|
std::function<void(const HttpResponsePtr &)> &&)>;
|
||||||
|
|
||||||
class DROGON_EXPORT HttpAppFramework : public trantor::NonCopyable {
|
class HttpAppFramework : public trantor::NonCopyable {
|
||||||
public:
|
public:
|
||||||
virtual ~HttpAppFramework() = default;
|
virtual ~HttpAppFramework() = default;
|
||||||
/// Get the instance of HttpAppFramework
|
/// Get the instance of HttpAppFramework
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <drogon/HttpResponse.h>
|
#include <drogon/HttpResponse.h>
|
||||||
#include <drogon/HttpTypes.h>
|
#include <drogon/HttpTypes.h>
|
||||||
#include <drogon/drogon_callbacks.h>
|
#include <drogon/drogon_callbacks.h>
|
||||||
#include <drogon/exports.h>
|
|
||||||
#include <trantor/net/EventLoop.h>
|
#include <trantor/net/EventLoop.h>
|
||||||
#include <trantor/utils/NonCopyable.h>
|
#include <trantor/utils/NonCopyable.h>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
@ -63,7 +63,7 @@ private:
|
|||||||
* response callbacks are invoked without fear of accidental deconstruction.
|
* response callbacks are invoked without fear of accidental deconstruction.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class DROGON_EXPORT HttpClient : public trantor::NonCopyable {
|
class HttpClient : public trantor::NonCopyable {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief Send a request asynchronously to the server
|
* @brief Send a request asynchronously to the server
|
||||||
|
@ -24,7 +24,7 @@ namespace drogon {
|
|||||||
* @brief The abstract base class for filters
|
* @brief The abstract base class for filters
|
||||||
* For more details on the class, see the wiki site (the 'Filter' section)
|
* For more details on the class, see the wiki site (the 'Filter' section)
|
||||||
*/
|
*/
|
||||||
class DROGON_EXPORT HttpFilterBase {
|
class HttpFilterBase {
|
||||||
public:
|
public:
|
||||||
/// This virtual function should be overrided in subclasses.
|
/// This virtual function should be overrided in subclasses.
|
||||||
/**
|
/**
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
#include <drogon/HttpTypes.h>
|
#include <drogon/HttpTypes.h>
|
||||||
#include <drogon/Session.h>
|
#include <drogon/Session.h>
|
||||||
#include <drogon/UploadFile.h>
|
#include <drogon/UploadFile.h>
|
||||||
#include <drogon/exports.h>
|
|
||||||
#include <drogon/utils/string_view.h>
|
#include <drogon/utils/string_view.h>
|
||||||
#include <json/json.h>
|
#include <json/json.h>
|
||||||
#include <trantor/net/InetAddress.h>
|
#include <trantor/net/InetAddress.h>
|
||||||
@ -67,7 +67,7 @@ template <>
|
|||||||
std::shared_ptr<Json::Value> fromRequest(const HttpRequest &req);
|
std::shared_ptr<Json::Value> fromRequest(const HttpRequest &req);
|
||||||
|
|
||||||
/// Abstract class for webapp developer to get or set the Http request;
|
/// Abstract class for webapp developer to get or set the Http request;
|
||||||
class DROGON_EXPORT HttpRequest {
|
class HttpRequest {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief This template enables implicit type conversion. For using this
|
* @brief This template enables implicit type conversion. For using this
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
#include <drogon/Cookie.h>
|
#include <drogon/Cookie.h>
|
||||||
#include <drogon/HttpTypes.h>
|
#include <drogon/HttpTypes.h>
|
||||||
#include <drogon/HttpViewData.h>
|
#include <drogon/HttpViewData.h>
|
||||||
#include <drogon/exports.h>
|
|
||||||
#include <drogon/utils/string_view.h>
|
#include <drogon/utils/string_view.h>
|
||||||
#include <json/json.h>
|
#include <json/json.h>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -59,7 +59,7 @@ inline HttpResponsePtr toResponse<Json::Value &>(Json::Value &pJson) {
|
|||||||
return toResponse((const Json::Value &)pJson);
|
return toResponse((const Json::Value &)pJson);
|
||||||
}
|
}
|
||||||
|
|
||||||
class DROGON_EXPORT HttpResponse {
|
class HttpResponse {
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* @brief This template enables automatic type conversion. For using this
|
* @brief This template enables automatic type conversion. For using this
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <drogon/exports.h>
|
|
||||||
#include <drogon/utils/any.h>
|
#include <drogon/utils/any.h>
|
||||||
#include <drogon/utils/string_view.h>
|
#include <drogon/utils/string_view.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
@ -28,7 +28,7 @@
|
|||||||
|
|
||||||
namespace drogon {
|
namespace drogon {
|
||||||
/// This class represents the data set displayed in views.
|
/// This class represents the data set displayed in views.
|
||||||
class DROGON_EXPORT HttpViewData {
|
class HttpViewData {
|
||||||
public:
|
public:
|
||||||
/// The function template is used to get an item in the data set by the key
|
/// The function template is used to get an item in the data set by the key
|
||||||
/// parameter.
|
/// parameter.
|
||||||
|
@ -15,13 +15,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <drogon/HttpFilter.h>
|
#include <drogon/HttpFilter.h>
|
||||||
#include <drogon/exports.h>
|
|
||||||
|
|
||||||
namespace drogon {
|
namespace drogon {
|
||||||
/**
|
/**
|
||||||
* @brief A filter that prohibit access from external networks
|
* @brief A filter that prohibit access from external networks
|
||||||
*/
|
*/
|
||||||
class DROGON_EXPORT IntranetIpFilter : public HttpFilter<IntranetIpFilter> {
|
class IntranetIpFilter : public HttpFilter<IntranetIpFilter> {
|
||||||
public:
|
public:
|
||||||
IntranetIpFilter() {
|
IntranetIpFilter() {
|
||||||
}
|
}
|
||||||
|
@ -15,13 +15,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <drogon/HttpFilter.h>
|
#include <drogon/HttpFilter.h>
|
||||||
#include <drogon/exports.h>
|
|
||||||
|
|
||||||
namespace drogon {
|
namespace drogon {
|
||||||
/**
|
/**
|
||||||
* @brief A filter that prohibit access from other hosts.
|
* @brief A filter that prohibit access from other hosts.
|
||||||
*/
|
*/
|
||||||
class DROGON_EXPORT LocalHostFilter : public HttpFilter<LocalHostFilter> {
|
class LocalHostFilter : public HttpFilter<LocalHostFilter> {
|
||||||
public:
|
public:
|
||||||
LocalHostFilter() {
|
LocalHostFilter() {
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <drogon/HttpRequest.h>
|
#include <drogon/HttpRequest.h>
|
||||||
#include <drogon/exports.h>
|
|
||||||
#include <drogon/utils/string_view.h>
|
#include <drogon/utils/string_view.h>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
@ -29,7 +29,7 @@ class HttpFileImpl;
|
|||||||
* @brief This class represents a uploaded file by a HTTP request.
|
* @brief This class represents a uploaded file by a HTTP request.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class DROGON_EXPORT HttpFile {
|
class HttpFile {
|
||||||
public:
|
public:
|
||||||
HttpFile(std::shared_ptr<HttpFileImpl> &&implPtr);
|
HttpFile(std::shared_ptr<HttpFileImpl> &&implPtr);
|
||||||
/// Return the file name;
|
/// Return the file name;
|
||||||
@ -110,7 +110,7 @@ private:
|
|||||||
|
|
||||||
/// A parser class which help the user to get the files and the parameters in
|
/// A parser class which help the user to get the files and the parameters in
|
||||||
/// the multipart format request.
|
/// the multipart format request.
|
||||||
class DROGON_EXPORT MultiPartParser {
|
class MultiPartParser {
|
||||||
public:
|
public:
|
||||||
MultiPartParser(){};
|
MultiPartParser(){};
|
||||||
~MultiPartParser(){};
|
~MultiPartParser(){};
|
||||||
|
@ -53,7 +53,7 @@ private:
|
|||||||
* @brief WebSocket client abstract class
|
* @brief WebSocket client abstract class
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class DROGON_EXPORT WebSocketClient {
|
class WebSocketClient {
|
||||||
public:
|
public:
|
||||||
/// Get the WebSocket connection that is typically used to send messages.
|
/// Get the WebSocket connection that is typically used to send messages.
|
||||||
virtual WebSocketConnectionPtr getConnection() = 0;
|
virtual WebSocketConnectionPtr getConnection() = 0;
|
||||||
|
@ -76,7 +76,7 @@ namespace plugin {
|
|||||||
* configuration file.
|
* configuration file.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class DROGON_EXPORT AccessLogger : public drogon::Plugin<AccessLogger> {
|
class AccessLogger : public drogon::Plugin<AccessLogger> {
|
||||||
public:
|
public:
|
||||||
AccessLogger() {
|
AccessLogger() {
|
||||||
}
|
}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
#include <drogon/drogon_callbacks.h>
|
#include <drogon/drogon_callbacks.h>
|
||||||
#include <drogon/exports.h>
|
|
||||||
#include <drogon/plugins/Plugin.h>
|
#include <drogon/plugins/Plugin.h>
|
||||||
#include <regex>
|
#include <regex>
|
||||||
|
|
||||||
@ -39,7 +39,7 @@ namespace plugin {
|
|||||||
* configuration file.
|
* configuration file.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class DROGON_EXPORT SecureSSLRedirector
|
class SecureSSLRedirector
|
||||||
: public drogon::Plugin<SecureSSLRedirector> {
|
: public drogon::Plugin<SecureSSLRedirector> {
|
||||||
public:
|
public:
|
||||||
SecureSSLRedirector() {
|
SecureSSLRedirector() {
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <drogon/exports.h>
|
|
||||||
#include <drogon/utils/string_view.h>
|
#include <drogon/utils/string_view.h>
|
||||||
#include <trantor/utils/Date.h>
|
#include <trantor/utils/Date.h>
|
||||||
#include <trantor/utils/Funcs.h>
|
#include <trantor/utils/Funcs.h>
|
||||||
@ -31,24 +31,24 @@ time_t timegm(struct tm *tm);
|
|||||||
namespace drogon {
|
namespace drogon {
|
||||||
namespace utils {
|
namespace utils {
|
||||||
/// Determine if the string is an integer
|
/// Determine if the string is an integer
|
||||||
DROGON_EXPORT bool isInteger(const std::string &str);
|
bool isInteger(const std::string &str);
|
||||||
|
|
||||||
/// Generate random a string
|
/// Generate random a string
|
||||||
/**
|
/**
|
||||||
* @param length The string length
|
* @param length The string length
|
||||||
* The returned string consists of uppercase and lowercase letters and numbers
|
* The returned string consists of uppercase and lowercase letters and numbers
|
||||||
*/
|
*/
|
||||||
DROGON_EXPORT std::string genRandomString(int length);
|
std::string genRandomString(int length);
|
||||||
|
|
||||||
/// Convert a binary string to hex format
|
/// Convert a binary string to hex format
|
||||||
DROGON_EXPORT std::string binaryStringToHex(const unsigned char *ptr,
|
std::string binaryStringToHex(const unsigned char *ptr,
|
||||||
size_t length);
|
size_t length);
|
||||||
|
|
||||||
/// Get a binary string from hexadecimal format
|
/// Get a binary string from hexadecimal format
|
||||||
DROGON_EXPORT std::string hexToBinaryString(const char *ptr, size_t length);
|
std::string hexToBinaryString(const char *ptr, size_t length);
|
||||||
|
|
||||||
/// Get a binary vector from hexadecimal format
|
/// Get a binary vector from hexadecimal format
|
||||||
DROGON_EXPORT std::vector<char> hexToBinaryVector(const char *ptr,
|
std::vector<char> hexToBinaryVector(const char *ptr,
|
||||||
size_t length);
|
size_t length);
|
||||||
|
|
||||||
/// Split the string into multiple separated strings.
|
/// Split the string into multiple separated strings.
|
||||||
@ -63,28 +63,28 @@ inline std::vector<std::string> splitString(const std::string &str,
|
|||||||
return trantor::splitString(str, separator, acceptEmptyString);
|
return trantor::splitString(str, separator, acceptEmptyString);
|
||||||
}
|
}
|
||||||
|
|
||||||
DROGON_EXPORT std::set<std::string> splitStringToSet(
|
std::set<std::string> splitStringToSet(
|
||||||
const std::string &str,
|
const std::string &str,
|
||||||
const std::string &separator);
|
const std::string &separator);
|
||||||
|
|
||||||
/// Get UUID string.
|
/// Get UUID string.
|
||||||
DROGON_EXPORT std::string getUuid();
|
std::string getUuid();
|
||||||
|
|
||||||
/// Encode the string to base64 format.
|
/// Encode the string to base64 format.
|
||||||
DROGON_EXPORT std::string base64Encode(const unsigned char *bytes_to_encode,
|
std::string base64Encode(const unsigned char *bytes_to_encode,
|
||||||
unsigned int in_len,
|
unsigned int in_len,
|
||||||
bool url_safe = false);
|
bool url_safe = false);
|
||||||
|
|
||||||
/// Decode the base64 format string.
|
/// Decode the base64 format string.
|
||||||
DROGON_EXPORT std::string base64Decode(const std::string &encoded_string);
|
std::string base64Decode(const std::string &encoded_string);
|
||||||
DROGON_EXPORT std::vector<char> base64DecodeToVector(
|
std::vector<char> base64DecodeToVector(
|
||||||
const std::string &encoded_string);
|
const std::string &encoded_string);
|
||||||
|
|
||||||
/// Check if the string need decoding
|
/// Check if the string need decoding
|
||||||
DROGON_EXPORT bool needUrlDecoding(const char *begin, const char *end);
|
bool needUrlDecoding(const char *begin, const char *end);
|
||||||
|
|
||||||
/// Decode from or encode to the URL format string
|
/// Decode from or encode to the URL format string
|
||||||
DROGON_EXPORT std::string urlDecode(const char *begin, const char *end);
|
std::string urlDecode(const char *begin, const char *end);
|
||||||
inline std::string urlDecode(const std::string &szToDecode) {
|
inline std::string urlDecode(const std::string &szToDecode) {
|
||||||
auto begin = szToDecode.data();
|
auto begin = szToDecode.data();
|
||||||
return urlDecode(begin, begin + szToDecode.length());
|
return urlDecode(begin, begin + szToDecode.length());
|
||||||
@ -94,11 +94,11 @@ inline std::string urlDecode(const string_view &szToDecode) {
|
|||||||
return urlDecode(begin, begin + szToDecode.length());
|
return urlDecode(begin, begin + szToDecode.length());
|
||||||
}
|
}
|
||||||
|
|
||||||
DROGON_EXPORT std::string urlEncode(const std::string &);
|
std::string urlEncode(const std::string &);
|
||||||
DROGON_EXPORT std::string urlEncodeComponent(const std::string &);
|
std::string urlEncodeComponent(const std::string &);
|
||||||
|
|
||||||
/// Get the MD5 digest of a string.
|
/// Get the MD5 digest of a string.
|
||||||
DROGON_EXPORT std::string getMd5(const char *data, const size_t dataLen);
|
std::string getMd5(const char *data, const size_t dataLen);
|
||||||
inline std::string getMd5(const std::string &originalString) {
|
inline std::string getMd5(const std::string &originalString) {
|
||||||
return getMd5(originalString.data(), originalString.length());
|
return getMd5(originalString.data(), originalString.length());
|
||||||
}
|
}
|
||||||
@ -108,16 +108,16 @@ inline std::string getMd5(const std::string &originalString) {
|
|||||||
* @param data the input data
|
* @param data the input data
|
||||||
* @param ndata the input data length
|
* @param ndata the input data length
|
||||||
*/
|
*/
|
||||||
DROGON_EXPORT std::string gzipCompress(const char *data, const size_t ndata);
|
std::string gzipCompress(const char *data, const size_t ndata);
|
||||||
DROGON_EXPORT std::string gzipDecompress(const char *data, const size_t ndata);
|
std::string gzipDecompress(const char *data, const size_t ndata);
|
||||||
|
|
||||||
/// Commpress or decompress data using brotli lib.
|
/// Commpress or decompress data using brotli lib.
|
||||||
/**
|
/**
|
||||||
* @param data the input data
|
* @param data the input data
|
||||||
* @param ndata the input data length
|
* @param ndata the input data length
|
||||||
*/
|
*/
|
||||||
DROGON_EXPORT std::string brotliCompress(const char *data, const size_t ndata);
|
std::string brotliCompress(const char *data, const size_t ndata);
|
||||||
DROGON_EXPORT std::string brotliDecompress(const char *data,
|
std::string brotliDecompress(const char *data,
|
||||||
const size_t ndata);
|
const size_t ndata);
|
||||||
|
|
||||||
/// Get the http full date string
|
/// Get the http full date string
|
||||||
@ -130,30 +130,30 @@ DROGON_EXPORT std::string brotliDecompress(const char *data,
|
|||||||
Wed, 12 Sep 2018 09:22:40 GMT
|
Wed, 12 Sep 2018 09:22:40 GMT
|
||||||
@endcode
|
@endcode
|
||||||
*/
|
*/
|
||||||
DROGON_EXPORT char *getHttpFullDate(
|
char *getHttpFullDate(
|
||||||
const trantor::Date &date = trantor::Date::now());
|
const trantor::Date &date = trantor::Date::now());
|
||||||
|
|
||||||
/// Get the trantor::Date object according to the http full date string
|
/// Get the trantor::Date object according to the http full date string
|
||||||
/**
|
/**
|
||||||
* Returns trantor::Date(std::numeric_limits<int64_t>::max()) upon failure.
|
* Returns trantor::Date(std::numeric_limits<int64_t>::max()) upon failure.
|
||||||
*/
|
*/
|
||||||
DROGON_EXPORT trantor::Date getHttpDate(const std::string &httpFullDateString);
|
trantor::Date getHttpDate(const std::string &httpFullDateString);
|
||||||
|
|
||||||
/// Get a formatted string
|
/// Get a formatted string
|
||||||
DROGON_EXPORT std::string formattedString(const char *format, ...);
|
std::string formattedString(const char *format, ...);
|
||||||
|
|
||||||
/// Recursively create a file system path
|
/// Recursively create a file system path
|
||||||
/**
|
/**
|
||||||
* Return 0 or -1 on success or failure.
|
* Return 0 or -1 on success or failure.
|
||||||
*/
|
*/
|
||||||
DROGON_EXPORT int createPath(const std::string &path);
|
int createPath(const std::string &path);
|
||||||
|
|
||||||
/// Replace all occurances of from to to inplace
|
/// Replace all occurances of from to to inplace
|
||||||
/**
|
/**
|
||||||
* @param from string to replace
|
* @param from string to replace
|
||||||
* @param to string to replace with
|
* @param to string to replace with
|
||||||
*/
|
*/
|
||||||
DROGON_EXPORT void replaceAll(std::string &s,
|
void replaceAll(std::string &s,
|
||||||
const std::string &from,
|
const std::string &from,
|
||||||
const std::string &to);
|
const std::string &to);
|
||||||
|
|
||||||
@ -168,7 +168,7 @@ DROGON_EXPORT void replaceAll(std::string &s,
|
|||||||
* @note DO NOT abuse this function. Especially if Drogon is built without
|
* @note DO NOT abuse this function. Especially if Drogon is built without
|
||||||
* OpenSSL. Entropy running low is a real issue.
|
* OpenSSL. Entropy running low is a real issue.
|
||||||
*/
|
*/
|
||||||
DROGON_EXPORT bool secureRandomBytes(void *ptr, size_t size);
|
bool secureRandomBytes(void *ptr, size_t size);
|
||||||
|
|
||||||
} // namespace utils
|
} // namespace utils
|
||||||
} // namespace drogon
|
} // namespace drogon
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
#include "HttpMessageBody.h"
|
#include "HttpMessageBody.h"
|
||||||
#include "HttpUtils.h"
|
#include "HttpUtils.h"
|
||||||
#include <drogon/HttpResponse.h>
|
#include <drogon/HttpResponse.h>
|
||||||
#include <drogon/exports.h>
|
|
||||||
#include <drogon/utils/Utilities.h>
|
#include <drogon/utils/Utilities.h>
|
||||||
#include <trantor/net/InetAddress.h>
|
#include <trantor/net/InetAddress.h>
|
||||||
#include <trantor/utils/Date.h>
|
#include <trantor/utils/Date.h>
|
||||||
@ -29,7 +29,7 @@
|
|||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
namespace drogon {
|
namespace drogon {
|
||||||
class DROGON_EXPORT HttpResponseImpl : public HttpResponse {
|
class HttpResponseImpl : public HttpResponse {
|
||||||
friend class HttpResponseParser;
|
friend class HttpResponseParser;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
Reference in New Issue
Block a user