|
TracktionEngine
|
A lightweight reference that can hold either a ProjectItemID or a file path. More...
#include <tracktion_ProjectItemRef.h>
Public Member Functions | |
| ProjectItemRef () noexcept=default | |
| ProjectItemRef (const juce::String &pathOrID) | |
| Creates a ref from a string that is either a ProjectItemID or a file path. | |
| ProjectItemRef (const juce::String &pathOrID, Project &owner) | |
| Creates a ref from a path string with a known owner project. | |
| ProjectItemRef (ProjectItemID) | |
| Creates a ref from an existing ProjectItemID. | |
| bool | isValid () const noexcept |
| bool | isProjectItemID () const noexcept |
| bool | isRelativePath () const noexcept |
| bool | isAbsolutePath () const noexcept |
| ProjectID | getProjectID () const noexcept |
| Returns the ID of the Project. | |
| std::optional< ProjectItemID > | getProjectItemID () const noexcept |
| Returns the ProjectItemID if this ref is ID-based, otherwise std::nullopt. | |
| juce::String | toIDForFilename () const noexcept |
| Returns a string which can be used for filenames. | |
| juce::String | toString () const noexcept |
| Returns the raw string value. | |
| juce::ReferenceCountedObjectPtr< Project > | getProject () const noexcept |
| Returns the owner project, if one was provided at construction. | |
| juce::File | resolve (Engine &, const juce::File &projectFolder={}) const |
| Resolves to a file. | |
| bool | operator== (const ProjectItemRef &) const |
| bool | operator!= (const ProjectItemRef &) const |
| bool | operator< (const ProjectItemRef &) const |
| bool | operator== (ProjectItemID) const |
| bool | operator!= (ProjectItemID) const |
Static Public Member Functions | |
| static ProjectItemRef | fromPath (const juce::String &relativePath) |
| Creates a ref from a relative path string. | |
| static ProjectItemRef | fromPath (const juce::String &relativePath, Project &owner) |
| Creates a ref from a relative path with a known owner project. | |
| static ProjectItemRef | fromAbsolutePath (const juce::File &) |
| Creates a ref from an absolute file. | |
A lightweight reference that can hold either a ProjectItemID or a file path.
The string value is auto-detected:
|
defaultnoexcept |
Referenced by fromAbsolutePath(), fromPath(), fromPath(), operator!=(), operator<(), operator==(), ProjectItemRef(), ProjectItemRef(), and ProjectItemRef().
|
explicit |
Creates a ref from a string that is either a ProjectItemID or a file path.
References ProjectItemRef().
| engine::ProjectItemRef::ProjectItemRef | ( | const juce::String & | pathOrID, |
| Project & | owner ) |
Creates a ref from a path string with a known owner project.
References ProjectItemRef().
| engine::ProjectItemRef::ProjectItemRef | ( | ProjectItemID | ) |
Creates a ref from an existing ProjectItemID.
References ProjectItemRef().
|
static |
Creates a ref from a relative path string.
References fromPath(), and ProjectItemRef().
Referenced by fromPath(), and fromPath().
|
static |
Creates a ref from a relative path with a known owner project.
References fromPath(), and ProjectItemRef().
|
static |
Creates a ref from an absolute file.
References fromAbsolutePath(), and ProjectItemRef().
Referenced by fromAbsolutePath().
|
noexcept |
|
noexcept |
References isProjectItemID().
Referenced by isProjectItemID().
|
noexcept |
References isRelativePath().
Referenced by isRelativePath().
|
noexcept |
References isAbsolutePath().
Referenced by isAbsolutePath().
|
noexcept |
Returns the ID of the Project.
References getProjectID().
Referenced by getProjectID().
|
noexcept |
Returns the ProjectItemID if this ref is ID-based, otherwise std::nullopt.
References getProjectItemID().
Referenced by getProjectItemID().
|
noexcept |
Returns a string which can be used for filenames.
This isn't meant for resolution, it will be the ProjectItemID or a hash of path.
References toIDForFilename().
Referenced by toIDForFilename().
|
noexcept |
|
noexcept |
Returns the owner project, if one was provided at construction.
References getProject().
Referenced by getProject().
| juce::File engine::ProjectItemRef::resolve | ( | Engine & | , |
| const juce::File & | projectFolder = {} ) const |
Resolves to a file.
References resolve().
Referenced by resolve().
| bool engine::ProjectItemRef::operator== | ( | const ProjectItemRef & | ) | const |
References ProjectItemRef().
| bool engine::ProjectItemRef::operator!= | ( | const ProjectItemRef & | ) | const |
References ProjectItemRef().
| bool engine::ProjectItemRef::operator< | ( | const ProjectItemRef & | ) | const |
References ProjectItemRef().
| bool engine::ProjectItemRef::operator== | ( | ProjectItemID | ) | const |
| bool engine::ProjectItemRef::operator!= | ( | ProjectItemID | ) | const |