CxxUtils::ClassName::Rules Class Reference

A set of transformation rules to use with ClassName. More...

#include <ClassName.h>

List of all members.

Public Member Functions

size_t size () const
 Return the number of defined rules.
void add (const ClassName &pattern, const ClassName &replacement)
 Add a new transformation rule.
bool applyTo (ClassName &cn) const
 Apply the set of transformation rules to a class name object.
std::string apply (const std::string &name) const
 Apply transformations to a class name.

Detailed Description

A set of transformation rules to use with ClassName.


Member Function Documentation

void CxxUtils::ClassName::Rules::add ( const ClassName pattern,
const ClassName replacement 
)

Add a new transformation rule.

Parameters:
pattern The pattern to match.
replacement The expression with which to replace it.

The pattern may contain variables that are then substituted into the replacement; for example, given a pattern of `A<$T, $T>` and a replacement of `B< $t>="">`, then `A<Foo<int>, Foo<int> >` would be transformed to `B<Foo<int> >'.

std::string CxxUtils::ClassName::Rules::apply ( const std::string &  name  )  const

Apply transformations to a class name.

Parameters:
name The class name to transform.

Returns the transformed class name.

This is just shorthand for calling `ClassNameapplyRules`.

bool CxxUtils::ClassName::Rules::applyTo ( ClassName cn  )  const

Apply the set of transformation rules to a class name object.

Parameters:
cn The object to which the rules should be applied. Will be modified in place.

All transformation rules are matched against cn. If any match, the object is replaced with the replacement portion of the rule with match results substituted.

Returns true if any matches were made and false otherwise.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated on 1 Dec 2017 for RootCore Packages by  doxygen 1.6.1