Package org.jruby.util
Class StringSupport
java.lang.Object
org.jruby.util.StringSupport
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classstatic enumstatic final classrb_str_tr / rb_str_tr_bangstatic final classtr_setup_table -
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final intprivate static final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intstatic final intprivate static final Objectstatic final ByteList[]static final String[]private static final intprivate static final intprivate static final longprivate static final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ByteListaddByteLists(ByteList value1, ByteList value2) static booleanareComparable(CodeRangeable string, CodeRangeable other) static booleanareComparableViaCodeRange(CodeRangeable string, CodeRangeable other) static org.jcodings.EncodingareCompatible(ByteList str1, ByteList str2) static org.jcodings.EncodingareCompatible(CodeRangeable str1, CodeRangeable str2) rb_enc_compatiblestatic voidasciiOnlyCaseMap(Ruby runtime, ByteList value, org.jcodings.IntHolder flags, org.jcodings.Encoding enc) static voidassociateEncoding(CodeRangeable string, org.jcodings.Encoding enc) static StringbyteListAsString(ByteList bytes) static intbytesToFixBrokenTrailingCharacter(byte[] bytes, int begin, int byteSize, org.jcodings.Encoding encoding, int usingLength) static intbytesToFixBrokenTrailingCharacter(ByteList val, int usingLength) static intcaseCmp(byte[] bytes1, int p1, byte[] bytes2, int p2, int len) static ByteListstatic intcheckCaseMapOptions(Ruby runtime, IRubyObject arg0, int flags) static intcheckCaseMapOptions(Ruby runtime, IRubyObject arg0, IRubyObject arg1, int flags) static intcheckCodepointError(int i) static RubyStringcheckEmbeddedNulls(Ruby runtime, IRubyObject ptr) static final voidcheckStringSafety(Ruby runtime, IRubyObject value) Check whether input object's string value contains a null byte, and if so throw ArgumentError.private static intchomp_newline(byte[] bytes, int p, int e, org.jcodings.Encoding enc) static intMRI: chopped_lengthstatic intchoppedLength19(CodeRangeable str, Ruby runtime) Deprecated.static intcodeLength(org.jcodings.Encoding enc, int c) static intcodePoint(org.jcodings.Encoding enc, byte[] bytes, int p, int end) static intstatic intstatic StringcodeRangeAsString(int codeRange) static intcodeRangeScan(org.jcodings.Encoding enc, byte[] bytes, int p, int len) static intcodeRangeScan(org.jcodings.Encoding enc, ByteList bytes) private static intcodeRangeScanAsciiCompatible(org.jcodings.Encoding enc, byte[] bytes, int p, int len) private static intcodeRangeScanNonAsciiCompatible(org.jcodings.Encoding enc, byte[] bytes, int p, int len) static longcodeRangeScanRestartable(org.jcodings.Encoding enc, byte[] bytes, int s, int end, int cr) static CharSequenceconcat(CharSequence str1, CharSequence str2) static Stringstatic intCONSTRUCT_MBCLEN_CHARFOUND(int n) static booleancontentEquals(CharSequence str, int chr) static booleancontentEquals(CharSequence str, int chr1, int chr2) private static intstatic intcountCommon19(ByteList str, Ruby runtime, boolean[] table, StringSupport.TrTables tables, org.jcodings.Encoding enc) Deprecated.private static intcountUtf8LeadBytes(long d) static Stringstatic ByteListdumpCommon(Ruby runtime, ByteList bytelist) rb_str_dumpstatic ByteListdumpCommon(Ruby runtime, ByteList byteList, boolean quoteOnlyIfNeeded) static intencCoderangeClean(int cr) static intencFastMBCLen(byte[] bytes, int p, int e, org.jcodings.Encoding enc) static StringescapedCharFormat(int c, boolean isUnicode) private static int[]failure(byte[] p, int pStart, int pLen) static longgetAscii(org.jcodings.Encoding enc, byte[] bytes, int p, int end) static longgetAscii(org.jcodings.Encoding enc, byte[] bytes, int p, int end, int len) static inthexLength(byte[] bytes, int p, int len) static inthexLength(byte[] bytes, int p, int len, org.jcodings.Encoding enc) static intstatic intindex(CodeRangeable sourceString, CodeRangeable otherString, int offset, org.jcodings.Encoding enc) private static booleanisAsciiOnly(org.jcodings.Encoding encoding, int codeRange) static booleanisAsciiOnly(CodeRangeable string) static booleanisEVStr(byte[] bytes, int p, int end) static booleanisEVStr(int c) static booleanisIncompleteChar(int b) static booleanisSingleByteOptimizable(CodeRangeable string, org.jcodings.Encoding encoding) static booleanisUnicode(org.jcodings.Encoding enc) Deprecated.static intlastIndexOf(CharSequence str, char c, int index) static intlength(org.jcodings.Encoding enc, byte[] bytes, int p, int end) static intMBCLEN_CHARFOUND_LEN(int r) static booleanMBCLEN_CHARFOUND_P(int r) static booleanMBCLEN_INVALID_P(int r) static intMBCLEN_NEEDMORE(int n) static intMBCLEN_NEEDMORE_LEN(int r) static booleanMBCLEN_NEEDMORE_P(int r) static intmemchr(byte[] ptr, int start, int find, int len) static intmemmem(byte[] aBytes, int aStart, int aLen, byte[] p, int pStart, int pLen) static intmemsearch(byte[] xBytes, int x0, int m, byte[] yBytes, int y0, int n, org.jcodings.Encoding enc) static intmultiByteCasecmp(org.jcodings.Encoding enc, ByteList value, ByteList otherValue) static booleanmultiByteSqueeze(Ruby runtime, ByteList value, boolean[] squeeze, StringSupport.TrTables tables, org.jcodings.Encoding enc, boolean isArg) static booleanmultiByteSqueeze(ByteList value, boolean[] squeeze, StringSupport.TrTables tables, org.jcodings.Encoding enc, boolean isArg) static intnth(org.jcodings.Encoding enc, byte[] bytes, int p, int end, int n) Return the byte offset of the nth characternin the given byte array betweenpandnusingencas the encoding.static intnth(org.jcodings.Encoding enc, byte[] bytes, int p, int end, int n, boolean singlebyte) Get the position of the nth character in the given byte array, using the given encoding and range.private static intnthAsciiCompatible(org.jcodings.Encoding enc, byte[] bytes, int p, int end, int n) private static intnthNonAsciiCompatible(org.jcodings.Encoding enc, byte[] bytes, int p, int end, int n) static intoctLength(byte[] bytes, int p, int len) static intoctLength(byte[] bytes, int p, int len, org.jcodings.Encoding enc) static intoffset(org.jcodings.Encoding enc, byte[] bytes, int p, int end, int n) static intoffset(org.jcodings.Encoding enc, byte[] bytes, int p, int end, int n, boolean singlebyte) static intoffset(RubyString str, int pos) static longpack(int result, int arg) static intpositionEndForScan(ByteList value, org.joni.Matcher matcher, org.jcodings.Encoding enc, int begin, int range) rb_str_scanstatic intpreciseCodePoint(org.jcodings.Encoding enc, byte[] bytes, int p, int end) static intpreciseLength(org.jcodings.Encoding enc, byte[] bytes, int p, int end) private static StringSupport.NeighborCharpredChar(org.jcodings.Encoding enc, byte[] bytes, int p, int len) private static intrb_memsearch_qs(byte[] xsBytes, int xs, int m, byte[] ysBytes, int ys, int n) private static intrb_memsearch_qs_utf8(byte[] xsBytes, int xs, int m, byte[] ysBytes, int ys, int n) private static intrb_memsearch_qs_utf8_hash(byte[] xBytes, int x) private static intrb_memsearch_ss(byte[] xsBytes, int xs, int m, byte[] ysBytes, int ys, int n) static IRubyObjectrbStrEnumerateLines(RubyString str, ThreadContext context, String name, IRubyObject arg, Block block, boolean wantarray) static IRubyObjectrbStrEnumerateLines(RubyString str, ThreadContext context, String name, IRubyObject arg, IRubyObject opts, Block block, boolean wantarray) private static voidrbStrEnumerateLinesEmptySep(RubyString str, ThreadContext context, boolean chomp, Block block, RubyArray ary, byte[] strBytes, int ptr, int len, int pend, org.jcodings.Encoding enc, int subptr) static CharSequencereplaceAll(String str, String sub, String repl) static CharSequencereplaceFirst(String str, String sub, String repl) private static CharSequencereplaceImpl(String str, String sub, String repl, int max, boolean ignoreCase) static ByteListreplaceInternal(int beg, int len, ByteListHolder source, CodeRangeable repl) static voidreplaceInternal19(int beg, int len, CodeRangeable source, CodeRangeable repl) static voidreplaceInternal19(Ruby runtime, int beg, int len, RubyString source, RubyString repl) static intrindex(ByteList source, int sourceChars, int subChars, int pos, CodeRangeable subStringCodeRangeable, org.jcodings.Encoding enc) static intscanHex(byte[] bytes, int p, int len) static intscanHex(byte[] bytes, int p, int len, org.jcodings.Encoding enc) static intscanOct(byte[] bytes, int p, int len) static intscanOct(byte[] bytes, int p, int len, org.jcodings.Encoding enc) static intsearchNonAscii(byte[] bytes, int p, int end) static intsearchNonAscii(String string) static intsearchNonAscii(ByteList bytes) static booleansingleByteSqueeze(ByteList value, boolean[] squeeze) Split string into sub-parts.Split string into (limited) sub-parts.static booleanstartsWith(CharSequence str, char c) static booleanstartsWith(CharSequence str, char c1, char c2) static booleanstartsWith(CharSequence str, String prefix) static intstrCount(ByteList str, boolean[] table, StringSupport.TrTables tables, org.jcodings.Encoding enc) rb_str_countstatic intstrCount(ByteList str, Ruby runtime, boolean[] table, StringSupport.TrTables tables, org.jcodings.Encoding enc) (package private) static CodeRangeablestrDeleteBang(CodeRangeable rubyString, boolean[] squeeze, StringSupport.TrTables tables, org.jcodings.Encoding enc) rb_str_delete_bangstatic CodeRangeablestrDeleteBang(CodeRangeable rubyString, Ruby runtime, boolean[] squeeze, StringSupport.TrTables tables, org.jcodings.Encoding enc) private static RubyStringstrFillTerm(RubyString str, byte[] sBytes, int beg, int len, int termlen) static intstrLength(org.jcodings.Encoding enc, byte[] bytes, int p, int end) static intstrLength(org.jcodings.Encoding enc, byte[] bytes, int p, int e, int cr) static intstatic intstrLengthFromRubyString(CodeRangeable string) static intstrLengthFromRubyString(CodeRangeable string, org.jcodings.Encoding enc) static intstrLengthFromRubyString(CodeRangeable string, ByteList bytes, org.jcodings.Encoding enc) private static intstrLengthFromRubyStringFull(CodeRangeable string, ByteList bytes, org.jcodings.Encoding enc) static longstrLengthWithCodeRange(org.jcodings.Encoding enc, byte[] bytes, int p, int end) static longstrLengthWithCodeRange(ByteList bytes) static longstrLengthWithCodeRange(ByteList bytes, org.jcodings.Encoding enc) static longstrLengthWithCodeRangeAsciiCompatible(org.jcodings.Encoding enc, byte[] bytes, int p, int end) static longstrLengthWithCodeRangeNonAsciiCompatible(org.jcodings.Encoding enc, byte[] bytes, int p, int end) private static intstrNullChar(byte[] sBytes, int s, int len, int minlen, org.jcodings.Encoding enc) private static intstrRindex(byte[] strBytes, int strBeg, int strLen, byte[] subBytes, int subBeg, int subLen, int s, int pos, org.jcodings.Encoding enc) private static StringSupport.NeighborCharsuccAlnumChar(org.jcodings.Encoding enc, byte[] bytes, int p, int len, byte[] carry, int carryP) static StringSupport.NeighborCharsuccChar(org.jcodings.Encoding enc, byte[] bytes, int p, int len) static StringSupport.NeighborCharstatic ByteListsuccCommon(Ruby runtime, ByteList original) static ByteListsuccCommon(ByteList original) private static voidTERM_FILL(byte[] ptr, int beg, int len, int termlen) static inttoLower(org.jcodings.Encoding enc, int c) Deprecated.static inttoUpper(org.jcodings.Encoding enc, int c) Deprecated.private static inttrCode(int c, int[] trans, org.jcodings.util.IntHash<Integer> hash, boolean cflag, int last, boolean set) static booleantrFind(int c, boolean[] table, StringSupport.TrTables tables) static inttrNext(StringSupport.TR tr, org.jcodings.Encoding enc) static inttrNext(StringSupport.TR tr, Ruby runtime, org.jcodings.Encoding enc) private static inttrNext_nextpart(StringSupport.TR tr, org.jcodings.Encoding enc) static StringSupport.TrTablestrSetupTable(ByteList str, boolean[] stable, StringSupport.TrTables tables, boolean first, org.jcodings.Encoding enc) static StringSupport.TrTablestrSetupTable(ByteList str, Ruby runtime, boolean[] stable, StringSupport.TrTables tables, boolean first, org.jcodings.Encoding enc) static CodeRangeabletrTransHelper(Ruby runtime, CodeRangeable self, CodeRangeable srcStr, CodeRangeable replStr, boolean sflag) static CodeRangeabletrTransHelper(CodeRangeable self, CodeRangeable srcStr, CodeRangeable replStr, boolean sflag) rb_str_tr / rb_str_tr_bangstatic intunpackArg(long cr) static intunpackResult(long len) static intutf8Length(byte[] bytes, int p, int end) static intutf8Length(ByteList bytes) static intutf8Nth(byte[] bytes, int p, int e, int nth) static intutf8Offset(byte[] bytes, int p, int end, int n) private static booleanzeroFilled(byte[] sBytes, int s, int n)
-
Field Details
-
CR_7BIT_F
public static final int CR_7BIT_F -
CR_VALID_F
public static final int CR_VALID_F -
CR_UNKNOWN
public static final int CR_UNKNOWN- See Also:
-
CR_7BIT
public static final int CR_7BIT- See Also:
-
CR_VALID
public static final int CR_VALID- See Also:
-
CR_BROKEN
public static final int CR_BROKEN- See Also:
-
CR_MASK
public static final int CR_MASK- See Also:
-
ARRAY_BYTE_BASE_OFFSET
static final int ARRAY_BYTE_BASE_OFFSET -
TRANS_SIZE
public static final int TRANS_SIZE- See Also:
-
EMPTY_BYTELIST_ARRAY
-
EMPTY_STRING_ARRAY
-
NONASCII_MASK
private static final long NONASCII_MASK- See Also:
-
LONG_SIZE
private static final int LONG_SIZE- See Also:
-
LOWBITS
private static final int LOWBITS- See Also:
-
DUMMY_VALUE
-
NULL_POINTER
private static final int NULL_POINTER- See Also:
-
CASE_MAPPING_ADDITIONAL_LENGTH
private static final int CASE_MAPPING_ADDITIONAL_LENGTH- See Also:
-
-
Constructor Details
-
StringSupport
public StringSupport()
-
-
Method Details
-
split
Split string into sub-parts.- Parameters:
str- the stringsep- the separator- See Also:
-
split
Split string into (limited) sub-parts.- Parameters:
str- the stringsep- the separatorlim- has same effect as withString.split(String, int)
-
startsWith
-
startsWith
-
startsWith
-
lastIndexOf
-
contentEquals
-
contentEquals
-
concat
-
concat
-
delete
-
replaceFirst
-
replaceAll
-
replaceImpl
private static CharSequence replaceImpl(String str, String sub, String repl, int max, boolean ignoreCase) -
copy
-
codeRangeAsString
-
encFastMBCLen
public static int encFastMBCLen(byte[] bytes, int p, int e, org.jcodings.Encoding enc) -
length
public static int length(org.jcodings.Encoding enc, byte[] bytes, int p, int end) -
preciseLength
public static int preciseLength(org.jcodings.Encoding enc, byte[] bytes, int p, int end) -
MBCLEN_NEEDMORE_P
public static boolean MBCLEN_NEEDMORE_P(int r) -
MBCLEN_NEEDMORE
public static int MBCLEN_NEEDMORE(int n) -
MBCLEN_NEEDMORE_LEN
public static int MBCLEN_NEEDMORE_LEN(int r) -
MBCLEN_INVALID_P
public static boolean MBCLEN_INVALID_P(int r) -
MBCLEN_CHARFOUND_LEN
public static int MBCLEN_CHARFOUND_LEN(int r) -
MBCLEN_CHARFOUND_P
public static boolean MBCLEN_CHARFOUND_P(int r) -
CONSTRUCT_MBCLEN_CHARFOUND
public static int CONSTRUCT_MBCLEN_CHARFOUND(int n) -
searchNonAscii
public static int searchNonAscii(byte[] bytes, int p, int end) -
searchNonAscii
-
searchNonAscii
-
codeRangeScan
public static int codeRangeScan(org.jcodings.Encoding enc, byte[] bytes, int p, int len) -
codeRangeScanAsciiCompatible
private static int codeRangeScanAsciiCompatible(org.jcodings.Encoding enc, byte[] bytes, int p, int len) -
codeRangeScanNonAsciiCompatible
private static int codeRangeScanNonAsciiCompatible(org.jcodings.Encoding enc, byte[] bytes, int p, int len) -
codeRangeScan
-
codeRangeScanRestartable
public static long codeRangeScanRestartable(org.jcodings.Encoding enc, byte[] bytes, int s, int end, int cr) -
countUtf8LeadBytes
private static int countUtf8LeadBytes(long d) -
utf8Length
public static int utf8Length(byte[] bytes, int p, int end) -
utf8Length
-
strLength
public static int strLength(org.jcodings.Encoding enc, byte[] bytes, int p, int end) -
strLength
public static int strLength(org.jcodings.Encoding enc, byte[] bytes, int p, int e, int cr) -
strLength
-
strLengthWithCodeRange
public static long strLengthWithCodeRange(org.jcodings.Encoding enc, byte[] bytes, int p, int end) -
strLengthWithCodeRangeAsciiCompatible
public static long strLengthWithCodeRangeAsciiCompatible(org.jcodings.Encoding enc, byte[] bytes, int p, int end) -
strLengthWithCodeRangeNonAsciiCompatible
public static long strLengthWithCodeRangeNonAsciiCompatible(org.jcodings.Encoding enc, byte[] bytes, int p, int end) -
strLengthWithCodeRange
-
strLengthWithCodeRange
-
pack
public static long pack(int result, int arg) -
unpackResult
public static int unpackResult(long len) -
unpackArg
public static int unpackArg(long cr) -
codePoint
public static int codePoint(org.jcodings.Encoding enc, byte[] bytes, int p, int end) -
codePoint
-
codePoint
-
codeLength
public static int codeLength(org.jcodings.Encoding enc, int c) -
checkCodepointError
public static int checkCodepointError(int i) -
getAscii
public static long getAscii(org.jcodings.Encoding enc, byte[] bytes, int p, int end) -
getAscii
public static long getAscii(org.jcodings.Encoding enc, byte[] bytes, int p, int end, int len) -
preciseCodePoint
public static int preciseCodePoint(org.jcodings.Encoding enc, byte[] bytes, int p, int end) -
utf8Nth
public static int utf8Nth(byte[] bytes, int p, int e, int nth) -
nth
public static int nth(org.jcodings.Encoding enc, byte[] bytes, int p, int end, int n) Return the byte offset of the nth characternin the given byte array betweenpandnusingencas the encoding. Note that the resulting offset will absolute, and therefore >=p. Subtractpto get a relative offset.- Parameters:
enc- the encoding of the characters in the byte arraybytes- the byte arrayp- starting offsetend- limit offsetn- character offset to find- Returns:
- the byte offset of the requested character, or -1 if the requested character offset is outside the given byte offset range
-
nth
public static int nth(org.jcodings.Encoding enc, byte[] bytes, int p, int end, int n, boolean singlebyte) Get the position of the nth character in the given byte array, using the given encoding and range.- Parameters:
enc- encoding to usebytes- bytes to scanp- starting byte offsetend- ending byte offsetn- index of character for which to find byte offsetsinglebyte- whether the byte contents are in a single byte encoding- Returns:
- the offset of the nth character in the string, or -1 if nth is out of the string
-
nthAsciiCompatible
private static int nthAsciiCompatible(org.jcodings.Encoding enc, byte[] bytes, int p, int end, int n) -
nthNonAsciiCompatible
private static int nthNonAsciiCompatible(org.jcodings.Encoding enc, byte[] bytes, int p, int end, int n) -
utf8Offset
public static int utf8Offset(byte[] bytes, int p, int end, int n) -
offset
public static int offset(org.jcodings.Encoding enc, byte[] bytes, int p, int end, int n) -
offset
public static int offset(org.jcodings.Encoding enc, byte[] bytes, int p, int end, int n, boolean singlebyte) -
offset
-
toLower
Deprecated. -
toUpper
Deprecated. -
caseCmp
public static int caseCmp(byte[] bytes1, int p1, byte[] bytes2, int p2, int len) -
scanHex
public static int scanHex(byte[] bytes, int p, int len) -
scanHex
public static int scanHex(byte[] bytes, int p, int len, org.jcodings.Encoding enc) -
hexLength
public static int hexLength(byte[] bytes, int p, int len) -
hexLength
public static int hexLength(byte[] bytes, int p, int len, org.jcodings.Encoding enc) -
scanOct
public static int scanOct(byte[] bytes, int p, int len) -
scanOct
public static int scanOct(byte[] bytes, int p, int len, org.jcodings.Encoding enc) -
octLength
public static int octLength(byte[] bytes, int p, int len) -
octLength
public static int octLength(byte[] bytes, int p, int len, org.jcodings.Encoding enc) -
checkStringSafety
Check whether input object's string value contains a null byte, and if so throw ArgumentError.- Parameters:
runtime-value-
-
escapedCharFormat
-
isIncompleteChar
public static boolean isIncompleteChar(int b) -
bytesToFixBrokenTrailingCharacter
-
bytesToFixBrokenTrailingCharacter
public static int bytesToFixBrokenTrailingCharacter(byte[] bytes, int begin, int byteSize, org.jcodings.Encoding encoding, int usingLength) -
memchr
public static int memchr(byte[] ptr, int start, int find, int len) -
checkEmbeddedNulls
-
strNullChar
private static int strNullChar(byte[] sBytes, int s, int len, int minlen, org.jcodings.Encoding enc) -
zeroFilled
private static boolean zeroFilled(byte[] sBytes, int s, int n) -
strFillTerm
-
TERM_FILL
private static void TERM_FILL(byte[] ptr, int beg, int len, int termlen) -
positionEndForScan
public static int positionEndForScan(ByteList value, org.joni.Matcher matcher, org.jcodings.Encoding enc, int begin, int range) rb_str_scan -
dumpCommon
rb_str_dump -
dumpCommon
-
isEVStr
public static boolean isEVStr(byte[] bytes, int p, int end) -
isEVStr
public static boolean isEVStr(int c) -
strCount
public static int strCount(ByteList str, boolean[] table, StringSupport.TrTables tables, org.jcodings.Encoding enc) rb_str_count -
strCount
public static int strCount(ByteList str, Ruby runtime, boolean[] table, StringSupport.TrTables tables, org.jcodings.Encoding enc) -
countCommon19
public static int countCommon19(ByteList str, Ruby runtime, boolean[] table, StringSupport.TrTables tables, org.jcodings.Encoding enc) Deprecated. -
rindex
public static int rindex(ByteList source, int sourceChars, int subChars, int pos, CodeRangeable subStringCodeRangeable, org.jcodings.Encoding enc) -
strRindex
private static int strRindex(byte[] strBytes, int strBeg, int strLen, byte[] subBytes, int subBeg, int subLen, int s, int pos, org.jcodings.Encoding enc) -
strLengthFromRubyString
-
strLengthFromRubyString
-
strLengthFromRubyString
public static int strLengthFromRubyString(CodeRangeable string, ByteList bytes, org.jcodings.Encoding enc) -
strLengthFromRubyStringFull
private static int strLengthFromRubyStringFull(CodeRangeable string, ByteList bytes, org.jcodings.Encoding enc) -
trSetupTable
public static StringSupport.TrTables trSetupTable(ByteList str, boolean[] stable, StringSupport.TrTables tables, boolean first, org.jcodings.Encoding enc) -
trSetupTable
public static StringSupport.TrTables trSetupTable(ByteList str, Ruby runtime, boolean[] stable, StringSupport.TrTables tables, boolean first, org.jcodings.Encoding enc) -
trFind
-
trNext
-
trNext
-
trNext_nextpart
-
succCommon
-
succCommon
-
succChar
public static StringSupport.NeighborChar succChar(org.jcodings.Encoding enc, byte[] bytes, int p, int len) -
succChar
public static StringSupport.NeighborChar succChar(Ruby runtime, org.jcodings.Encoding enc, byte[] bytes, int p, int len) -
succAlnumChar
private static StringSupport.NeighborChar succAlnumChar(org.jcodings.Encoding enc, byte[] bytes, int p, int len, byte[] carry, int carryP) -
predChar
private static StringSupport.NeighborChar predChar(org.jcodings.Encoding enc, byte[] bytes, int p, int len) -
isSingleByteOptimizable
-
index
- Parameters:
source- string to find index withinother- string to match in sourceoffset- in bytes to start lookingenc- encoding to use to walk the source string.- Returns:
-
index
public static int index(CodeRangeable sourceString, CodeRangeable otherString, int offset, org.jcodings.Encoding enc) -
associateEncoding
-
replaceInternal
-
replaceInternal19
-
replaceInternal19
public static void replaceInternal19(Ruby runtime, int beg, int len, RubyString source, RubyString repl) -
isAsciiOnly
-
isAsciiOnly
private static boolean isAsciiOnly(org.jcodings.Encoding encoding, int codeRange) -
strDeleteBang
static CodeRangeable strDeleteBang(CodeRangeable rubyString, boolean[] squeeze, StringSupport.TrTables tables, org.jcodings.Encoding enc) rb_str_delete_bang -
strDeleteBang
public static CodeRangeable strDeleteBang(CodeRangeable rubyString, Ruby runtime, boolean[] squeeze, StringSupport.TrTables tables, org.jcodings.Encoding enc) -
choppedLength
MRI: chopped_length -
choppedLength19
Deprecated. -
areCompatible
rb_enc_compatible -
areCompatible
-
addByteLists
-
areComparable
-
areComparableViaCodeRange
-
rbStrEnumerateLines
public static IRubyObject rbStrEnumerateLines(RubyString str, ThreadContext context, String name, IRubyObject arg, Block block, boolean wantarray) -
rbStrEnumerateLines
public static IRubyObject rbStrEnumerateLines(RubyString str, ThreadContext context, String name, IRubyObject arg, IRubyObject opts, Block block, boolean wantarray) -
rbStrEnumerateLinesEmptySep
private static void rbStrEnumerateLinesEmptySep(RubyString str, ThreadContext context, boolean chomp, Block block, RubyArray ary, byte[] strBytes, int ptr, int len, int pend, org.jcodings.Encoding enc, int subptr) -
chomp_newline
private static int chomp_newline(byte[] bytes, int p, int e, org.jcodings.Encoding enc) -
memsearch
public static int memsearch(byte[] xBytes, int x0, int m, byte[] yBytes, int y0, int n, org.jcodings.Encoding enc) -
trTransHelper
public static CodeRangeable trTransHelper(CodeRangeable self, CodeRangeable srcStr, CodeRangeable replStr, boolean sflag) rb_str_tr / rb_str_tr_bang -
trTransHelper
public static CodeRangeable trTransHelper(Ruby runtime, CodeRangeable self, CodeRangeable srcStr, CodeRangeable replStr, boolean sflag) -
trCode
private static int trCode(int c, int[] trans, org.jcodings.util.IntHash<Integer> hash, boolean cflag, int last, boolean set) -
multiByteCasecmp
-
singleByteSqueeze
-
multiByteSqueeze
public static boolean multiByteSqueeze(ByteList value, boolean[] squeeze, StringSupport.TrTables tables, org.jcodings.Encoding enc, boolean isArg) -
multiByteSqueeze
public static boolean multiByteSqueeze(Ruby runtime, ByteList value, boolean[] squeeze, StringSupport.TrTables tables, org.jcodings.Encoding enc, boolean isArg) -
rb_memsearch_ss
private static int rb_memsearch_ss(byte[] xsBytes, int xs, int m, byte[] ysBytes, int ys, int n) -
memmem
public static int memmem(byte[] aBytes, int aStart, int aLen, byte[] p, int pStart, int pLen) -
failure
private static int[] failure(byte[] p, int pStart, int pLen) -
rb_memsearch_qs
private static int rb_memsearch_qs(byte[] xsBytes, int xs, int m, byte[] ysBytes, int ys, int n) -
rb_memsearch_qs_utf8_hash
private static int rb_memsearch_qs_utf8_hash(byte[] xBytes, int x) -
rb_memsearch_qs_utf8
private static int rb_memsearch_qs_utf8(byte[] xsBytes, int xs, int m, byte[] ysBytes, int ys, int n) -
checkCaseMapOptions
-
checkCaseMapOptions
-
caseMap
-
asciiOnlyCaseMap
-
encCoderangeClean
public static int encCoderangeClean(int cr) -
byteListAsString
-
isUnicode
Deprecated.
-
strCount(ByteList, Ruby, boolean[], TrTables, Encoding)