private static boolean lowerCaseMatch(byte[] t, int tP, int tEnd, byte[] bytes, int p, int end, Encoding enc, byte[] buf, int caseFoldFlag) { final IntHolder holder = new IntHolder(); holder.value = p; while (tP < tEnd) { int lowlen = enc.mbcCaseFold(caseFoldFlag, bytes, holder, end, buf); if (lowlen == 1) { if (t[tP++] != buf[0]) return false; } else { int q = 0; while (lowlen > 0) { if (t[tP++] != buf[q++]) return false; lowlen--; } } } return true; }
private static boolean lowerCaseMatch(byte[] t, int tP, int tEnd, byte[] bytes, int p, int end, Encoding enc, byte[] buf, int caseFoldFlag) { final IntHolder holder = new IntHolder(); holder.value = p; while (tP < tEnd) { int lowlen = enc.mbcCaseFold(caseFoldFlag, bytes, holder, end, buf); if (lowlen == 1) { if (t[tP++] != buf[0]) return false; } else { int q = 0; while (lowlen > 0) { if (t[tP++] != buf[q++]) return false; lowlen--; } } } return true; }
private int caseMap(Ruby runtime, int flags, Encoding enc) { IntHolder flagsP = new IntHolder(); flagsP.value = flags; if ((flags & Config.CASE_ASCII_ONLY) != 0) { StringSupport.asciiOnlyCaseMap(runtime, value, flagsP, enc); } else { value = StringSupport.caseMap(runtime, value, flagsP, enc); } return flagsP.value; }
private int caseMap(Ruby runtime, int flags, Encoding enc) { IntHolder flagsP = new IntHolder(); flagsP.value = flags; if ((flags & Config.CASE_ASCII_ONLY) != 0) { StringSupport.asciiOnlyCaseMap(runtime, value, flagsP, enc); } else { value = StringSupport.caseMap(runtime, value, flagsP, enc); } return flagsP.value; }
public static void asciiOnlyCaseMap(Ruby runtime, ByteList value, IntHolder flags, Encoding enc) { if (value.getRealSize() == 0) return; int s = value.getBegin(); int end = s + value.getRealSize(); byte[]bytes = value.getUnsafeBytes(); IntHolder pp = new IntHolder(); pp.value = s; int len = ASCIIEncoding.INSTANCE.caseMap(flags, bytes, pp, end, bytes, s, end); if (len < 0) throw runtime.newArgumentError("input string invalid"); }
public static void asciiOnlyCaseMap(Ruby runtime, ByteList value, IntHolder flags, Encoding enc) { if (value.getRealSize() == 0) return; int s = value.getBegin(); int end = s + value.getRealSize(); byte[]bytes = value.getUnsafeBytes(); IntHolder pp = new IntHolder(); pp.value = s; int len = ASCIIEncoding.INSTANCE.caseMap(flags, bytes, pp, end, bytes, s, end); if (len < 0) throw runtime.newArgumentError("input string invalid"); }
public static ByteList caseMap(Ruby runtime, ByteList src, IntHolder flags, Encoding enc) { IntHolder pp = new IntHolder(); pp.value = src.getBegin(); int end = src.getRealSize() + pp.value;
public static ByteList caseMap(Ruby runtime, ByteList src, IntHolder flags, Encoding enc) { IntHolder pp = new IntHolder(); pp.value = src.getBegin(); int end = src.getRealSize() + pp.value;