Skip to content

Commit 0fee01a

Browse files
committed
Add method for detecting start of line
git-svn-id: https://svn.apache.org/repos/asf/commons/proper/csv/trunk@1306322 13f79535-47bb-0310-9956-ffa450edef68
1 parent 93089b2 commit 0fee01a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/main/java/org/apache/commons/csv/Lexer.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,16 @@ boolean isEndOfLine(int c) throws IOException {
111111
return (c == '\n' || c == '\r');
112112
}
113113

114+
/**
115+
* Checks if the current character represents the start of a line:
116+
* a CR, LF or is at the start of the file.
117+
*
118+
* @param c
119+
* @return true if the character is at the start of a line.
120+
*/
121+
boolean isStartOfLine(int c) {
122+
return c == '\n' || c == '\r' || c == ExtendedBufferedReader.UNDEFINED;
123+
}
114124
/**
115125
* @return true if the given character indicates end of file
116126
*/

0 commit comments

Comments
 (0)