|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<ClientLineEnding>
com.perforce.p4java.impl.generic.client.ClientLineEnding
public enum ClientLineEnding
Defines the various line ending mappings needed for text files in the transfer between client and server.
Crucially important for Windows / Mac / Linux / Nintendo (etc.) text files; explanations are given elsewhere...
Enum Constant Summary | |
---|---|
FST_L_CR
|
|
FST_L_CRLF
|
|
FST_L_LF
|
|
FST_L_LFCRLF
|
|
FST_L_LOCAL
|
Field Summary | |
---|---|
static boolean |
CONVERT_TEXT
|
static byte[] |
FST_L_CR_BYTES
|
static char |
FST_L_CR_CHAR
|
static byte[] |
FST_L_CRLF_BYTES
|
static byte[] |
FST_L_LF_BYTES
|
static char |
FST_L_LF_CHAR
|
static byte[] |
FST_L_LFCRLF_BYTES
|
static byte[] |
FST_L_LOCAL_BYTES
|
static String |
LINESEP_PROPS_KEY
The key for the system-wide line separator. |
static 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. |
Method Summary | |
---|---|
static void |
convertMap(Map<String,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(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(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. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
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
Field Detail |
---|
public static final String LINESEP_PROPS_KEY
public static final 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 boolean CONVERT_TEXT
Method Detail |
---|
public static ClientLineEnding[] values()
for (ClientLineEnding c : ClientLineEnding.values()) System.out.println(c);
public static ClientLineEnding valueOf(String name)
name
- the name of the enum constant to be returned.
IllegalArgumentException
- if this enum type has no constant
with the specified name
NullPointerException
- if the argument is nullpublic static ClientLineEnding decodeFromServerString(String str, RpcPerforceFileType fileType)
Hence the anomalous-looking second parameter here....
public static boolean needsLineEndFiltering(ClientLineEnding lineEndSpec)
public static byte[] getLineEndBytes(ClientLineEnding lineEndSpec)
FST_L_LOCAL_BYTES
.
public static void convertMap(Map<String,Object> map)
FST_L_LF_BYTES
values from localLineEndStr
. The
conversion will be done in place.
map
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |