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 givenAbstractTruffleStringas a managedMutableTruffleString, meaning that the resulting string's backing memory is not a native pointer.Node to get aAbstractTruffleStringas aMutableTruffleString.Node to create a newMutableTruffleStringby concatenating two strings.Node to forcibly assign any encoding to a string.Node to create a newMutableTruffleStringfrom a byte array.Node to create a newMutableTruffleStringfrom 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 givenAbstractTruffleStringas a managedTruffleString, meaning that the resulting string's backing memory is not a native pointer.Node to get the givenAbstractTruffleStringas 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 anycharfrom 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 newTruffleStringfrom a byte array.Node to create a new UTF-16TruffleStringfrom a char array.Node to create a newTruffleStringfrom a single codepoint.Node to create a new UTF-32TruffleStringfrom an int-array.Node to create a newTruffleStringfrom a Java string.Node to create a newTruffleStringfrom alongvalue.Node to create a newTruffleStringfrom 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 anativestring'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 anyintfrom 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.Extended version ofTruffleString.MaterializeNodethat also materializes substrings/string views created via e.g.This exception may be thrown byTruffleString.ParseIntNode,TruffleString.ParseLongNodeorTruffleString.ParseDoubleNodeto 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 stringNtimes.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 aStringrepresentation 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.LastByteIndexOfStringNodeandTruffleString.RegionEqualByteIndexNode.Node to create a newTruffleString.WithMaskfrom a string and a byte array.Node to create a newTruffleString.WithMaskfrom a UTF-16 string and a char array.Node to create a newTruffleString.WithMaskfrom a UTF-32 string and an int array.TheTruffleStringequivalent 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 givenStringto a string builder.Node to append alongvalue to a string builder.Node to append a givenTruffleStringto a string builder.Node to append a substring of a givenTruffleStringto 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.