![]() |
Tesseract 0.28.4
|
Represents resource data available from a file or url. More...
#include <resource_locator.h>

Public Types | |
| using | Ptr = std::shared_ptr<Resource> |
| using | ConstPtr = std::shared_ptr<const Resource> |
| Public Types inherited from tesseract::common::ResourceLocator | |
| using | Ptr = std::shared_ptr<ResourceLocator> |
| using | ConstPtr = std::shared_ptr<const ResourceLocator> |
Public Member Functions | |
| virtual bool | isFile () const =0 |
| Returns true if the located resource is a local file. | |
| virtual std::string | getUrl () const =0 |
| Get the original URL used to locate the file. | |
| virtual std::string | getFilePath () const =0 |
| Get the file path of the resource. Only valid if isFile() is true. | |
| virtual std::vector< uint8_t > | getResourceContents () const =0 |
| Get the resource as bytes. This function may block. | |
| virtual std::shared_ptr< std::istream > | getResourceContentStream () const =0 |
| Get the resource as a std::istream. This function and the returned stream may block. | |
| bool | operator== (const Resource &rhs) const |
| bool | operator!= (const Resource &rhs) const |
| Public Member Functions inherited from tesseract::common::ResourceLocator | |
| virtual std::shared_ptr< Resource > | locateResource (const std::string &url) const =0 |
| Locate a resource based on a URL. | |
| bool | operator== (const ResourceLocator &rhs) const |
| bool | operator!= (const ResourceLocator &rhs) const |
Friends | |
| template<class Archive> | |
| friend | void::tesseract::common::serialize (Archive &ar, Resource &obj) |
Represents resource data available from a file or url.
|
pure virtual |
Returns true if the located resource is a local file.
Implemented in tesseract::common::BytesResource, and tesseract::common::SimpleLocatedResource.
|
pure virtual |
Get the original URL used to locate the file.
Implemented in tesseract::common::BytesResource, and tesseract::common::SimpleLocatedResource.
|
pure virtual |
Get the file path of the resource. Only valid if isFile() is true.
Implemented in tesseract::common::BytesResource, and tesseract::common::SimpleLocatedResource.
|
pure virtual |
Get the resource as bytes. This function may block.
Implemented in tesseract::common::BytesResource, and tesseract::common::SimpleLocatedResource.
|
pure virtual |
Get the resource as a std::istream. This function and the returned stream may block.
Implemented in tesseract::common::BytesResource, and tesseract::common::SimpleLocatedResource.