polserver/pol-core/pol/module/httpmod.h
Fernando Rozenblit cbadd96b49
General cleanup of module includes (#253)
1) Made all module methods [[nodiscard]]. Glad to report no leaks were found. We should add the same to BObjects.

2) Protected members of NPCExecutorModule (were public before).
3) Added NPCExecutorModule::controlled_npc() so that osmod can access the npc's name and position.

4) Removed declarations for undefined functions:
- attributemod.h: mf_SetAttributeIntrinsicMod()
- osmod.h: mf_System_RPM()
- vitalmod.h: mf_SetVitalMaximumValue() and mf_SetVitalRegenRate()
2020-08-29 11:35:13 +02:00

56 lines
1.2 KiB
C++

/** @file
*
* @par History
*/
#ifndef __HTTPMOD_H
#define __HTTPMOD_H
#include <string>
#include "../../clib/network/wnsckt.h"
#include "../polmodl.h"
namespace Pol
{
namespace Bscript
{
class BObjectImp;
class Executor;
} // namespace Bscript
} // namespace Pol
namespace Pol
{
namespace Core
{
class UOExecutor;
}
namespace Module
{
class HttpExecutorModule : public Bscript::TmplExecutorModule<HttpExecutorModule, Core::PolModule>
{
public:
HttpExecutorModule( Bscript::Executor& exec, Clib::Socket&& isck );
[[nodiscard]] Bscript::BObjectImp* mf_WriteHtml();
[[nodiscard]] Bscript::BObjectImp* mf_WriteHtmlRaw();
[[nodiscard]] Bscript::BObjectImp* mf_QueryParam();
[[nodiscard]] Bscript::BObjectImp* mf_QueryIP();
void read_query_string( const std::string& query_string );
void read_query_ip();
virtual size_t sizeEstimate() const override;
// TODO: clean up the socket ownership thing so these can be private again
public:
Clib::Socket sck_;
typedef std::map<std::string, std::string, Clib::ci_cmp_pred> QueryParamMap;
QueryParamMap params_;
int continuing_offset;
std::string query_ip_;
};
} // namespace Module
} // namespace Pol
#endif // HTTPMOD_H