// Represents the RssMeta struct, containing the metadata with some fns to // access it easily. import dxml; import entry; struct RssMeta { // TODO // The RssMeta should be a lookup table: we have a key (the filename given // in rssmeta.xml, etc.; and we have a set of values, e.g. the title, link, // etc. values which form the metadata. string metafile; string[Entry] lookup; this(string metafile) { this.metafile = metafile; if (metafile[-4:] == ".json") {} else if (metafile[-4:] == ".xml") {} else { writeln("Cannot deduce whether metafile is json or xml. Please" ~ " ensure it is called either rssmeta.xml or rssmeta.json."); exit(1); } } // filename: either just name or fully qualified should work. string title_of(string filename) const { // TODO: we need to sort out the internal magic of RssMeta first, then // we can just do a lookup on the filename. } string link_of(string filename) const { return ""; } string pubdate_of(string filename) const { return ""; } string guid_of(string filename) const { return ""; } }