Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
Loading...
Searching...
No Matches
IMAGE_FILES::CImageFileURL Class Reference

A mostly-typed representation of a URL to any image, whether a simple path to an image file, embedded in another file, or generated in some way. More...

#include <ImageFileURL.h>

Public Member Functions

 CImageFileURL (const std::string &imageFileURL)
 Create an ImageFileURL from a string representation.
 
void AddOption (std::string key, std::string value)
 
std::string GetOption (const std::string &key) const
 
std::string ToString () const
 Build a complete string representation of this ImageFileURL.
 
std::string ToCacheKey () const
 Build a cache key for this ImageFileURL.
 
const std::string & GetTargetFile () const
 
bool IsSpecialImage () const
 
const std::string & GetSpecialType () const
 

Static Public Member Functions

static CImageFileURL FromFile (const std::string &filePath, std::string specialType="")
 Create an ImageFileURL pointing to a specific file.
 

Public Attributes

bool flipped {false}
 

Detailed Description

A mostly-typed representation of a URL to any image, whether a simple path to an image file, embedded in another file, or generated in some way.

A URL string is good to pass between most classes, store, and transmit, but use this if you need to create or modify a special image path, or are working on the details of such image files.

URL string format is image://[type@]<url_encoded_path>?options

Constructor & Destructor Documentation

◆ CImageFileURL()

IMAGE_FILES::CImageFileURL::CImageFileURL ( const std::string & imageFileURL)

Create an ImageFileURL from a string representation.

Member Function Documentation

◆ AddOption()

void IMAGE_FILES::CImageFileURL::AddOption ( std::string key,
std::string value )

◆ FromFile()

CImageFileURL IMAGE_FILES::CImageFileURL::FromFile ( const std::string & filePath,
std::string specialType = "" )
static

Create an ImageFileURL pointing to a specific file.

Provide a 'specialType' parameter to specify a special image loader.

Parameters
specialTypeset a special image type - an implementation of ISpecialImageFileLoader

◆ GetOption()

std::string IMAGE_FILES::CImageFileURL::GetOption ( const std::string & key) const

◆ GetSpecialType()

const std::string & IMAGE_FILES::CImageFileURL::GetSpecialType ( ) const
inline

◆ GetTargetFile()

const std::string & IMAGE_FILES::CImageFileURL::GetTargetFile ( ) const
inline

◆ IsSpecialImage()

bool IMAGE_FILES::CImageFileURL::IsSpecialImage ( ) const
inline

◆ ToCacheKey()

std::string IMAGE_FILES::CImageFileURL::ToCacheKey ( ) const

Build a cache key for this ImageFileURL.

Return base filePath if not special and multiple options are in a stable order, otherwise return a complete string representation.

◆ ToString()

std::string IMAGE_FILES::CImageFileURL::ToString ( ) const

Build a complete string representation of this ImageFileURL.

Member Data Documentation

◆ flipped

bool IMAGE_FILES::CImageFileURL::flipped {false}

The documentation for this class was generated from the following files: