Files
PdfPig/src/UglyToad.PdfPig.Tokenization/EndOfLineTokenizer.cs
Eliot Jones bbde38f656 move tokenizers to their own project
since both pdfs and Adobe Type1 fonts use postscript type objects, tokenization is needed by the main project and the fonts project
2020-01-05 10:40:44 +00:00

29 lines
657 B
C#

namespace UglyToad.PdfPig.Tokenization
{
using Core;
using Tokens;
/// <summary>
/// Read an <see cref="EndOfLineToken"/>.
/// </summary>
public class EndOfLineTokenizer : ITokenizer
{
/// <inheritdoc />
public bool ReadsNextByte { get; } = false;
/// <inheritdoc />
public bool TryTokenize(byte currentByte, IInputBytes inputBytes, out IToken token)
{
token = null;
if (currentByte != '\r' && currentByte != '\n')
{
return false;
}
token = EndOfLineToken.Token;
return true;
}
}
}