Make DirectObjectFinder public

This commit is contained in:
BobLd
2024-06-08 09:53:15 +01:00
parent 531e00e9c9
commit d96ec7a9af
2 changed files with 14 additions and 1 deletions

View File

@@ -250,6 +250,7 @@
"UglyToad.PdfPig.Outline.Destinations.NamedDestinations",
"UglyToad.PdfPig.ParsingOptions",
"UglyToad.PdfPig.Parser.IPageContentParser",
"UglyToad.PdfPig.Parser.Parts.DirectObjectFinder",
"UglyToad.PdfPig.PdfDocument",
"UglyToad.PdfPig.PdfExtensions",
"UglyToad.PdfPig.Rendering.IPageImageRenderer",

View File

@@ -5,8 +5,14 @@
using Tokenization.Scanner;
using Tokens;
internal static class DirectObjectFinder
/// <summary>
/// Direct object finder.
/// </summary>
public static class DirectObjectFinder
{
/// <summary>
/// Try and get the token value, using the <see cref="IPdfTokenScanner"/> if it is a <see cref="IndirectReferenceToken"/>.
/// </summary>
public static bool TryGet<T>(IToken? token, IPdfTokenScanner scanner, [NotNullWhen(true)] out T? tokenResult)
where T : class, IToken
{
@@ -45,6 +51,9 @@
return false;
}
/// <summary>
/// Get the token value.
/// </summary>
public static T? Get<T>(IndirectReference reference, IPdfTokenScanner scanner)
where T : class, IToken
{
@@ -83,6 +92,9 @@
}
#nullable disable
/// <summary>
/// Get the token value, using the <see cref="IPdfTokenScanner"/> if it is a <see cref="IndirectReferenceToken"/>.
/// </summary>
public static T Get<T>(IToken token, IPdfTokenScanner scanner) where T : class, IToken
{
if (token is T result)