Package ghidra.program.model.symbol
Interface Namespace
- All Known Subinterfaces:
Function,GhidraClass,Library,ThunkFunction,TraceClassSymbol,TraceNamespaceSymbol
- All Known Implementing Classes:
DBTraceClassSymbol,DBTraceNamespaceSymbol,FunctionDB,GlobalNamespace,UndefinedFunction
public interface Namespace
The Namespace interface
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
ChangeModifier and TypeMethodDescriptiongetBody()Get the address set for this namespace.longgetID()Return the namespace idgetName()Returns the simple namespace name (without parent path).getName(boolean includeNamespacePath) Returns the namespace name, optionally prepended with the full parent namespace path.Get the parent scope.getPathList(boolean omitLibrary) Get the namespace path as a list of namespace names.Get the symbol for this namespace.default Namespace.TypegetType()Returns the type of namespace, e.g., Library, Class, Namespace, Function.booleanReturns true if this namespace is external (i.e., associated with a Library)default booleanisGlobal()Return true if this is the global namespacedefault booleanReturn true if this is a libraryvoidsetParentNamespace(Namespace parentNamespace) Set the parent namespace for this namespace.
-
Field Details
-
Method Details
-
getSymbol
Symbol getSymbol()Get the symbol for this namespace.- Returns:
- the symbol for this namespace.
-
getType
Returns the type of namespace, e.g., Library, Class, Namespace, Function.- Returns:
- the type of namespace, e.g., Library, Class, Namespace, Function
-
isExternal
boolean isExternal()Returns true if this namespace is external (i.e., associated with a Library)- Returns:
- true if this namespace is external (i.e., associated with a Library)
-
getName
String getName()Returns the simple namespace name (without parent path).See
getName(boolean)for the namespace-qualified variant.- Returns:
- the simple namespace name (without parent path)
-
getName
Returns the namespace name, optionally prepended with the full parent namespace path.- Parameters:
includeNamespacePath- true to include the namespace path (usingDELIMITERas separator) in the returned name- Returns:
- the simple name if
includeNamespacePathis false, or the full namespace-qualified name (e.g.,"ClassA::InnerClass") if true
-
getPathList
Get the namespace path as a list of namespace names.- Parameters:
omitLibrary- if true Library name (if applicable) will be omitted from returned list and treated same as global namespace.- Returns:
- namespace path list or empty list for global namespace
-
getID
long getID()Return the namespace id- Returns:
- the namespace id
-
getParentNamespace
Namespace getParentNamespace()Get the parent scope.- Returns:
- null if this scope is the global scope.
-
getBody
AddressSetView getBody()Get the address set for this namespace. Note: The body of a namespace (currently only used by the function namespace) is restricted it Integer.MAX_VALUE.- Returns:
- the address set for this namespace
-
setParentNamespace
void setParentNamespace(Namespace parentNamespace) throws DuplicateNameException, InvalidInputException, CircularDependencyException Set the parent namespace for this namespace. Restrictions may apply.- Parameters:
parentNamespace- the namespace to use as this namespace's parent.- Throws:
InvalidInputException- if the parent namespace is not applicable for this namespace.DuplicateNameException- if another symbol exists in the parent namespace with the same name as this namespaceCircularDependencyException- if the parent namespace is a descendant of this namespace.
-
isGlobal
default boolean isGlobal()Return true if this is the global namespace- Returns:
- true if this is the global namespace
-
isLibrary
default boolean isLibrary()Return true if this is a library- Returns:
- true if this is a library
-
DELIMITER