public enum ClientLineEnding extends java.lang.Enum<ClientLineEnding>
Crucially important for Windows / Mac / Linux / Nintendo (etc.) text files; explanations are given elsewhere...
Enum Constant and Description |
---|
FST_L_CR |
FST_L_CR_UTF_16BE |
FST_L_CR_UTF_16LE |
FST_L_CRLF |
FST_L_CRLF_UTF_16BE |
FST_L_CRLF_UTF_16LE |
FST_L_LF |
FST_L_LF_UTF_16BE |
FST_L_LF_UTF_16LE |
FST_L_LFCRLF |
FST_L_LFCRLF_UTF_16BE |
FST_L_LFCRLF_UTF_16LE |
FST_L_LOCAL |
Modifier and Type | Field and Description |
---|---|
static boolean |
CONVERT_TEXT |
static byte[] |
FST_L_CR_BYTES |
static char |
FST_L_CR_CHAR |
static byte[] |
FST_L_CR_UTF_16BE_BYTES |
static byte[] |
FST_L_CR_UTF_16LE_BYTES |
static byte[] |
FST_L_CRLF_BYTES |
static byte[] |
FST_L_CRLF_UTF_16BE_BYTES |
static byte[] |
FST_L_CRLF_UTF_16LE_BYTES |
static byte[] |
FST_L_LF_BYTES |
static char |
FST_L_LF_CHAR |
static byte[] |
FST_L_LF_UTF_16BE_BYTES |
static byte[] |
FST_L_LF_UTF_16LE_BYTES |
static byte[] |
FST_L_LFCRLF_BYTES |
static byte[] |
FST_L_LFCRLF_UTF_16BE_BYTES |
static byte[] |
FST_L_LFCRLF_UTF_16LE_BYTES |
static byte[] |
FST_L_LOCAL_BYTES |
static java.lang.String |
LINESEP_PROPS_KEY
The key for the system-wide line separator.
|
static java.lang.String |
localLineEndStr
The local line end string, as retrieved from the system
properties.
|
static byte |
PERFORCE_SERVER_LINE_END_BYTE
What the Perforce server uses internally to signal line end.
|
Modifier and Type | Method and Description |
---|---|
static void |
convertMap(java.util.Map<java.lang.String,java.lang.Object> map)
Convert the line endings for any string found in the map to the
FST_L_LF_BYTES values from localLineEndStr . |
static ClientLineEnding |
decodeFromServerString(java.lang.String str,
RpcPerforceFileType fileType)
Decode the file's actual or intended line ending type from the passed-in
string.
|
static byte[] |
getLineEndBytes(ClientLineEnding lineEndSpec)
Return the byte array corresponding to the client line ending.
|
static boolean |
needsLineEndFiltering(ClientLineEnding lineEndSpec)
Determine whether we really need to translate newlines.
|
static ClientLineEnding |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ClientLineEnding[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ClientLineEnding FST_L_LOCAL
public static final ClientLineEnding FST_L_LF
public static final ClientLineEnding FST_L_CR
public static final ClientLineEnding FST_L_CRLF
public static final ClientLineEnding FST_L_LFCRLF
public static final ClientLineEnding FST_L_LF_UTF_16BE
public static final ClientLineEnding FST_L_CR_UTF_16BE
public static final ClientLineEnding FST_L_CRLF_UTF_16BE
public static final ClientLineEnding FST_L_LFCRLF_UTF_16BE
public static final ClientLineEnding FST_L_LF_UTF_16LE
public static final ClientLineEnding FST_L_CR_UTF_16LE
public static final ClientLineEnding FST_L_CRLF_UTF_16LE
public static final ClientLineEnding FST_L_LFCRLF_UTF_16LE
public static final java.lang.String LINESEP_PROPS_KEY
public static final java.lang.String localLineEndStr
public static final byte PERFORCE_SERVER_LINE_END_BYTE
public static final byte[] FST_L_LOCAL_BYTES
public static final char FST_L_LF_CHAR
public static final char FST_L_CR_CHAR
public static final byte[] FST_L_LF_BYTES
public static final byte[] FST_L_CR_BYTES
public static final byte[] FST_L_CRLF_BYTES
public static final byte[] FST_L_LFCRLF_BYTES
public static final byte[] FST_L_LF_UTF_16BE_BYTES
public static final byte[] FST_L_CR_UTF_16BE_BYTES
public static final byte[] FST_L_CRLF_UTF_16BE_BYTES
public static final byte[] FST_L_LFCRLF_UTF_16BE_BYTES
public static final byte[] FST_L_LF_UTF_16LE_BYTES
public static final byte[] FST_L_CR_UTF_16LE_BYTES
public static final byte[] FST_L_CRLF_UTF_16LE_BYTES
public static final byte[] FST_L_LFCRLF_UTF_16LE_BYTES
public static final boolean CONVERT_TEXT
public static ClientLineEnding[] values()
for (ClientLineEnding c : ClientLineEnding.values()) System.out.println(c);
public static ClientLineEnding valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static ClientLineEnding decodeFromServerString(java.lang.String str, RpcPerforceFileType fileType)
Hence the anomalous-looking second parameter here....
str
- line ending stringfileType
- file typepublic static boolean needsLineEndFiltering(ClientLineEnding lineEndSpec)
lineEndSpec
- client line-endingpublic static byte[] getLineEndBytes(ClientLineEnding lineEndSpec)
FST_L_LOCAL_BYTES
.lineEndSpec
- client line-endingpublic static void convertMap(java.util.Map<java.lang.String,java.lang.Object> map)
FST_L_LF_BYTES
values from localLineEndStr
. The
conversion will be done in place.map
- map spec