You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

36 lines
827 B

#ifndef WEBRESOURCE_H
#define WEBRESOURCE_H
#include <string>
#include <map>
#include "URL.h"
enum class ResourceType {
INVALID,
HTML,
CSS,
JS,
TXT
};
struct WebResource {
WebResource();
WebResource(ResourceType rtype, std::string const& rraw);
ResourceType resourceType;
std::string raw;
};
// Depending on the resourceName specified, this function will forward the call
// to either getLocalWebResource or getOnlineWebResource.
WebResource getWebResource(URL const& url);
WebResource postWebResource(URL const& url, std::unique_ptr<std::map<std::string, std::string>> formData);
// Loads a resource from the local file storage.
WebResource getLocalWebResource(URL const& url);
// Loads a resource from an internet address.
WebResource getOnlineWebResource(URL const& url);
#endif