Allow FileHeader to create its HunkHeader children
By using a factory method on FileHeader we can later subclass the
FileHeader class to handle "diff --cc" style patches, and let it
create its own subclass of HunkHeader to handle the specialized
form of the n-way diff.
The getParentCount() method is hard-coded to return 1 in the 2-way
diff case as there is exactly one parent. But in a "diff --cc" we
need to verify the hunk header has the same number of parents as
the file header in order to parse the hunk. So a subclass of the
FileHeader would need to override getParentCount() to return the
actual number of '@' symbols (less 1) that should appear in each
hunk header line. (E.g. a 3-way diff shows "@@@ -" so the parent
count should be 2.)
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>