MostlyHarmless 0.0.1
 
Loading...
Searching...
No Matches
mostly_harmless::gui::WebviewBase::Resource Struct Reference

Tiny container struct for web resources. More...

#include <mostlyharmless_WebviewBase.h>

Public Member Functions

 Resource ()=default
 
 Resource (std::string_view content, std::string mimeType_)
 

Public Attributes

std::vector< std::uint8_t > data
 
std::string mimeType
 

Detailed Description

Tiny container struct for web resources.

If serving from RAM, your editor should hold an internal map of route:Resource, populated in your constructor.
MIME types can be retrieved with mostly_harmless::gui::getMimeType().

Constructor & Destructor Documentation

◆ Resource() [1/2]

mostly_harmless::gui::WebviewBase::Resource::Resource ( )
default

◆ Resource() [2/2]

mostly_harmless::gui::WebviewBase::Resource::Resource ( std::string_view content,
std::string mimeType_ )

Constructs a Resource from a char[] and a mime type.

Parameters
contentA char[] containing the data for this resource.
mimeType_The associated MIME type for this resource.

Member Data Documentation

◆ data

std::vector<std::uint8_t> mostly_harmless::gui::WebviewBase::Resource::data

The binary data for this resource.

◆ mimeType

std::string mostly_harmless::gui::WebviewBase::Resource::mimeType

The associated MIME type for this resource.


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