Package ghidra.program.model.symbol
Interface Namespace
-
- All Known Subinterfaces:
Function
,GhidraClass
,Library
,ThunkFunction
- All Known Implementing Classes:
FunctionDB
,GlobalNamespace
,UndefinedFunction
public interface Namespace
The Namespace interface.
-
-
Field Summary
Fields Modifier and Type Field Description static long
GLOBAL_NAMESPACE_ID
static java.lang.String
NAMESPACE_DELIMITER
The delimiter that is used to separate namespace nodes in a namespace string.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description AddressSetView
getBody()
Get the address set for this namespace.long
getID()
Return the namespace id;java.lang.String
getName()
Get the name of the symbol for this scope.java.lang.String
getName(boolean includeNamespacePath)
Returns the fully qualified name.Namespace
getParentNamespace()
Get the parent scope.Symbol
getSymbol()
Get the symbol for this namespace; Note: The global namespace will return nullboolean
isExternal()
default boolean
isGlobal()
Return true if this is the global namespace;void
setParentNamespace(Namespace parentNamespace)
Set the parent namespace for this namespace.
-
-
-
Field Detail
-
GLOBAL_NAMESPACE_ID
static final long GLOBAL_NAMESPACE_ID
- See Also:
- Constant Field Values
-
NAMESPACE_DELIMITER
static final java.lang.String NAMESPACE_DELIMITER
The delimiter that is used to separate namespace nodes in a namespace string. For example, "Global::child1::symbolName"- See Also:
- Constant Field Values
-
-
Method Detail
-
getSymbol
Symbol getSymbol()
Get the symbol for this namespace; Note: The global namespace will return null
-
isExternal
boolean isExternal()
- Returns:
- true if this namespace is external (i.e., associated with a Library)
-
getName
java.lang.String getName()
Get the name of the symbol for this scope.
-
getName
java.lang.String getName(boolean includeNamespacePath)
Returns the fully qualified name.
-
getID
long getID()
Return 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.
-
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 descendent of this namespace.
-
isGlobal
default boolean isGlobal()
Return true if this is the global namespace;- Returns:
- true if this is the global namespace;
-
-