Package com.oracle.truffle.api.strings
package com.oracle.truffle.api.strings
Truffle String related APIs.
Please see the
tutorial
for further usage instructions.
- Since:
- 22.1
-
ClassDescriptionAbstract base class for Truffle strings.Wrapper object containing a
TruffleString
's internal byte array, along with a byte offset and length defining the region in use.Represents a mutable variant of aTruffleString
.Node to get the givenAbstractTruffleString
as a managedMutableTruffleString
, meaning that the resulting string's backing memory is not a native pointer.Node to get aAbstractTruffleString
as aMutableTruffleString
.Node to create a newMutableTruffleString
by concatenating two strings.Node to forcibly assign any encoding to a string.Node to create a newMutableTruffleString
from a byte array.Node to create a newMutableTruffleString
from an interop object representing a native pointer.MutableTruffleString.SubstringNode
, but with byte indices.Node to create a new mutable substring of a string.Node to get a given string in a specific encoding.Node to write a byte into a mutable string.An allocation function for native buffers.An error handler for transcoding operations such asTruffleString.SwitchEncodingNode
.Represents a primitive String type, which can be reused across languages.Node to get the givenAbstractTruffleString
as a managedTruffleString
, meaning that the resulting string's backing memory is not a native pointer.Node to get the givenAbstractTruffleString
as aTruffleString
.Node to find the index of the first occurrence of any byte from a given array.TruffleString.IndexOfCodePointNode
, but with byte indices.Node to find the byte index of the first occurrence of a codepoint present in a given codepoint set.TruffleString.IndexOfStringNode
, but with byte indices.Node to convert a given byte index to a codepoint index.Node to get the number of bytes occupied by the codepoint starting at a given byte index.Node to find the index of the first occurrence of anychar
from a given array.Node to read a codepoint at a given byte index.Node to read a codepoint at a given codepoint index.Node to convert a given codepoint index to a byte index.Node to get the number of codepoints in a string.A set of codepoints in a given encoding.Provides information about a string's content.Node to check if a string's code range is equal to the givenTruffleString.CodeRange
.Represents a string's compaction level, i.e.Node to compare two strings byte-by-byte.Node to compare two UTF-16 strings.Node to compare two UTF-32 strings.Node to concatenate two strings.Node to copy a region of a string into a byte array.Node to copy a region of a string into native memory.Node to create aTruffleStringIterator
.Node to create aTruffleStringIterator
.The list of encodings supported byTruffleString
.Node to check two strings for equality.Error handling instructions for operations that return integer values, such as indices or code points.Node to forcibly assign any encoding to a string.Node to create a newTruffleString
from a byte array.Node to create a new UTF-16TruffleString
from a char array.Node to create a newTruffleString
from a single codepoint.Node to create a new UTF-32TruffleString
from an int-array.Node to create a newTruffleString
from a Java string.Node to create a newTruffleString
from along
value.Node to create a newTruffleString
from an interop object representing a native pointer.Node to get a string's "byte-based"TruffleString.CodeRange
.Node to get a string's possibly impreciseTruffleString.CodeRange
.Node to get a string's preciseTruffleString.CodeRange
.Node to get a string's internal byte array.Node to get anative
string's pointer object.Node to get a string'sTruffleString.CompactionLevel
.Node to get a string's hash code.Node to find the index of the first occurrence of a given code point.Node to find the index of the first occurrence of a given string.Node to find the index of the first occurrence of anyint
from a given array.Node to check if a string is encoded correctly.TruffleString.LastIndexOfCodePointNode
, but with byte indices.TruffleString.LastIndexOfStringNode
, but with byte indices.Node to find the codepoint index of the last occurrence of a given code point.Node to find the index of the last occurrence of a given string.Node to force materialization of any lazy internal data.This exception may be thrown byTruffleString.ParseIntNode
,TruffleString.ParseLongNode
orTruffleString.ParseDoubleNode
to indicate that the given string cannot be parsed as an integer, long or double value.Node to parse a given string as a double value.Node to parse a given string as an int value.Node to parse a given string as a long value.Node to read a single byte from a string.Node to read a single char from a UTF-16 string.Node to check for a region match, byte-by-byte.Node to check codepoint equality of two string regions.Node to repeat a given stringN
times.TruffleString.SubstringNode
, but with byte indices.Node to create a substring of a given string.Node to get a given string in a specific encoding.Node to get aString
representation of aTruffleString
.Node to replace all invalid bytes in a given string, such that the resulting string isvalid
.Extended parameter type for the operationsTruffleString.ByteIndexOfStringNode
,TruffleString.LastByteIndexOfStringNode
andTruffleString.RegionEqualByteIndexNode
.Node to create a newTruffleString.WithMask
from a string and a byte array.Node to create a newTruffleString.WithMask
from a UTF-16 string and a char array.Node to create a newTruffleString.WithMask
from a UTF-32 string and an int array.TheTruffleString
equivalent toStringBuilder
.Node to append a single byte to a string builder.Node to append a single char to a string builder.Node to append a codepoint to a string builder.Node to append an integer to a string builder.Node to append a substring of a givenString
to a string builder.Node to append along
value to a string builder.Node to append a givenTruffleString
to a string builder.Node to append a substring of a givenTruffleString
to a string builder.Node to materialize a string builder as aTruffleString
.The UTF-16-specific variant ofTruffleStringBuilder
.The UTF-32-specific variant ofTruffleStringBuilder
.The UTF-8-specific variant ofTruffleStringBuilder
.An iterator object that allows iterating over aTruffleString
's codepoints, without having to re-calculate codepoint indices on every access.Returns the next codepoint in the string.Returns the previous codepoint in the string.