package com.perforce.cvs.parser.rcstypes; import java.util.ArrayList; import java.util.Iterator; public class RcsObjectBlock implements Iterable<String> { private ArrayList<String> lines = new ArrayList<String>(); public RcsObjectBlock() { } public RcsObjectBlock(RcsObjectBlock block) { lines.addAll(block.getLines()); } public int size() { return lines.size(); } public void add(String line) { lines.add(line); } public void insert(int line, RcsObjectBlock block) { lines.addAll(line, block.getLines()); } public void remove(int line, int count) { while (count > 0) { lines.remove(line - 1); count--; } } public void clean() { ArrayList<String> clean = new ArrayList<String>(); for (String line : lines) { if (line != null) { clean.add(line); } } lines = clean; } public String toString() { StringBuffer sb = new StringBuffer("\n"); int p = 1; for (String line : lines) { if (line != null) { sb.append(p); sb.append(": "); sb.append(line); sb.append("\n"); p++; } } return sb.toString(); } public ArrayList<String> getLines() { return lines; } @Override public Iterator<String> iterator() { return lines.iterator(); } }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#6 | 13920 | Paul Allen | copy part 2 (no errors) | ||
#5 | 11745 | Paul Allen |
CVS: Parse non-standard RCS file, where 'log' and 'text' are on the same line. Support alternative delete method - added test case 054 to support parse changes - added test case 055 to support alternatice delete method |
||
#4 | 10957 | Paul Allen |
CVS parse RCS delta fix to regex. - added more debugging |
||
#3 | 10653 | Paul Allen | Debugging data for low level byte operations. | ||
#2 | 10497 | Paul Allen |
New low-level RCS reader using a byte[] to manage CVS lines. Designed to help with the processing of BINARY data in RCS files. The line reading code still looks for a unix style '\n', but has a MAX LINE (hard coded to 10K). The RcsObjectBlock uses a ByteArrayOutputStream to store lines and parsers uses byte logic. (passes basic cvs/svn unit tests) |
||
#1 | 9807 | Paul Allen | Initial import of p4-convert (from change 894340) |