From 9f74c84c22e75103c5661b4876fde2ce45f9c712 Mon Sep 17 00:00:00 2001 From: George Abbott Date: Thu, 12 Oct 2023 23:45:24 +0100 Subject: Replace RssInfo with RssMeta --- source/app.d | 10 +++++----- source/rssmeta.d | 13 +++++++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) (limited to 'source') diff --git a/source/app.d b/source/app.d index cb57d19..15ebee2 100644 --- a/source/app.d +++ b/source/app.d @@ -89,16 +89,16 @@ void usage() // TODO: RssInfo. We need the struct, with the relevant information, and where // do we get it from? -void create_rss(Entry[] entries, RssInfo info) +void create_rss(Entry[] entries, RssMeta info) { string ret; ret = "\n" ~ "\t\t\n" ~ - "\t\t" ~ info.title ~ "\n" ~ - "\t\t" ~ info.description ~ "\n" ~ - "\t\t" ~ info.language ~ "\n" ~ - "\t\t"; + "\t\t" ~ info.title_of_feed ~ "\n" ~ + "\t\t" ~ info.desc_of_feed ~ "\n" ~ + "\t\t" ~ info.language_of_feed ~ "\n" ~ + "\t\t"; for (int i = 0; i < entries.length; ++i) { diff --git a/source/rssmeta.d b/source/rssmeta.d index 864503c..d190c69 100644 --- a/source/rssmeta.d +++ b/source/rssmeta.d @@ -17,8 +17,11 @@ struct RssMeta { this.metafile = metafile; - if (metafile[-4:] == ".json") {} - else if (metafile[-4:] == ".xml") {} + if (metafile[-4:] == ".json") + { + // NOTE: implement XML first, then JSON after. + } + else if (metafile[-4:] == ".xml") { /* TODO: implement parsing RssMeta */ } else { writeln("Cannot deduce whether metafile is json or xml. Please" ~ @@ -36,4 +39,10 @@ struct RssMeta string link_of(string filename) const { return ""; } string pubdate_of(string filename) const { return ""; } string guid_of(string filename) const { return ""; } + + // TODO: implement all these. + string title_of_feed() const { return ""; } + string desc_of_feed() const { return ""; } + string language_of_feed() const { return ""; } + string link_of_feed() const { return ""; } } -- cgit v1.2.1