mirror of
https://github.com/sbrl/PolyFeed.git
synced 2024-11-24 06:43:01 +00:00
Add IParserProvider interface.
Next up: decouple the existing HTML provider from FeedBuilder
This commit is contained in:
parent
72a9f401ba
commit
44fe2472c3
2 changed files with 28 additions and 0 deletions
26
PolyFeed/ParserProviders/IParserProvider.cs
Normal file
26
PolyFeed/ParserProviders/IParserProvider.cs
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -152,6 +152,7 @@
|
||||||
<Compile Include="Helpers\HtmlHelpers.cs" />
|
<Compile Include="Helpers\HtmlHelpers.cs" />
|
||||||
<Compile Include="Helpers\UserAgentHelper.cs" />
|
<Compile Include="Helpers\UserAgentHelper.cs" />
|
||||||
<Compile Include="Helpers\ReflectionHelpers.cs" />
|
<Compile Include="Helpers\ReflectionHelpers.cs" />
|
||||||
|
<Compile Include="ParserProviders\IParserProvider.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<None Include="packages.config" />
|
<None Include="packages.config" />
|
||||||
|
@ -159,6 +160,7 @@
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Folder Include="Salamander.Core\" />
|
<Folder Include="Salamander.Core\" />
|
||||||
<Folder Include="Helpers\" />
|
<Folder Include="Helpers\" />
|
||||||
|
<Folder Include="ParserProviders\" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
<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')" />
|
<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')" />
|
||||||
|
|
Loading…
Reference in a new issue