lloader.h Header
Functions
| LStringList | expand(const LName & name) |
| std::vector<LStringList> | expand_traversal(const std::vector<LName> & traversal) |
| std::vector<LTarget> | expand_declaration(const LDeclaration & declaration) |
| LVariant | to_variant(const LValue & value) |
Function Documentation
LStringList expand(const LName & name)
Converts a name into a string list of expanded names where name expandables
combine as a cross-product with the rest of the name's expandables.
(See LName and LExpandable)
Picture // { "Picture" }
Before Picture // { "Before Picture" }
(Before,After) // { "Before", "After" }
(Before,After) Picture // { "Before Picture", "After Picture" }
(First,Second) (Before,After) Picture // { "First Before Picture",
// "First After Picture",
// "Second Before Picture",
// "Second After Picture" }
Empty strings are filtered out from the result.
(,Max) // { "Max" }
(,Max) (,Health) // { "Health", "Max", "Max Health" }
std::vector<LStringList> expand_traversal(const std::vector<LName> & traversal)
Converts the names of a traversal (names preceding forward-slashes in a declaration) into their expanded forms.
An empty traversal returns one empty path targeting the scope itself.
<no traversal> // { {} }
Dialog/ // { {"Dialog"} }
(Create,Edit) Dialog/ // { {"Create Dialog"} , {"Edit Dialog"} }
(Create,Edit) Dialog/Titlebar/
// { {"Create Dialog","Titlebar"}, {"Edit Dialog","Titlebar"} }
(Create,Edit) Dialog/(Titlebar,Content)/
// { {"Create Dialog","Titlebar"}, {"Create Dialog","Content"},
// {"Edit Dialog","Titlebar"}, {"Edit Dialog","Content"} }
std::vector<LTarget> expand_declaration(const LDeclaration & declaration)
Converts a declaration into a list of targets where declaration names are
expanded at all levels (traversal, group, item) and individual declaration
targets are identified. (See LTarget)
Declarations without any expansions produce single targets.
Title // 1 target; { {}, "Title" }
Field.Title // 1 target; { {}, "Field.Title" }
Dialog/Form/Field.Title // 1 target; { {"Dialog","Form"}, "Field.Title" }
(Title,Description) // 2 targets; { {}, "Title" }, { {}, "Description" }
(Label,Field).Title // 2 targets;
// { {}, "Label.Title" },
// { {}, "Field.Title" }
(Create,Edit) Dialog/Form/Field.Title
// 2 targets;
// { {"Create Dialog","Form"}, "Field.Title" },
// { {"Edit Dialog","Form"}, "Field.Title" }
(Create,Edit) Dialog/Form/Field.(Title,Description)
// 4 targets;
// { {"Create Dialog","Form"}, "Field.Title" },
// { {"Create Dialog","Form"}, "Field.Description" },
// { {"Edit Dialog","Form"}, "Field.Title" },
// { {"Edit Dialog","Form"}, "Field.Description" }