class CodeGenerator::SubstitutionsΒΆ

#include <substitutions.h>

class Substitutions
{
public:
    // methods

    Substitutions(const Substitutions* parent = nullptr);

    Substitutions(
        const std::vector<FunctionTemplate>& functions,
        const std::string& ftype
        );

    void addVarSubstitution(
        const std::string& source,
        const std::string& destionation,
        bool allowOverride = false
        );

    void addFuncSubstitution(
        const std::string& source,
        unsigned int numArguments,
        const std::string& funcTemplate,
        bool allowOverride = false
        );

    bool hasVarSubstitution(const std::string& source) const;
    const std::string& getVarSubstitution(const std::string& source) const;
    void apply(std::string& code) const;
    const std::string operator [] (const std::string& source) const;
};