Package com.dylibso.chicory.wasm.types
Class NameCustomSection
- java.lang.Object
-
- com.dylibso.chicory.wasm.types.Section
-
- com.dylibso.chicory.wasm.types.CustomSection
-
- com.dylibso.chicory.wasm.types.NameCustomSection
-
public class NameCustomSection extends CustomSection
The "name" custom section.
-
-
Constructor Summary
Constructors Constructor Description NameCustomSection()Construct a new, empty section instance.NameCustomSection(byte[] bytes)Construct a new instance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringaddDataName(int dataIdx, String name)Add a data segment name to this section.StringaddElementName(int elementIdx, String name)Add an element name to this section.StringaddFunctionName(int functionIdx, String name)Add a function name to this section.StringaddGlobalName(int globalIdx, String name)Add a global name to this section.StringaddLabelName(int functionIdx, int labelIdx, String name)Add a label name to this section.StringaddLocalName(int functionIdx, int localIdx, String name)Add a local name to this section.StringaddMemoryName(int memoryIdx, String name)Add a memory name to this section.StringaddTableName(int tableIdx, String name)Add a table name to this section.StringaddTagName(int tagIdx, String name)Add a tag name to this section.intfunctionNameCount(){@return the number of function names in this section} This value does not have any relationship to the function index of any particular entry; it merely reflects the number of function names in this section.StringmoduleName(){@return the module name, ornullif none is set}Stringname()StringnameOfData(int dataIdx){@return the name of the data segment with the given index, ornullif none is set}StringnameOfElement(int elementIdx){@return the name of the element with the given index, ornullif none is set}StringnameOfFunction(int functionIdx){@return the name of the function with the given index, ornullif none is set}StringnameOfGlobal(int globalIdx){@return the name of the global with the given index, ornullif none is set}StringnameOfLabel(int functionIdx, int labelIdx){@return the name of the local with the given index within the function with the given index, ornullif none is set}StringnameOfLocal(int functionIdx, int localIdx){@return the name of the local with the given index within the function with the given index, ornullif none is set}StringnameOfMemory(int memoryIdx){@return the name of the memory with the given index, ornullif none is set}StringnameOfTable(int tableIdx){@return the name of the table with the given index, ornullif none is set}StringnameOfTag(int tagIdx){@return the name of the tag with the given index, ornullif none is set}StringsetModuleName(String moduleName)Set the module name.
-
-
-
Method Detail
-
name
public String name()
- Specified by:
namein classCustomSection
-
moduleName
public String moduleName()
{@return the module name, ornullif none is set}
-
nameOfFunction
public String nameOfFunction(int functionIdx)
{@return the name of the function with the given index, ornullif none is set}
-
functionNameCount
public int functionNameCount()
{@return the number of function names in this section} This value does not have any relationship to the function index of any particular entry; it merely reflects the number of function names in this section. Used for testing.
-
nameOfLocal
public String nameOfLocal(int functionIdx, int localIdx)
{@return the name of the local with the given index within the function with the given index, ornullif none is set}
-
nameOfLabel
public String nameOfLabel(int functionIdx, int labelIdx)
{@return the name of the local with the given index within the function with the given index, ornullif none is set}
-
nameOfTable
public String nameOfTable(int tableIdx)
{@return the name of the table with the given index, ornullif none is set}
-
nameOfMemory
public String nameOfMemory(int memoryIdx)
{@return the name of the memory with the given index, ornullif none is set}
-
nameOfGlobal
public String nameOfGlobal(int globalIdx)
{@return the name of the global with the given index, ornullif none is set}
-
nameOfElement
public String nameOfElement(int elementIdx)
{@return the name of the element with the given index, ornullif none is set}
-
nameOfData
public String nameOfData(int dataIdx)
{@return the name of the data segment with the given index, ornullif none is set}
-
nameOfTag
public String nameOfTag(int tagIdx)
{@return the name of the tag with the given index, ornullif none is set}
-
setModuleName
public String setModuleName(String moduleName)
Set the module name.- Parameters:
moduleName- the module name to set (must not benull)- Returns:
- the previously set name, or
nullif there was none
-
addFunctionName
public String addFunctionName(int functionIdx, String name)
Add a function name to this section.- Parameters:
functionIdx- the index of the function to namename- the new name (must not benull)- Returns:
- the previously set name, or
nullif there was none
-
addLocalName
public String addLocalName(int functionIdx, int localIdx, String name)
Add a local name to this section.- Parameters:
functionIdx- the index of the function containing the locallocalIdx- the index of the local to namename- the new name (must not benull)- Returns:
- the previously set name, or
nullif there was none
-
addLabelName
public String addLabelName(int functionIdx, int labelIdx, String name)
Add a label name to this section.- Parameters:
functionIdx- the index of the function containing the labellabelIdx- the index of the label to namename- the new name (must not benull)- Returns:
- the previously set name, or
nullif there was none
-
addTableName
public String addTableName(int tableIdx, String name)
Add a table name to this section.- Parameters:
tableIdx- the index of the table to namename- the new name (must not benull)- Returns:
- the previously set name, or
nullif there was none
-
addMemoryName
public String addMemoryName(int memoryIdx, String name)
Add a memory name to this section.- Parameters:
memoryIdx- the index of the memory to namename- the new name (must not benull)- Returns:
- the previously set name, or
nullif there was none
-
addGlobalName
public String addGlobalName(int globalIdx, String name)
Add a global name to this section.- Parameters:
globalIdx- the index of the global to namename- the new name (must not benull)- Returns:
- the previously set name, or
nullif there was none
-
addElementName
public String addElementName(int elementIdx, String name)
Add an element name to this section.- Parameters:
elementIdx- the index of the element to namename- the new name (must not benull)- Returns:
- the previously set name, or
nullif there was none
-
addDataName
public String addDataName(int dataIdx, String name)
Add a data segment name to this section.- Parameters:
dataIdx- the index of the data segment to namename- the new name (must not benull)- Returns:
- the previously set name, or
nullif there was none
-
-