Lumiera  0.pre.03
»edit your freedom«
DataSource< MapS > Struct Template Reference

#include "lib/text-template.hpp"

Description

template<>
struct text_template::DataSource< MapS >

Data-binding for a Map-of-strings.

Simple keys are retrieved by direct lookup. For the representation of nested data sequences, the following conventions apply

  • the data sequence itself is represented by an index-key
  • the value associated to this index-key is a CSV sequence
  • each element in this sequence defines a key prefix
  • nested keys are then defined as <index-key>.<elm-key>.<key>
  • when key decoration is enabled for a nested data source, each lookup for a given key is first tried with the prefix, then as-is. Consequently, all data in the sequence must be present in the original map, stored under the decorated keys.
    Note
    multiply nested sequences are not supported. While it is possible to have nested loops, the resulting sets of keys must be disjoint and data must be present in the base map.
    See also
    TextTemplate_test::verify_Map_binding()

Definition at line 663 of file text-template.hpp.

Public Types

using Iter = decltype(iterNestedKeys("",""))
 
using Value = std::string_view
 

Public Member Functions

 DataSource (MapS const &map)
 
bool contains (string key)
 
Iter getSequence (string key)
 
bool isSubScope ()
 
DataSource openContext (Iter &iter)
 
Value retrieveContent (string key)
 

Public Attributes

MapS const * data_ {nullptr}
 
string keyPrefix_ {}
 
+ Inheritance diagram for DataSource< MapS >:
+ Collaboration diagram for DataSource< MapS >:

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