Resources.hpp

This File On Github
Ask A Question

API: latest
module: oatpp-swagger
#include "oatpp-swagger/Resources.hpp"

Resources

This class is responsible for loading Swagger-UI resources.

namespace oatpp { namespace swagger { 
  class Resources {}
}}

Methods

Return Type Name Summary
[none] Resources Constructor.
std::shared_ptr<Resources> loadResources Load and cache Swagger-UI resources.
std::shared_ptr<Resources> streamResources Stream Swagger-UI resources directly from disk.
oatpp::String getResource Get cached resource by filename.
std::shared_ptr<ReadCallback> getResourceStream Get streamed resource by filename.
bool isStreaming Returns true if this is a streaming ressource instance.

Resources::Resources

Constructor.

  • @param resDir - directory containing swagger-ui resources.

Resources(const oatpp::String& resDir, bool streaming = false)

Resources::loadResources

Load and cache Swagger-UI resources.

  • @param resDir - directory containing swagger-ui resources.
  • @return - std::shared_ptr to Resources.

static std::shared_ptr<Resources> loadResources(const oatpp::String& resDir)

Resources::streamResources

Stream Swagger-UI resources directly from disk.

  • @param resDir - directory containing swagger-ui resources.
  • @return - std::shared_ptr to Resources.

static std::shared_ptr<Resources> streamResources(const oatpp::String& resDir)

Resources::getResource

Get cached resource by filename.

  • @param filename - name of the resource file.
  • @return - oatpp::String containing resource binary data.

oatpp::String getResource(const oatpp::String& filename)

Resources::getResourceStream

Get streamed resource by filename.

std::shared_ptr<ReadCallback> getResourceStream(const oatpp::String& filename)

Resources::isStreaming

Returns true if this is a streaming ressource instance.

  • @return

bool isStreaming()