File Information
Library: CppParser
Package: SymbolTable
Header: Poco/CppParser/Symbol.h
Description
This is the base class for all symbols in the symbol table.
Every symbol has a unique ID (int) and a namespace (which may be null).
Inheritance
Known Derived Classes: Parameter, NameSpace, TypeDef, TypeAlias, Enum, Decl, Struct, BuiltIn, EnumValue, Function, Variable
Member Summary
Member Functions: addDocumentation, attrs, extractName, fullName, getAccess, getAttributeList, getAttributes, getDocumentation, getFile, getLibrary, getLineNumber, getOrder, getPackage, hasAttr, id, isIdent, isPrivate, isProtected, isPublic, kind, name, nameSpace, setAccess, setAttributeList, setAttributes, setDocumentation, setFile, setLibrary, setLineNumber, setOrder, setPackage, toString
Enumerations
Access
public access
protected access
private access
Kind
An enumeration
An enumeration value
A (member) function
A namespace
A function parameter
A struct or class
A typedef
A type alias (using)
A built-in type
A (member) variable
Constructors
Symbol
Symbol();
Creates the Symbol and assigns the symbol a unique ID.
Symbol
Symbol(
const std::string & name,
NameSpace * pNameSpace = 0
);
Creates the Symbol and assigns the symbol a unique ID.
Destructor
~Symbol
virtual ~Symbol();
Destroys the Symbol.
Member Functions
addDocumentation
void addDocumentation(
const std::string & text
);
Adds text to the symbol's documentation.
attrs
const Attributes & attrs() const;
Returns the symbol's attributes.
attrs
Attributes & attrs();
Returns the symbol's attributes.
extractName
static std::string extractName(
const std::string & decl
);
Extracts the name from the declaration.
fullName
std::string fullName() const;
Returns the symbol's fully qualified name.
getAccess
Access getAccess() const;
Returns the symbol's access.
getAttributeList
const std::string & getAttributeList() const;
Returns the C++11 attribute list, or an empty string if the symbol does not have one.
getAttributes
const Attributes & getAttributes() const;
Returns the symbol's attributes.
getDocumentation
const std::string & getDocumentation() const;
Returns the symbol's documentation.
getFile
const std::string & getFile() const;
Returns the file where the symbol is defined.
getLibrary
const std::string & getLibrary() const;
Returns the symbol's library.
getLineNumber
int getLineNumber() const;
Returns the line number of the symbol's declaration.
getOrder
std::size_t getOrder() const;
Returns the order of the symbol within its container.
getPackage
const std::string & getPackage() const;
Returns the symbol's package.
id
int id() const;
Returns the symbol's unique ID.
isPrivate
bool isPrivate() const;
Returns true iff the symbol is public.
isProtected
bool isProtected() const;
Returns true iff the symbol is public.
isPublic
bool isPublic() const;
Returns true iff the symbol is public.
kind
virtual Kind kind() const = 0;
Returns the symbol's kind.
name
const std::string & name() const;
Returns the symbol's (local) name.
nameSpace
NameSpace * nameSpace() const;
Returns the symbol's namespace which may be null.
setAccess
void setAccess(
Access v
);
Sets the symbol's access.
setAttributeList
void setAttributeList(
const std::string & attrs
);
setAttributes
void setAttributes(
const Attributes & attrs
);
Sets the symbol's attributes.
setDocumentation
void setDocumentation(
const std::string & text
);
Sets the symbol's documentation.
setFile
void setFile(
const std::string & path
);
Sets the file where the symbol is declared.
setLibrary
void setLibrary(
const std::string & library
);
Sets the symbol's library.
setLineNumber
void setLineNumber(
int line
);
Sets the line number of the symbol's declaration.
setOrder
void setOrder(
std::size_t order
);
Sets the order of the symbol within its container.
Currently only used for struct/class members.
setPackage
void setPackage(
const std::string & package
);
Sets the symbol's package.
toString
virtual std::string toString() const = 0;
Returns a string representation of the symbol.
hasAttr
static bool hasAttr(
const std::string & decl,
const std::string & attr
);
isIdent
static bool isIdent(
char c
);