chomik 0.2.1
experimental and minimalistic programming language

My name is Pawel Biernacki.
I am a software engineer.
This site is my hobby project.

Loading...
Searching...
No Matches
http_chomik::server Class Reference

#include <http_chomik.h>

Inheritance diagram for http_chomik::server:

Public Member Functions

 server (int s)
 
 ~server ()
 
void read_data (std::ostream &input_buffer_stream)
 
void handle_main (std::ostream &message_stream)
 
void handle_incorrect_uri (std::ostream &message_stream)
 
void handle_code (std::ostream &message_stream, std::smatch &m)
 
void handle_chomik_image (std::ostream &message_stream)
 
void handle_stylesheet (std::ostream &message_stream)
 
void send_message (const std::string &message)
 

Static Public Member Functions

static void do_processing (int my_port, wrapper_base &my_wrapper)
 

Protected Member Functions

virtual void add_html_head_content (std::ostream &message_stream)
 
virtual void add_html_default_chomik_code (std::ostream &message_stream)
 
virtual void add_html_body (std::ostream &message_stream)
 
virtual void add_html_body_for_incorrect_uri (std::ostream &message_stream)
 
virtual void add_html_body_for_code (std::ostream &message_stream, const std::string &decoded_code, std::stringstream &error_stream, std::stringstream &error_stream2)
 
void add_html_for_program_output (std::istream &source, std::ostream &message_stream)
 
virtual void create_a_new_machine (std::unique_ptr< machine > &target)
 

Detailed Description

You may inherit this class and redefine some virtual functions to tune the server's behaviour.

Constructor & Destructor Documentation

◆ server()

http_chomik::server::server ( int s)
inline

◆ ~server()

http_chomik::server::~server ( )

Member Function Documentation

◆ add_html_body()

virtual void http_chomik::server::add_html_body ( std::ostream & message_stream)
protectedvirtual

You may also change the whole body HTML by redefining this method.

Reimplemented in fancy_http_chomik::server.

◆ add_html_body_for_code()

virtual void http_chomik::server::add_html_body_for_code ( std::ostream & message_stream,
const std::string & decoded_code,
std::stringstream & error_stream,
std::stringstream & error_stream2 )
protectedvirtual

You may redefine it to handle the code processing.

Reimplemented in fancy_http_chomik::server.

◆ add_html_body_for_incorrect_uri()

virtual void http_chomik::server::add_html_body_for_incorrect_uri ( std::ostream & message_stream)
protectedvirtual

This method can be used to redefine the whole document body when handling incorrect URI.

Reimplemented in fancy_http_chomik::server.

◆ add_html_default_chomik_code()

virtual void http_chomik::server::add_html_default_chomik_code ( std::ostream & message_stream)
protectedvirtual

Remember to pack the code properly as HTML.

Reimplemented in fancy_http_chomik::server.

◆ add_html_for_program_output()

void http_chomik::server::add_html_for_program_output ( std::istream & source,
std::ostream & message_stream )
protected

This method converts the program output to HTML.

◆ add_html_head_content()

virtual void http_chomik::server::add_html_head_content ( std::ostream & message_stream)
protectedvirtual

Feel free to override this function if you wish another code in the HTML head. Consider invoking the original version.

Reimplemented in fancy_http_chomik::server.

◆ create_a_new_machine()

virtual void http_chomik::server::create_a_new_machine ( std::unique_ptr< machine > & target)
protectedvirtual

You might want to redefine this if you want to run the program for a different chomik dialect which requires a special machine.

◆ do_processing()

static void http_chomik::server::do_processing ( int my_port,
wrapper_base & my_wrapper )
static

◆ handle_chomik_image()

void http_chomik::server::handle_chomik_image ( std::ostream & message_stream)

◆ handle_code()

void http_chomik::server::handle_code ( std::ostream & message_stream,
std::smatch & m )

◆ handle_incorrect_uri()

void http_chomik::server::handle_incorrect_uri ( std::ostream & message_stream)

◆ handle_main()

void http_chomik::server::handle_main ( std::ostream & message_stream)

◆ handle_stylesheet()

void http_chomik::server::handle_stylesheet ( std::ostream & message_stream)

◆ read_data()

void http_chomik::server::read_data ( std::ostream & input_buffer_stream)

◆ send_message()

void http_chomik::server::send_message ( const std::string & message)

The documentation for this class was generated from the following file:

copyright by Pawel Biernacki

Vantaa 2022