GameApi 28
Library used by GameApi Builder tool
Loading...
Searching...
No Matches
GameApi_http.cc File Reference
#include "GameApi_http.hh"
#include "GameApi.hh"
#include "Tasks.hh"
#include "GraphI.hh"
#include "zip_file.hpp"
#include "httplib.h"
Include dependency graph for GameApi_http.cc:

Classes

struct  UrlItem
struct  HTTP_files

Macros

#define MINIZ_HEADER_FILE_ONLY   1
#define CPPHTTPLIB_NO_EXCEPTIONS

Functions

bool file_exists (std::string url)
std::string remove_quotes (std::string str)
std::string GetContentInstallDir (bool b)
void * http_server_wait_process (void *)
EXPORT std::string http_server_address ()
IMPORT void * http_server_process (void *)
IMPORT void send_post_request (std::string url, std::string headers, std::string data)
std::string remove_str_after_char (std::string s, char ch)
std::string deploy_truncate (std::string s)
std::string http_to_https (std::string url)
std::string deploy_curl_cmd ()
IMPORT std::string remove_prefix (std::string url)
std::string find_directory (std::string url)
std::string replace_deploy_url (std::string home)
IMPORT int find_str (std::string val, std::string repl)
std::string deploy_replace_string (std::string val, std::string repl, std::string subst)
std::string convert_spaces_to_url_encoding (std::string url)
std::string take_prefix (std::string cd, std::string path)
IMPORT std::string replace_str (std::string val, std::string repl, std::string subst)
std::vector< UrlItem > find_url_items (GameApi::Env &e, std::string s)
void find_url_items2 (GameApi::Env &e, std::string s, std::vector< UrlItem > &result)
void find_url_items3 (GameApi::Env &e, std::vector< UrlItem > &result)
void set_cors_headers (httplib::Response &res)
bool handle_range_request (const httplib::Request &req, httplib::Response &res, const std::vector< std::string > &filenames, const std::vector< std::string > &contents, std::string filename)
EXPORT void start_http_listening (std::vector< std::string > filenames, std::vector< std::string > contents, std::string homepage, std::string script, std::string date, bool transparent)
EXPORT void join_http ()
EXPORT void start_server_shutdown ()
EXPORT void http_sleep ()
EXPORT void send_http_server_shutdown ()
EXPORT bool choose_http_port ()
const char * choose_type (std::string filename)
EXPORT void http_server (std::vector< std::string > filenames, std::vector< std::string > contents, std::string homepage, std::string script, std::string date, bool transparent)
EXPORT std::string replace_urls_from_script (std::string script, const HttpDeployResult &data)
EXPORT HttpDeployResult http_deploy (GameApi::Env &env, std::string h2_script)
void set_http_server_htmlfile (std::string file)
std::string gameapi_example (std::string homepage, std::string script, std::string date, bool transparent)
EXPORT std::vector< unsigned char > find_display_zip_file ()
EXPORT std::vector< HttpFileFromZip > decompress_zip_file (std::vector< unsigned char > zip_contents)

Variables

IMPORT std::string g_http_server_ip = "127.0.0.1"
IMPORT int g_http_server_port =50200
bool g_wait_ongoing = true
IMPORT GameApi::PAT gameapi_temp_dir
std::string g_mod_path
httplib::Server * g_http_server = 0
bool g_http_up_and_running =false
std::string g_http_htmlfile

Macro Definition Documentation

◆ CPPHTTPLIB_NO_EXCEPTIONS

#define CPPHTTPLIB_NO_EXCEPTIONS

◆ MINIZ_HEADER_FILE_ONLY

#define MINIZ_HEADER_FILE_ONLY   1

Function Documentation

◆ choose_http_port()

EXPORT bool choose_http_port ( )
Here is the caller graph for this function:

◆ choose_type()

const char * choose_type ( std::string filename)
Here is the caller graph for this function:

◆ convert_spaces_to_url_encoding()

std::string convert_spaces_to_url_encoding ( std::string url)
Here is the caller graph for this function:

◆ decompress_zip_file()

EXPORT std::vector< HttpFileFromZip > decompress_zip_file ( std::vector< unsigned char > zip_contents)
Here is the caller graph for this function:

◆ deploy_curl_cmd()

std::string deploy_curl_cmd ( )
Here is the caller graph for this function:

◆ deploy_replace_string()

std::string deploy_replace_string ( std::string val,
std::string repl,
std::string subst )
Here is the caller graph for this function:

◆ deploy_truncate()

std::string deploy_truncate ( std::string s)
Here is the caller graph for this function:

◆ file_exists()

