class EE::System::FunctionString

Overview

#include <functionstring.hpp>

class FunctionString {
public:
    // typedefs

    typedef SmallVector<std::string, 4> Parameters;
    typedef SmallVector<bool, 4> TypeStringVector;

    // classes

    class View;

    // construction

    FunctionString();
    FunctionString(const std::string& name, const Parameters& parameters, const TypeStringVector& typeStringData);
    FunctionString(const std::string& name, Parameters&& parameters, TypeStringVector&& typeStringData);

    // methods

    static View parseView(std::string_view function);

    template <typename Callback>
    static bool forEachParameter(std::string_view parameters, Callback&& callback);

    static FunctionString parse(const std::string& function);
    static FunctionString parse(std::string_view function);
    static FunctionString parse(String::View function);
    const std::string& getName() const;
    const Parameters& getParameters() const;
    bool parameterWasString(Uint32 index) const;
    bool isEmpty() const;
};

Detailed Documentation

Methods

template <typename Callback>
static bool forEachParameter(std::string_view parameters, Callback&& callback)

Iterates a comma-separated parameter list without allocating. Nested parentheses and quoted strings protect commas. Quoted parameters are reported without their outer quotes; escaped quotes remain escaped because the returned views reference the original input. The callback receives (parameter, parameterWasString) and returns whether to continue.