Add QuotedString class to handle Git path style quoting rules
Git patch files can contain file names which are quoted using the
roughly the C language quoting rules. In order to correctly create
or parse these files we must implement a quoting style that matches
those specific rules.
QuotedString itself is an abstract API so callers can be passed a
quoting style based on the context of where their output will be
used, and multiple styles could be supported. This may be useful
if jgit ever grows a "git for-each-ref" style of output where Perl,
Python, Tcl and Bourne style quoting might be necessary.
References through the singleton QuotedString.GIT_PATH should be
able to bypass the virtual function table, as the specific type is
mentioned in the field declaration and that type is final. A good
JIT should be able to remove the abstraction costs when the caller
has hardcoded the quoting style.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>