1
0
Fork 0
mirror of https://github.com/sbrl/PolyFeed.git synced 2024-12-24 10:45:02 +00:00

Add IParserProvider interface.

Next up: decouple the existing HTML provider from FeedBuilder
This commit is contained in:
Starbeamrainbowlabs 2019-08-10 18:14:50 +01:00
parent 72a9f401ba
commit 44fe2472c3
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 28 additions and 0 deletions

View file

@ -0,0 +1,26 @@
using System;
using System.Net;
using Microsoft.SyndicationFeed.Atom;
namespace PolyFeed.ParserProviders
{
/// <summary>
/// Defines the functionality that a source parser should provide.
/// Sources are represented by a <see cref="FeedSource" /> object, and source parsers
/// are responsible for parsing it and populating a given atom feed.
/// </summary>
public interface IParserProvider
{
/// <summary>
/// Sets the output feed that parsed output should be written to.
/// </summary>
/// <param name="feed">The output feed writer that output should be written to.</param>
void SetOutputFeed(AtomFeedWriter feed);
/// <summary>
/// Parses a web response that's paired with a given <see cref="FeedSource" />.
/// </summary>
/// <param name="source">The <see cref="FeedSource"/> object that the <paramref name="response"/> was generated from.</param>
/// <param name="response">The <see cref="WebResponse"/> in question needs parsing.</param>
void ParseWebResponse(FeedSource source, WebResponse response);
}
}

View file

@ -152,6 +152,7 @@
<Compile Include="Helpers\HtmlHelpers.cs" />
<Compile Include="Helpers\UserAgentHelper.cs" />
<Compile Include="Helpers\ReflectionHelpers.cs" />
<Compile Include="ParserProviders\IParserProvider.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
@ -159,6 +160,7 @@
<ItemGroup>
<Folder Include="Salamander.Core\" />
<Folder Include="Helpers\" />
<Folder Include="ParserProviders\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets" Condition="Exists('..\packages\NETStandard.Library.2.0.3\build\netstandard2.0\NETStandard.Library.targets')" />