A lightweight object that encapsulates all different sources for a pool with a hash code and a relative path system. More...
Public Types | |
enum | Mode { Invalid = 0, AbsolutePath, ExpansionPath, ProjectPath, EmbeddedResource, LinkToEmbeddedResource } |
The data sources for the Reference. More... | |
Public Member Functions | |
InputStream * | createInputStream () const |
This creates an input stream for the reference. More... | |
File | getFile () const |
If this is a file based reference, it will return the file. More... | |
ProjectHandler::SubDirectories | getFileType () const |
Returns the data type. More... | |
int64 | getHashCode () const |
Upon creation it creates a hash code that will be used by the pool to identify and return already cached data. | |
Identifier | getId () const |
Returns the Identifier as used by the pool. More... | |
Mode | getMode () const |
Returns the type of the reference. More... | |
String | getReferenceString () const |
Returns the String that was passed in the constructor. More... | |
operator bool () const | |
This can be used to type shorter conditions. More... | |
Reference () | |
Creates a Invalid reference. More... | |
Reference (const MainController *mc, const String &referenceStringOrFile, ProjectHandler::SubDirectories directoryType) | |
Creates a reference using the given string. More... | |
Reference (const var &dragDescription) | |
Creates a reference from a drag description. More... | |
Reference (PoolBase *pool, const String &embeddedReference, ProjectHandler::SubDirectories directoryType) | |
Creates a reference from an embedded resource. More... | |
A lightweight object that encapsulates all different sources for a pool with a hash code and a relative path system.
Whenever you need to access external / embedded resources, this class is used to resolve the path / ID to fetch the data.
Normally, you create one of these just with a String and it will figure out automatically whether it's a absolute path, a path relative to the project folder or an embedded resource.
enum Mode |
The data sources for the Reference.
Reference | ( | ) |
Creates a Invalid reference.
Reference | ( | const MainController * | mc, |
const String & | referenceStringOrFile, | ||
ProjectHandler::SubDirectories | directoryType | ||
) |
Creates a reference using the given string.
Reference | ( | const var & | dragDescription | ) |
Creates a reference from a drag description.
Reference | ( | PoolBase * | pool, |
const String & | embeddedReference, | ||
ProjectHandler::SubDirectories | directoryType | ||
) |
Creates a reference from an embedded resource.
juce::InputStream * createInputStream | ( | ) | const |
This creates an input stream for the reference.
If it's file based, it will be a FileInputStream, and for embedded references you'll get a MemoryInputStream.
juce::File getFile | ( | ) | const |
If this is a file based reference, it will return the file.
hise::ProjectHandler::SubDirectories getFileType | ( | ) | const |
Returns the data type.
A Reference has the data type baked in it (because you hardly want to load images into a convolution reverb).
juce::Identifier getId | ( | ) | const |
Returns the Identifier as used by the pool.
|
inline |
Returns the type of the reference.
juce::String getReferenceString | ( | ) | const |
Returns the String that was passed in the constructor.
|
inlineexplicit |
This can be used to type shorter conditions.