22#include <juce_core/juce_core.h>
23#include <juce_data_structures/juce_data_structures.h>
53 static const inline juce::String
sep {
"/" };
54 static const inline juce::String ancestor {
"^" };
55 static const inline juce::String parent {
".." };
56 static const inline juce::String current {
"." };
58 Path (
const juce::String& pathString)
59 : pathSegments { parsePathSegments (pathString) }
85 juce::ValueTree
findValueTree (juce::ValueTree& origin,
SearchType searchType, juce::UndoManager* undo =
nullptr);
102 juce::StringArray parsePathSegments (
const juce::String& pathString);
104 const juce::StringArray pathSegments;
SearchType
Definition cello_path.h:64
@ query
only search, do not create anything.
Definition cello_path.h:65
@ createAll
create final tree and all intermediate trees needed to reach it.
Definition cello_path.h:67
@ createTarget
create final tree in specification, but no intermediate trees
Definition cello_path.h:66
SearchResult getSearchResult() const
Find out whether performing a search succeeded, and if so, needed to create a new tree.
Definition cello_path.h:93
juce::ValueTree findValueTree(juce::ValueTree &origin, SearchType searchType, juce::UndoManager *undo=nullptr)
Navigate the path from origin to a tree that is expected at the end of the current path specification...
Definition cello_path.cpp:59
SearchResult
Definition cello_path.h:71
@ created
performing a search created a new tree
Definition cello_path.h:74
@ notFound
unable to find the requested tree
Definition cello_path.h:72
@ found
the sought tree existed already and was found
Definition cello_path.h:73
static const juce::String sep
Path separator.
Definition cello_path.h:53