Poco::CppParser

class NameSpace

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 virtual

~NameSpace();

Destroys the NameSpace.

Member Functions

addSymbol

void addSymbol(
    Symbol * pSymbol
);

Adds a symbol to the namespace.

begin

Iterator begin() const;

Returns an iterator for iterating over the NameSpace's Symbol's.

classes

void classes(
    SymbolTable & table
) const;

Fills the symbol table with all classes and structs.

end

Iterator end() const;

Returns an iterator for iterating over the NameSpace's Symbol's.

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 inline

const NameSpaceVec & importedNameSpaces() const;

Returns a vector containing all imported namespaces.

importedSymbols inline

const AliasMap & importedSymbols() const;

Returns a const reference to a SymbolTable containing all imported symbols.

kind

Symbol::Kind kind() const;

lookup virtual

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

static NameSpace * root();

Returns the root namespace. Never delete this one!

toString virtual

std::string toString() const;

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 protected

void extract(
    Symbol::Kind kind,
    SymbolTable & table
) const;

splitName protected static

static void splitName(
    const std::string & name,
    std::string & head,
    std::string & tail
);