bool file_exists ( std::string url)
Here is the caller graph for this function:

◆ find_directory()

std::string find_directory ( std::string url)
Here is the caller graph for this function:

◆ find_display_zip_file()

EXPORT std::vector< unsigned char > find_display_zip_file ( )
Here is the caller graph for this function:

◆ find_str()

IMPORT int find_str ( std::string val,
std::string repl )
Here is the caller graph for this function:

◆ find_url_items()

std::vector< UrlItem > find_url_items ( GameApi::Env & e,
std::string s )
Here is the caller graph for this function:

◆ find_url_items2()

void find_url_items2 ( GameApi::Env & e,
std::string s,
std::vector< UrlItem > & result )
Here is the caller graph for this function:

◆ find_url_items3()

void find_url_items3 ( GameApi::Env & e,
std::vector< UrlItem > & result )
Here is the caller graph for this function:

◆ gameapi_example()

std::string gameapi_example ( std::string homepage,
std::string script,
std::string date,
bool transparent )
Here is the caller graph for this function:

◆ GetContentInstallDir()

std::string GetContentInstallDir ( bool b)
Here is the caller graph for this function:

◆ handle_range_request()

bool handle_range_request ( const httplib::Request & req,
httplib::Response & res,
const std::vector< std::string > & filenames,
const std::vector< std::string > & contents,
std::string filename )
Here is the caller graph for this function:

◆ http_deploy()

EXPORT HttpDeployResult http_deploy ( GameApi::Env & env,
std::string h2_script )
Here is the caller graph for this function:

◆ http_server()

EXPORT void http_server ( std::vector< std::string > filenames,
std::vector< std::string > contents,
std::string homepage,
std::string script,
std::string date,
bool transparent )
Here is the caller graph for this function:

◆ http_server_address()

EXPORT std::string http_server_address ( )
Here is the caller graph for this function:

◆ http_server_process()

EXPORT void * http_server_process ( void * ptr)
Here is the caller graph for this function:

◆ http_server_wait_process()

void * http_server_wait_process ( void * ptr)
Here is the caller graph for this function:

◆ http_sleep()

EXPORT void http_sleep ( )
Here is the caller graph for this function:

◆ http_to_https()

std::string http_to_https ( std::string url)
Here is the caller graph for this function:

◆ join_http()

EXPORT void join_http ( )

◆ remove_prefix()

IMPORT std::string remove_prefix ( std::string url)
Here is the caller graph for this function:

◆ remove_quotes()

std::string remove_quotes ( std::string str)
Here is the caller graph for this function:

◆ remove_str_after_char()

std::string remove_str_after_char ( std::string s,
char ch )
Here is the caller graph for this function:

◆ replace_deploy_url()

std::string replace_deploy_url ( std::string home)
Here is the caller graph for this function:

◆ replace_str()

IMPORT std::string replace_str ( std::string val,
std::string repl,
std::string subst )
Here is the caller graph for this function:

◆ replace_urls_from_script()

EXPORT std::string replace_urls_from_script ( std::string script,
const HttpDeployResult & data )
Here is the caller graph for this function:

◆ send_http_server_shutdown()

EXPORT void send_http_server_shutdown ( )

◆ send_post_request()

IMPORT void send_post_request ( std::string url,
std::string headers,
std::string data )
Here is the caller graph for this function:

◆ set_cors_headers()

void set_cors_headers ( httplib::Response & res)
Here is the caller graph for this function:

◆ set_http_server_htmlfile()

void set_http_server_htmlfile ( std::string file)

◆ start_http_listening()

EXPORT void start_http_listening ( std::vector< std::string > filenames,
std::vector< std::string > contents,
std::string homepage,
std::string script,
std::string date,
bool transparent )
Here is the caller graph for this function:

◆ start_server_shutdown()

EXPORT void start_server_shutdown ( )
Here is the caller graph for this function:

◆ take_prefix()

std::string take_prefix ( std::string cd,
std::string path )
Here is the caller graph for this function:

Variable Documentation

◆ g_http_htmlfile

std::string g_http_htmlfile

◆ g_http_server

httplib::Server * g_http_server = 0

◆ g_http_server_ip

EXPORT std::string g_http_server_ip = "127.0.0.1"

◆ g_http_server_port

EXPORT int g_http_server_port =50200

◆ g_http_up_and_running

bool g_http_up_and_running =false

◆ g_mod_path

std::string g_mod_path
extern

◆ g_wait_ongoing

bool g_wait_ongoing = true

◆ gameapi_temp_dir

IMPORT GameApi::PAT gameapi_temp_dir
extern