Poco::CppParser

class Parameter

Library: CppParser
Package: SymbolTable
Header: Poco/CppParser/Parameter.h

Description

This class represents a parameter to a function.

Inheritance

Direct Base Classes: Decl

All Base Classes: Decl, Symbol

Member Summary

Member Functions: declType, defaultDecl, defaultValue, hasDefaultValue, isConst, isPointer, isReference, kind, vectorType

Inherited Functions: addDocumentation, attrs, declaration, extractName, fullName, getAccess, getAttributes, getDocumentation, getFile, getLibrary, getLineNumber, getPackage, hasAttr, id, isIdent, isPrivate, isProtected, isPublic, kind, name, nameSpace, setAccess, setAttributes, setDocumentation, setFile, setLibrary, setLineNumber, setPackage, toString

Constructors

Parameter

Parameter(
    const std::string & decl,
    Function * pFunction
);

Creates the Parameter.

Destructor

~Parameter virtual

~Parameter();

Destroys the Parameter.

Member Functions

declType inline

const std::string & declType() const;

Returns the type of the parameter without const and & if present.

Example: a type const std::string& -> std::string, a type const std::string* returns std::string

defaultDecl inline

const std::string & defaultDecl() const;

If hasDefaultValue() returns true, this method returns the default value declaration.

Example: for const std::string& data = std::string("default") it will return std::string("default").

defaultValue inline

const std::string & defaultValue() const;

If hasDefaultValue() returns true, this method returns the default value, i.e. all data found between the opening and closing bracket of the init string.

Example: for const std::string& data = std::string("default") it will return "default", for = std::string() it will return a zero length string, for = ComplexClass(13,12, "test", 0); it will return 13,12, "test", 0.

hasDefaultValue inline

bool hasDefaultValue() const;

Returns true if a defaultvalue was set at this parameter, Example: const std::string& data = std::string("default").

isConst inline

bool isConst() const;

Returns true if and only if the parameter is const.

isPointer inline

bool isPointer() const;

Returns true if and only if the parameter is a pointer.

isReference inline

bool isReference() const;

Returns true if and only if the parameter is a reference.

kind

Symbol::Kind kind() const;

vectorType static

static bool vectorType(
    const std::string & type,
    NameSpace * pNS
);

Securely control IoT edge devices from anywhere   Connect a Device