OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::http_headers Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/HttpServer.hpp>

Collaboration diagram for Slic3r::GUI::http_headers:

Public Member Functions

std::string get_url ()
int content_length ()
void on_read_header (std::string line)
void on_read_request_line (std::string line)

Private Attributes

std::string method
std::string url
std::string version
std::map< std::string, std::string > headers

Friends

class session

Detailed Description

Member Function Documentation

◆ content_length()

int Slic3r::GUI::http_headers::content_length ( )
inline
45 {
46 auto request = headers.find("content-length");
47 if (request != headers.end()) {
48 std::stringstream ssLength(request->second);
50 ssLength >> content_length;
51 return content_length;
52 }
53 return 0;
54 }
std::map< std::string, std::string > headers
Definition HttpServer.hpp:38
int content_length()
Definition HttpServer.hpp:44

References content_length(), and headers.

Referenced by content_length().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_url()

std::string Slic3r::GUI::http_headers::get_url ( )
inline
42{ return url; }
std::string url
Definition HttpServer.hpp:35

References url.

◆ on_read_header()

void Slic3r::GUI::http_headers::on_read_header ( std::string line)
inline
57 {
58 // std::cout << "header: " << line << std::endl;
59
60 std::stringstream ssHeader(line);
61 std::string headerName;
62 std::getline(ssHeader, headerName, ':');
63
64 std::string value;
65 std::getline(ssHeader, value);
66 headers[headerName] = value;
67 }

References headers.

◆ on_read_request_line()

void Slic3r::GUI::http_headers::on_read_request_line ( std::string line)
inline
70 {
71 std::stringstream ssRequestLine(line);
72 ssRequestLine >> method;
73 ssRequestLine >> url;
74 ssRequestLine >> version;
75
76 std::cout << "request for resource: " << url << std::endl;
77 }
std::string version
Definition HttpServer.hpp:36
std::string method
Definition HttpServer.hpp:34

References method, url, and version.

◆ session

friend class session
friend

References session.

Referenced by session.

Member Data Documentation

◆ headers

std::map<std::string, std::string> Slic3r::GUI::http_headers::headers
private

Referenced by content_length(), and on_read_header().

◆ method

std::string Slic3r::GUI::http_headers::method
private

Referenced by on_read_request_line().

◆ url

std::string Slic3r::GUI::http_headers::url
private

Referenced by get_url(), and on_read_request_line().

◆ version

std::string Slic3r::GUI::http_headers::version
private

Referenced by on_read_request_line().


The documentation for this class was generated from the following file:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/HttpServer.hpp