From 806af3a576ac4ce4d1979a225dcb49ae385000d3 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Wed, 28 Oct 2015 17:24:07 -0400 Subject: Merge to XFA: Add PDFCharIsLineEnding helper This CL adds a helper to check if a given character is a \n or \r. TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1418073006 . (cherry picked from commit 4b38229b004b7b6493cb4c4507df450adc6085f6) Review URL: https://codereview.chromium.org/1428763002 . --- core/include/fpdfapi/fpdf_parser.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/include') 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]; -- cgit v1.2.3