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.String
GLOBAL_NAMESPACE_NAME
Global 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 boolean
equals(java.lang.Object obj)
AddressSetView
getBody()
Get the address set for this namespace.long
getID()
Return the namespace idjava.lang.String
getName()
Get the name of the symbol for this scopejava.lang.String
getName(boolean includeNamespacePath)
Returns the fully qualified nameNamespace
getParentNamespace()
Get the parent scope.Symbol
getSymbol()
Get the symbol for this namespace; Note: The global namespace will return nullboolean
isExternal()
Returns true if this namespace is external (i.e., associated with a Library)void
setParentNamespace(Namespace parentNamespace)
Set the parent namespace for this namespace.java.lang.String
toString()
-
-
-
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:Namespace
Get the symbol for this namespace; Note: The global namespace will return null- Specified by:
getSymbol
in 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:Namespace
Get the name of the symbol for this scope- Specified by:
getName
in interfaceNamespace
- Returns:
- the name of the symbol for this scope
- See Also:
Namespace.getName()
-
getID
public long getID()
Description copied from interface:Namespace
Return the namespace id- Specified by:
getID
in interfaceNamespace
- Returns:
- the namespace id
- See Also:
Namespace.getID()
-
getParentNamespace
public Namespace getParentNamespace()
Description copied from interface:Namespace
Get the parent scope.- Specified by:
getParentNamespace
in interfaceNamespace
- Returns:
- null if this scope is the global scope.
- See Also:
Namespace.getParentNamespace()
-
getBody
public AddressSetView getBody()
Description copied from interface:Namespace
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.- Specified by:
getBody
in interfaceNamespace
- Returns:
- the address set for this namespace
- See Also:
Namespace.getBody()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
- See Also:
Object.toString()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
- See Also:
Object.equals(java.lang.Object)
-
getName
public java.lang.String getName(boolean includeNamespacePath)
Description copied from interface:Namespace
Returns the fully qualified name- Specified by:
getName
in 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:Namespace
Set the parent namespace for this namespace. Restrictions may apply.- Specified by:
setParentNamespace
in 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:Namespace
Returns true if this namespace is external (i.e., associated with a Library)- Specified by:
isExternal
in interfaceNamespace
- Returns:
- true if this namespace is external (i.e., associated with a Library)
-
-