ufe  4.2
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
PathString Namespace Reference

Detailed Description

Support for UFE string to path conversion.

This namespace provides translation from a parsable UFE path string to a UFE path object. A UFE path string has its segments separated by a path separator string. Converting a UFE path to a parsable UFE path string is also provided.

To determine each path segment's runtime ID, PathString assumes the first character of each path segment begins with a single-character path component separator, e.g. ".", or "/", or "|". Each runtime can register one (or more) path component separators it understands. If more than one runtime is associated with a path component separator, they will be asked in turn if the path segment corresponds to a valid object, using the Ufe::Hierarchy interface.

An application can change the path segment separator string. The default path separator string is the single character comma string, ",".

An application can add a path creation callback, to customize path creation from an input list of path segments. The default path creation function simply calls the Path constructor with the vector of path segments. The following example shows a custom path creation callback.

// Set a create path function that only outputs the first segment. This is
// of no practical use, but demonstrates the interface and intent.
auto fn = [](const Path::Segments& segments) { return Path(segments[0]); };

An application can add a single-segment path creation callback, to customize path creation from a single path segment, without any path segment separator. This can allow the application to support its native path string syntax as input to create a UFE path.

An application can add a string callback, to customize string output for path to string conversion. The default string function returns a string with each path segment separated by the path segment separator. The following example shows a custom string callback.

// Set a string function that returns the last path component as a string.
// This is of no practical use, but demonstrates the interface and intent.
auto fn = [](const Path& path) { return path.back().string(); };