@Test public void testPathListQuotedSpace() { assertThat("[abc,d1 cd,x]", Chars.splitLpsz("abc \"d1 cd\" x")); }
public static ObjList<Path> splitLpsz(CharSequence args) { final ObjList<Path> paths = new ObjList<>(); int n = args.length(); int lastLen = 0; int lastIndex = 0; boolean inQuote = false; for (int i = 0; i < n; i++) { char b = args.charAt(i); switch (b) { case ' ': if (lastLen > 0) { if (inQuote) { lastLen++; } else { paths.add(new Path().of(args, lastIndex, lastLen + lastIndex).$()); lastLen = 0; } } break; case '"': inQuote = !inQuote; break; default: if (lastLen == 0) { lastIndex = i; } lastLen++; break; } } if (lastLen > 0) { paths.add(new Path().of(args, lastIndex, lastLen + lastIndex).$()); } return paths; }
Chars { public static ObjList<Path> splitLpsz(CharSequence args) { final ObjList<Path> paths = new ObjList<>(); int n = args.length(); int lastLen = 0; int lastIndex = 0; boolean inQuote = false; for (int i = 0; i < n; i++) { char b = args.charAt(i); switch (b) { case ' ': if (lastLen > 0) { if (inQuote) { lastLen++; } else { paths.add(new Path().of(args, lastIndex, lastLen + lastIndex).$()); lastLen = 0; } } break; case '"': inQuote = !inQuote; break; default: if (lastLen == 0) { lastIndex = i; } lastLen++; break; } } if (lastLen > 0) { paths.add(new Path().of(args, lastIndex, lastLen + lastIndex).$()); } return paths; } }
Chars { public static ObjList<Path> splitLpsz(CharSequence args) { final ObjList<Path> paths = new ObjList<>(); int n = args.length(); int lastLen = 0; int lastIndex = 0; boolean inQuote = false; for (int i = 0; i < n; i++) { char b = args.charAt(i); switch (b) { case ' ': if (lastLen > 0) { if (inQuote) { lastLen++; } else { paths.add(new Path().of(args, lastIndex, lastLen + lastIndex).$()); lastLen = 0; } } break; case '"': inQuote = !inQuote; break; default: if (lastLen == 0) { lastIndex = i; } lastLen++; break; } } if (lastLen > 0) { paths.add(new Path().of(args, lastIndex, lastLen + lastIndex).$()); } return paths; } private  Chars(); }
Chars { public static ObjList<Path> splitLpsz(CharSequence args) { final ObjList<Path> paths = new ObjList<>(); int n = args.length(); int lastLen = 0; int lastIndex = 0; boolean inQuote = false; for (int i = 0; i < n; i++) { char b = args.charAt(i); switch (b) { case ' ': if (lastLen > 0) { if (inQuote) { lastLen++; } else { paths.add(new Path().of(args, lastIndex, lastLen + lastIndex).$()); lastLen = 0; } } break; case '"': inQuote = !inQuote; break; default: if (lastLen == 0) { lastIndex = i; } lastLen++; break; } } if (lastLen > 0) { paths.add(new Path().of(args, lastIndex, lastLen + lastIndex).$()); } return paths; } private  Chars(); static void asciiCopyTo(char[] chars, int start, int len, long dest); static void asciiStrCpy(final CharSequence value, final int len, final long address); static void asciiStrCpy(final CharSequence value, int lo, final int len, final long address); static int compare(CharSequence l, CharSequence r); static int compareDescending(CharSequence l, CharSequence r); static boolean contains(CharSequence sequence, CharSequence term); static boolean endsWith(CharSequence cs, CharSequence ends); static boolean endsWith(CharSequence cs, char c); static boolean equals(CharSequence l, CharSequence r); static boolean equals(CharSequence l, CharSequence r, int rLo, int rHi); static boolean equals(CharSequence l, int lLo, int lHi, CharSequence r, int rLo, int rHi); static boolean equals(CharSequence l, char r); static boolean equalsIgnoreCase(CharSequence l, CharSequence r); static boolean equalsIgnoreCaseNc(CharSequence l, CharSequence r); static boolean equalsLowerCaseAscii(CharSequence l, int lLo, int lHi, CharSequence r, int rLo, int rHi); static boolean equalsLowerCaseAscii(@NotNull CharSequence l, CharSequence r); static boolean equalsLowerCaseAsciiNc(@Nullable CharSequence l, @NotNull CharSequence r); static boolean equalsNc(CharSequence l, char r); static boolean equalsNc(CharSequence l, CharSequence r); static int hashCode(CharSequence value, int lo, int hi); static int hashCode(CharSequence value); static int indexOf(CharSequence s, char c); static int indexOf(CharSequence s, final int lo, char c); static boolean isMalformed3(int b1, int b2, int b3); static boolean isMalformed4(int b2, int b3, int b4); static boolean isNotContinuation(int b); static boolean isQuote(char c); static boolean isQuoted(CharSequence s); static int lastIndexOf(CharSequence s, char c); static int lowerCaseAsciiHashCode(CharSequence value, int lo, int hi); static int lowerCaseAsciiHashCode(CharSequence value); static boolean noMatch(CharSequence l, int llo, int lhi, CharSequence r, int rlo, int rhi); static ObjList<Path> splitLpsz(CharSequence args); static boolean startsWith(CharSequence _this, CharSequence that); static boolean startsWith(CharSequence _this, int thisLo, int thisHi, CharSequence that); static boolean startsWith(CharSequence _this, char c); static String stringFromUtf8Bytes(long lo, long hi); static String toLowerCaseAscii(@Nullable CharSequence value); static char toLowerCaseAscii(char character); static void toSink(BinarySequence sequence, CharSink sink); static String toString(CharSequence s); static String toString(CharSequence cs, int start, int end); static boolean utf8Decode(long lo, long hi, CharSink sink); static int utf8DecodeMultiByte(long lo, long hi, int b, CharSink sink); static int utf8DecodeMultiByteZ(long lo, int b, CharSink sink); static boolean utf8DecodeZ(long lo, CharSink sink); }
Chars { public static ObjList<Path> splitLpsz(CharSequence args) { final ObjList<Path> paths = new ObjList<>(); int n = args.length(); int lastLen = 0; int lastIndex = 0; boolean inQuote = false; for (int i = 0; i < n; i++) { char b = args.charAt(i); switch (b) { case ' ': if (lastLen > 0) { if (inQuote) { lastLen++; } else { paths.add(new Path().of(args, lastIndex, lastLen + lastIndex).$()); lastLen = 0; } } break; case '"': inQuote = !inQuote; break; default: if (lastLen == 0) { lastIndex = i; } lastLen++; break; } } if (lastLen > 0) { paths.add(new Path().of(args, lastIndex, lastLen + lastIndex).$()); } return paths; } private  Chars(); static void asciiCopyTo(char[] chars, int start, int len, long dest); static void asciiStrCpy(final CharSequence value, final int len, final long address); static void asciiStrCpy(final CharSequence value, int lo, final int len, final long address); static int compare(CharSequence l, CharSequence r); static int compareDescending(CharSequence l, CharSequence r); static boolean contains(CharSequence sequence, CharSequence term); static boolean endsWith(CharSequence cs, CharSequence ends); static boolean endsWith(CharSequence cs, char c); static boolean equals(CharSequence l, CharSequence r); static boolean equals(CharSequence l, CharSequence r, int rLo, int rHi); static boolean equals(CharSequence l, int lLo, int lHi, CharSequence r, int rLo, int rHi); static boolean equals(CharSequence l, char r); static boolean equalsIgnoreCase(CharSequence l, CharSequence r); static boolean equalsIgnoreCaseNc(CharSequence l, CharSequence r); static boolean equalsLowerCaseAscii(CharSequence l, int lLo, int lHi, CharSequence r, int rLo, int rHi); static boolean equalsLowerCaseAscii(@NotNull CharSequence l, CharSequence r); static boolean equalsLowerCaseAsciiNc(@Nullable CharSequence l, @NotNull CharSequence r); static boolean equalsNc(CharSequence l, char r); static boolean equalsNc(CharSequence l, CharSequence r); static int hashCode(CharSequence value, int lo, int hi); static int hashCode(CharSequence value); static int indexOf(CharSequence s, char c); static int indexOf(CharSequence s, final int lo, char c); static boolean isMalformed3(int b1, int b2, int b3); static boolean isMalformed4(int b2, int b3, int b4); static boolean isNotContinuation(int b); static boolean isQuote(char c); static boolean isQuoted(CharSequence s); static int lastIndexOf(CharSequence s, char c); static int lowerCaseAsciiHashCode(CharSequence value, int lo, int hi); static int lowerCaseAsciiHashCode(CharSequence value); static boolean noMatch(CharSequence l, int llo, int lhi, CharSequence r, int rlo, int rhi); static ObjList<Path> splitLpsz(CharSequence args); static boolean startsWith(CharSequence _this, CharSequence that); static boolean startsWith(CharSequence _this, int thisLo, int thisHi, CharSequence that); static boolean startsWith(CharSequence _this, char c); static String stringFromUtf8Bytes(long lo, long hi); static String toLowerCaseAscii(@Nullable CharSequence value); static char toLowerCaseAscii(char character); static void toSink(BinarySequence sequence, CharSink sink); static String toString(CharSequence s); static String toString(CharSequence cs, int start, int end); static boolean utf8Decode(long lo, long hi, CharSink sink); static int utf8DecodeMultiByte(long lo, long hi, int b, CharSink sink); static int utf8DecodeMultiByteZ(long lo, int b, CharSink sink); static boolean utf8DecodeZ(long lo, CharSink sink); static final Comparator<CharSequence> CHAR_SEQUENCE_COMPARATOR; static final Comparator<CharSequence> CHAR_SEQUENCE_COMPARATOR_DESC; }