summaryrefslogtreecommitdiff
path: root/core/include/fpdfapi/fpdf_parser.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2015-10-28 17:14:42 -0400
committerDan Sinclair <dsinclair@chromium.org>2015-10-28 17:14:42 -0400
commit4b38229b004b7b6493cb4c4507df450adc6085f6 (patch)
tree0903be4cebd03e7f9d1991ded3c438f628efae92 /core/include/fpdfapi/fpdf_parser.h
parentda6254ff78553773b7bb637ee1e3f5111c083c74 (diff)
downloadpdfium-4b38229b004b7b6493cb4c4507df450adc6085f6.tar.xz
Add PDFCharIsLineEnding helper
This CL adds a helper to check if a given character is a \n or \r. R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1418073006 .
Diffstat (limited to 'core/include/fpdfapi/fpdf_parser.h')
-rw-r--r--core/include/fpdfapi/fpdf_parser.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/include/fpdfapi/fpdf_parser.h b/core/include/fpdfapi/fpdf_parser.h
index d121bb4f79..32509eb837 100644
--- a/core/include/fpdfapi/fpdf_parser.h
+++ b/core/include/fpdfapi/fpdf_parser.h
@@ -61,6 +61,10 @@ inline bool PDFCharIsOther(uint8_t c) {
return PDF_CharType[c] == 'R';
}
+inline bool PDFCharIsLineEnding(uint8_t c) {
+ return c == '\r' || c == '\n';
+}
+
// Indexed by 8-bit char code, contains unicode code points.
extern const FX_WORD PDFDocEncoding[256];