Examples of leftAdjustCharHead()


Examples of org.jcodings.Encoding.leftAdjustCharHead()

                    if (c == newline) {
                        if (strPtr[0].getRealSize() < rslen) continue;
                        s = strPtr[0].getBegin();
                        e = s + strPtr[0].getRealSize();
                        p = e - rslen;
                        pp = enc.leftAdjustCharHead(strPtr[0].getUnsafeBytes(), s, p, e);
                        if (pp != p) continue;
                        if (ByteList.memcmp(strPtr[0].getUnsafeBytes(), p, rsptrBytes, rsptr, rslen) == 0) break;
                    }
                    if (limit_p[0] == 0) {
                        s = strPtr[0].getBegin();
View Full Code Here

Examples of org.jcodings.Encoding.leftAdjustCharHead()

                        if (ByteList.memcmp(strPtr[0].getUnsafeBytes(), p, rsptrBytes, rsptr, rslen) == 0) break;
                    }
                    if (limit_p[0] == 0) {
                        s = strPtr[0].getBegin();
                        p = s + strPtr[0].getRealSize();
                        pp = enc.leftAdjustCharHead(strPtr[0].getUnsafeBytes(), s, p - 1, p);
                        if (extraLimit != 0 &&
                                StringSupport.MBCLEN_NEEDMORE_P(StringSupport.preciseLength(enc, strPtr[0].getUnsafeBytes(), pp, p))) {
                            limit_p[0] = 1;
                            extraLimit--;
                        } else {
View Full Code Here

Examples of org.jcodings.Encoding.leftAdjustCharHead()

        if (otherLength == 0) {
            // other is '', so return true
            return true;
        }
        int s = end - otherLength;
        if (enc.leftAdjustCharHead(value.getUnsafeBytes(), p, s, end) != s) return false;
        return value.endsWith(otherString.value);
    }

    private static final ByteList SPACE_BYTELIST = new ByteList(ByteList.plain(" "));
View Full Code Here

Examples of org.jcodings.Encoding.leftAdjustCharHead()

        Encoding enc = checkEncoding(rs);
        if (rs.scanForCodeRange() == CR_BROKEN) return runtime.getNil();

        int pp = end - rslen;
        if (bytes[p + len - 1] == newline && rslen <= 1 || value.endsWith(rs.value)) {
            if (enc.leftAdjustCharHead(bytes, p, pp, end) != pp) return runtime.getNil();
            if (getCodeRange() != CR_7BIT) clearCodeRange();
            view(0, value.getRealSize() - rslen);
            return this;
        }
        return runtime.getNil();
View Full Code Here

Examples of org.jcodings.Encoding.leftAdjustCharHead()

        byte bytes[] = value.getUnsafeBytes();
        Encoding enc = value.getEncoding();

        keepCodeRange();
        if (enc.minLength() > 1) {
            int pp = enc.leftAdjustCharHead(bytes, p, end - enc.minLength(), end);
            if (enc.isNewLine(bytes, pp, end)) end = pp;
            pp = end - enc.minLength();
            if (pp >= p) {
                pp = enc.leftAdjustCharHead(bytes, p, pp, end);
                if (StringSupport.preciseLength(enc, bytes, pp, end) > 0 &&
View Full Code Here

Examples of org.jcodings.Encoding.leftAdjustCharHead()

        if (enc.minLength() > 1) {
            int pp = enc.leftAdjustCharHead(bytes, p, end - enc.minLength(), end);
            if (enc.isNewLine(bytes, pp, end)) end = pp;
            pp = end - enc.minLength();
            if (pp >= p) {
                pp = enc.leftAdjustCharHead(bytes, p, pp, end);
                if (StringSupport.preciseLength(enc, bytes, pp, end) > 0 &&
                        enc.mbcToCode(bytes, pp, end) == '\r') end = pp;
            }
            if (end == p + value.getRealSize()) {
                modifyCheck();
View Full Code Here

Examples of org.jcodings.Encoding.leftAdjustCharHead()

        RubyString sepStr = sep.convertToString();
        if (sepStr == runtime.getGlobalVariables().getDefaultSeparator()) {
            enc = val.getEncoding();
            while (p < end) {
                if (bytes[p] == (byte)'\n') {
                    int p0 = enc.leftAdjustCharHead(bytes, s, p, end);
                    if (enc.isNewLine(bytes, p0, end)) {
                        p = p0 + StringSupport.length(enc, bytes, p0, end);
                        block.yield(context, makeShared19(runtime, val, s - offset, p - s).infectBy(this));
                        s = p;
                        continue;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.