Package ghidra.program.model.address
Class GlobalNamespace
- java.lang.Object
-
- ghidra.program.model.address.GlobalNamespace
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringGLOBAL_NAMESPACE_NAMEGlobal namespace name which may (incorrectly) appear as the first element within a namespace path (e.g.,Global::Foo::Bar).-
Fields inherited from interface ghidra.program.model.symbol.Namespace
DELIMITER, GLOBAL_NAMESPACE_ID, NAMESPACE_DELIMITER
-
-
Constructor Summary
Constructors Constructor Description GlobalNamespace(Memory memory)Constructs a new GlobalNamespace
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)AddressSetViewgetBody()Get the address set for this namespace.longgetID()Return the namespace idjava.lang.StringgetName()Get the name of the symbol for this scopejava.lang.StringgetName(boolean includeNamespacePath)Returns the fully qualified nameNamespacegetParentNamespace()Get the parent scope.SymbolgetSymbol()Get the symbol for this namespace; Note: The global namespace will return nullbooleanisExternal()Returns true if this namespace is external (i.e., associated with a Library)voidsetParentNamespace(Namespace parentNamespace)Set the parent namespace for this namespace.java.lang.StringtoString()
-
-
-
Field Detail
-
GLOBAL_NAMESPACE_NAME
public static final java.lang.String GLOBAL_NAMESPACE_NAME
Global namespace name which may (incorrectly) appear as the first element within a namespace path (e.g.,Global::Foo::Bar). It is preferred that the Global namespace be omitted in favor ofFoo::Bar.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GlobalNamespace
public GlobalNamespace(Memory memory)
Constructs a new GlobalNamespace- Parameters:
memory- the memory associated with this global namespace
-
-
Method Detail
-
getSymbol
public Symbol getSymbol()
Description copied from interface:NamespaceGet the symbol for this namespace; Note: The global namespace will return null- Specified by:
getSymbolin interfaceNamespace- Returns:
- the symbol for this namespace; Note: The global namespace will return null
- See Also:
Namespace.getSymbol()
-
getName
public java.lang.String getName()
Description copied from interface:NamespaceGet the name of the symbol for this scope- Specified by:
getNamein interfaceNamespace- Returns:
- the name of the symbol for this scope
- See Also:
Namespace.getName()
-
getID
public long getID()
Description copied from interface:NamespaceReturn the namespace id- Specified by:
getIDin interfaceNamespace- Returns:
- the namespace id
- See Also:
Namespace.getID()
-
getParentNamespace
public Namespace getParentNamespace()
Description copied from interface:NamespaceGet the parent scope.- Specified by:
getParentNamespacein interfaceNamespace- Returns:
- null if this scope is the global scope.
- See Also:
Namespace.getParentNamespace()
-
getBody
public AddressSetView getBody()
Description copied from interface:NamespaceGet 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.- Specified by:
getBodyin interfaceNamespace- Returns:
- the address set for this namespace
- See Also:
Namespace.getBody()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object- See Also:
Object.toString()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object- See Also:
Object.equals(java.lang.Object)
-
getName
public java.lang.String getName(boolean includeNamespacePath)
Description copied from interface:NamespaceReturns the fully qualified name- Specified by:
getNamein interfaceNamespace- Parameters:
includeNamespacePath- true to include the namespace in the returned name- Returns:
- the fully qualified name
- See Also:
Namespace.getName(boolean)
-
setParentNamespace
public void setParentNamespace(Namespace parentNamespace) throws DuplicateNameException, InvalidInputException
Description copied from interface:NamespaceSet the parent namespace for this namespace. Restrictions may apply.- Specified by:
setParentNamespacein interfaceNamespace- Parameters:
parentNamespace- the namespace to use as this namespace's parent.- Throws:
DuplicateNameException- if another symbol exists in the parent namespace with the same name as this namespaceInvalidInputException- if the parent namespace is not applicable for this namespace.- See Also:
Namespace.setParentNamespace(ghidra.program.model.symbol.Namespace)
-
isExternal
public boolean isExternal()
Description copied from interface:NamespaceReturns true if this namespace is external (i.e., associated with a Library)- Specified by:
isExternalin interfaceNamespace- Returns:
- true if this namespace is external (i.e., associated with a Library)
-
-