123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354 |
- #ifndef WEBFUN_H
- #define WEBFUN_H
- #ifdef _WIN32
- #ifdef HTTPLIBEXPORTS
- #define WEBFUN_API __declspec(dllexport)
- #else
- #define WEBFUN_API __declspec(dllimport)
- #ifdef _DEBUG
- #pragma comment (lib, "httplibd.lib")
- #else
- #pragma comment (lib, "httplib.lib")
- #endif
- #endif
- #else
- #define WEBFUN_API
- #endif
- #include <set>
- #include <map>
- #include <string>
- #include <functional>
- #include <boost/any.hpp>
- namespace weblib
- {
- struct httpinfo
- {
- std::string strurl{};
- std::string strtarget{};
- std::string strjson{};
- std::string stronly{};
- std::map<std::string, std::string> addheadinfo{};
- std::set<int> setresult_int{};
- };
- WEBFUN_API inline void* webini(int iport = 0, bool blog = true);
- WEBFUN_API inline void webrun(void* pweb);
- WEBFUN_API inline void delweb(void* pweb);
- WEBFUN_API inline void addmsg(void* pweb, boost::any thttp);
- WEBFUN_API inline void* httpini();
- WEBFUN_API inline void delhttp(void* phttp);
- WEBFUN_API inline void addhttpmsg(void* phttp, boost::any thttp);
- WEBFUN_API inline void sendhttp(void* phttp, httpinfo&& thttpinfo, std::function<void(std::string, int)> &&dofun = nullptr);
- }
- #endif // WEBSOCKET_HPP
|