Gromacs  2024.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Member Functions
gmx::KeyValueTreeTransformRuleBuilder Class Reference

#include <gromacs/utility/include/gromacs/utility/keyvaluetreetransform.h>

Description

Provides methods to specify one transformation rule.

Classes

class  AfterFrom
 Properties that can be specified after from(). More...
 
class  ToObject
 Properties that can be specified after from().toObject(). More...
 
class  ToValue
 Properties that can be specified after from().to(). More...
 

Public Member Functions

 KeyValueTreeTransformRuleBuilder (internal::KeyValueTreeTransformerImpl *impl, const KeyValueTreePath &prefix)
 Internal constructor for creating a builder.
 
 KeyValueTreeTransformRuleBuilder (KeyValueTreeTransformRuleBuilder &&)=default
 Supports returning the builder from IKeyValueTreeTransformRules::addRule().
 
KeyValueTreeTransformRuleBuilderoperator= (KeyValueTreeTransformRuleBuilder &&)=default
 Supports returning the builder from IKeyValueTreeTransformRules::addRule().
 
template<typename FromType >
AfterFrom< FromType > from (const KeyValueTreePath &path)
 Specifies a rule that maps a value at given path. More...
 
void keyMatchType (const KeyValueTreePath &path, StringCompareType keyMatchType)
 Specifies how strings are matched when matching rules against a path. More...
 

Member Function Documentation

template<typename FromType >
AfterFrom<FromType> gmx::KeyValueTreeTransformRuleBuilder::from ( const KeyValueTreePath path)
inline

Specifies a rule that maps a value at given path.

Template Parameters
FromTypeType of value expected at path.
Parameters
[in]pathPath to map in this rule.

If the input tree has path, but it is not of type FromType, the transform will produce an error.

It is an error to use the same path in two from() rules. Similarly, it is an error to use a child path of a path used in a different from() rule.

void gmx::KeyValueTreeTransformRuleBuilder::keyMatchType ( const KeyValueTreePath path,
StringCompareType  keyMatchType 
)
inline

Specifies how strings are matched when matching rules against a path.

For properties of the object at path, keyMatchType is used for string comparison.

This rule must be specified first for a path, before any other from() rule specifies the path or a subpath. The rule only applies to immediate properties at the given path, not recursively. It is an error to specify the match type multiple times for a path.


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