File Information
Library: CppParser
Package: SymbolTable
Header: Poco/CppParser/NameSpace.h
Description
This class represents a namespace.
Inheritance
Direct Base Classes: Symbol
All Base Classes: Symbol
Known Derived Classes: Struct
Member Summary
Member Functions: addSymbol, begin, classes, end, enums, extract, functions, importNameSpace, importSymbol, importedNameSpaces, importedSymbols, kind, lookup, nameSpaces, root, splitName, toString, typeAliases, typeDefs, variables
Inherited 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
Types Aliases
AliasMap
using AliasMap = std::map < std::string, std::string >;
Iterator
using Iterator = SymbolTable::const_iterator;
NameSpaceVec
using NameSpaceVec = std::vector < std::string >;
SymbolTable
using SymbolTable = std::multimap < std::string, Symbol * >;
Constructors
NameSpace
NameSpace();
Creates the NameSpace.
NameSpace
NameSpace(
const std::string & name,
NameSpace * pNameSpace = 0
);
Creates the NameSpace.
Destructor
~NameSpace
~NameSpace();
Destroys the NameSpace.
Member Functions
addSymbol
void addSymbol(
Symbol * pSymbol
);
Adds a symbol to the namespace.
begin
Iterator begin() const;
classes
void classes(
SymbolTable & table
) const;
Fills the symbol table with all classes and structs.
end
Iterator end() const;
enums
void enums(
SymbolTable & table
) const;
Fills the symbol table with all enums.
functions
void functions(
SymbolTable & table
) const;
Fills the symbol table with all functions.
importNameSpace
void importNameSpace(
const std::string & nameSpace
);
Imports a namespace (using namespace <namespace>).
importSymbol
void importSymbol(
const std::string & fullName
);
Imports a symbol from another namespace (using <symbol>).
importedNameSpaces
const NameSpaceVec & importedNameSpaces() const;
Returns a vector containing all imported namespaces.
importedSymbols
const AliasMap & importedSymbols() const;
Returns a const reference to a SymbolTable containing all imported symbols.
kind
Symbol::Kind kind() const;
lookup
virtual Symbol * lookup(
const std::string & name
) const;
Looks up the given name in the symbol table and returns the corresponding symbol, or null if no symbol can be found. The name can include a namespace.
nameSpaces
void nameSpaces(
SymbolTable & table
) const;
Fills the symbol table with all namespaces.
root
static NameSpace * root();
Returns the root namespace. Never delete this one!
toString
std::string toString() const;
See also: Poco::CppParser::Symbol::toString()
typeAliases
void typeAliases(
SymbolTable & table
) const;
Fills the symbol table with all type alias (using) definitions.
typeDefs
void typeDefs(
SymbolTable & table
) const;
Fills the symbol table with all type definitions.
variables
void variables(
SymbolTable & table
) const;
Fills the symbol table with all variables.
extract
void extract(
Symbol::Kind kind,
SymbolTable & table
) const;
splitName
static void splitName(
const std::string & name,
std::string & head,
std::string & tail
);