TracktionEngine
Loading...
Searching...
No Matches
engine::SourceFileReference Class Reference

This class wraps a string that is generally held in a 'source' property, and which is a reference to some sort of file, either in the form of a local filename or as a project ID that can be resolved. More...

#include <tracktion_SourceFileReference.h>

Public Types

enum class  PathStyle { chooseBest , alwaysRelative , alwaysAbsolute }

Public Member Functions

 SourceFileReference (Edit &, juce::ValueTree &, const juce::Identifier &prop)
 ~SourceFileReference ()
juce::File getFile () const
bool isUsingProjectReference () const
ProjectItemRef getSourceProjectItemRef () const
ProjectItem::Ptr getSourceProjectItem () const
void setToFile (const juce::File &, PathStyle, bool allowProjectItems)
 Sets this source to reference the given file.
void setToProjectFileReference (ProjectItemRef)

Static Public Member Functions

static juce::String findPathFromFile (Edit &, const juce::File &, bool useRelativePath)
static juce::File findFileFromString (Edit &, const juce::String &source)

Public Attributes

Edit & edit
juce::CachedValue< juce::String > source

Detailed Description

This class wraps a string that is generally held in a 'source' property, and which is a reference to some sort of file, either in the form of a local filename or as a project ID that can be resolved.

Member Enumeration Documentation

◆ PathStyle

Enumerator
chooseBest 
alwaysRelative 
alwaysAbsolute 

Constructor & Destructor Documentation

◆ SourceFileReference()

engine::SourceFileReference::SourceFileReference ( Edit & ,
juce::ValueTree & ,
const juce::Identifier & prop )

Referenced by findFileFromString().

◆ ~SourceFileReference()

engine::SourceFileReference::~SourceFileReference ( )

Member Function Documentation

◆ getFile()

juce::File engine::SourceFileReference::getFile ( ) const

◆ isUsingProjectReference()

bool engine::SourceFileReference::isUsingProjectReference ( ) const

◆ getSourceProjectItemRef()

ProjectItemRef engine::SourceFileReference::getSourceProjectItemRef ( ) const

◆ getSourceProjectItem()

ProjectItem::Ptr engine::SourceFileReference::getSourceProjectItem ( ) const

◆ setToFile()

void engine::SourceFileReference::setToFile ( const juce::File & ,
PathStyle ,
bool allowProjectItems )

Sets this source to reference the given file.

If allowProjectItems is true and the edit is in a file-based project, finds or creates a ProjectItem. Otherwise stores a direct file path using the given PathStyle.

◆ setToProjectFileReference()

void engine::SourceFileReference::setToProjectFileReference ( ProjectItemRef )

◆ findPathFromFile()

juce::String engine::SourceFileReference::findPathFromFile ( Edit & ,
const juce::File & ,
bool useRelativePath )
static

◆ findFileFromString()

juce::File engine::SourceFileReference::findFileFromString ( Edit & ,
const juce::String & source )
static

References source, and SourceFileReference().

Member Data Documentation

◆ edit

Edit& engine::SourceFileReference::edit

◆ source

juce::CachedValue<juce::String> engine::SourceFileReference::source

Referenced by findFileFromString().


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