public static RubyString appendAsString19(RubyString target, IRubyObject other) { return target.append19(other.asString()); }
private RubyString joinStrings(RubyString sep, int max, RubyString result) { IRubyObject first = values[begin]; if (max - begin > 0 && first instanceof EncodingCapable) { result.setEncoding(((EncodingCapable)first).getEncoding()); } try { for(int i = begin; i < max; i++) { if (i > begin && sep != null) result.append19(sep); result.append19(values[i]); } } catch (ArrayIndexOutOfBoundsException e) { concurrentModification(); } return result; }
private void strJoin(RubyString result, IRubyObject tmp, boolean[] first) { result.append19(tmp); if (first[0]) { result.setEncoding(((RubyString) tmp).getEncoding()); first[0] = false; } }
private void strJoin(RubyString result, IRubyObject tmp, boolean[] first) { result.append19(tmp); if (first[0]) { result.setEncoding(((RubyString) tmp).getEncoding()); first[0] = false; } }
private static RubyString processElementIntoResult( Ruby runtime, RubyString result, IRubyObject arg0, IRubyObject arg1, RegexpOptions options, Encoding regexpEnc, Encoding[] fixedEnc) { RubyString str = arg0.convertToString(); regexpEnc = processDRegexpElement(runtime, options, regexpEnc, fixedEnc, str); return processElementIntoResult(runtime, result == null ? str.strDup(runtime) : result.append19(str), arg1, options, regexpEnc, fixedEnc); }
private static RubyString processElementIntoResult( Ruby runtime, RubyString result, IRubyObject arg0, IRubyObject arg1, RegexpOptions options, Encoding regexpEnc, Encoding[] fixedEnc) { RubyString str = arg0.convertToString(); regexpEnc = processDRegexpElement(runtime, options, regexpEnc, fixedEnc, str); return processElementIntoResult(runtime, result == null ? str.strDup(runtime) : result.append19(str), arg1, options, regexpEnc, fixedEnc); }
@JRubyMethod(name = "insert") public IRubyObject insert(ThreadContext context, IRubyObject indexArg, IRubyObject stringArg) { RubyString str = stringArg.convertToString(); int index = RubyNumeric.num2int(indexArg); if (index == -1) return append19(stringArg); if (index < 0) index++; replaceInternal19(index, 0, str); return this; }
private static RubyString processElementIntoResult( Ruby runtime, RubyString result, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, RegexpOptions options, Encoding regexpEnc, Encoding[] fixedEnc) { RubyString str = arg0.convertToString(); regexpEnc = processDRegexpElement(runtime, options, regexpEnc, fixedEnc, str); return processElementIntoResult(runtime, result == null ? str.strDup(runtime) : result.append19(str), arg1, arg2, options, regexpEnc, fixedEnc); }
@JRubyMethod(name = "insert") public IRubyObject insert(ThreadContext context, IRubyObject indexArg, IRubyObject stringArg) { RubyString str = stringArg.convertToString(); int index = RubyNumeric.num2int(indexArg); if (index == -1) return append19(stringArg); if (index < 0) index++; replaceInternal19(index, 0, str); return this; }
private static RubyString processElementIntoResult( Ruby runtime, RubyString result, IRubyObject arg0, RegexpOptions options, Encoding regexpEnc, Encoding[] fixedEnc) { RubyString str = arg0.convertToString(); regexpEnc = processDRegexpElement(runtime, options, regexpEnc, fixedEnc, str); result = result == null ? str.strDup(runtime) : result.append19(str); if (regexpEnc != null) result.setEncoding(regexpEnc); return result; }
private static RubyString processElementIntoResult( Ruby runtime, RubyString result, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, RegexpOptions options, Encoding regexpEnc, Encoding[] fixedEnc) { RubyString str = arg0.convertToString(); regexpEnc = processDRegexpElement(runtime, options, regexpEnc, fixedEnc, str); return processElementIntoResult(runtime, result == null ? str.strDup(runtime) : result.append19(str), arg1, arg2, options, regexpEnc, fixedEnc); }
private static RubyString processElementIntoResult( Ruby runtime, RubyString result, IRubyObject arg0, RegexpOptions options, Encoding regexpEnc, Encoding[] fixedEnc) { RubyString str = arg0.convertToString(); regexpEnc = processDRegexpElement(runtime, options, regexpEnc, fixedEnc, str); result = result == null ? str.strDup(runtime) : result.append19(str); if (regexpEnc != null) result.setEncoding(regexpEnc); return result; }
private static RubyString processElementIntoResult( Ruby runtime, RubyString result, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, RegexpOptions options, Encoding regexpEnc, Encoding[] fixedEnc) { RubyString str = arg0.convertToString(); regexpEnc = processDRegexpElement(runtime, options, regexpEnc, fixedEnc, str); return processElementIntoResult(runtime, result == null ? str.strDup(runtime) : result.append19(str), arg1, arg2, arg3, options, regexpEnc, fixedEnc); }
public static RubyString preprocessDRegexp(Ruby runtime, IRubyObject[] strings, RegexpOptions options) { RubyString string = null; Encoding regexpEnc = null; for (int i = 0; i < strings.length; i++) { RubyString str = strings[i].convertToString(); regexpEnc = processDRegexpElement(runtime, options, regexpEnc, runtime.getCurrentContext().encodingHolder(), str); string = string == null ? (RubyString) str.dup() : string.append19(str); } if (regexpEnc != null) string.setEncoding(regexpEnc); return string; }
public static RubyString preprocessDRegexp(Ruby runtime, IRubyObject[] strings, RegexpOptions options) { RubyString string = null; Encoding regexpEnc = null; for (int i = 0; i < strings.length; i++) { RubyString str = strings[i].convertToString(); regexpEnc = processDRegexpElement(runtime, options, regexpEnc, runtime.getCurrentContext().encodingHolder(), str); string = string == null ? (RubyString) str.dup() : string.append19(str); } if (regexpEnc != null) string.setEncoding(regexpEnc); return string; }
@JRubyMethod(name = "insert", compat = RUBY1_9) public IRubyObject insert19(ThreadContext context, IRubyObject indexArg, IRubyObject stringArg) { RubyString str = stringArg.convertToString(); int index = RubyNumeric.num2int(indexArg); if (index == -1) return append19(stringArg); if (index < 0) index++; replaceInternal19(checkIndex(index, strLength()), 0, str); return this; }
@JRubyMethod(name = "insert", compat = RUBY1_9) public IRubyObject insert19(ThreadContext context, IRubyObject indexArg, IRubyObject stringArg) { RubyString str = stringArg.convertToString(); int index = RubyNumeric.num2int(indexArg); if (index == -1) return append19(stringArg); if (index < 0) index++; replaceInternal19(checkIndex(index, strLength()), 0, str); return this; }
protected RubyString joinStrings(RubyString sep, int max, RubyString result) { IRubyObject first; if (max > 0 && (first = eltOk(0)) instanceof EncodingCapable) { result.setEncoding(((EncodingCapable) first).getEncoding()); } try { for (int i = 0; i < max; i++) { if (i > 0 && sep != null) result.cat19(sep); result.append19(eltInternal(i)); } } catch (ArrayIndexOutOfBoundsException e) { throw concurrentModification(getRuntime(), e); } return result; }