1 //! \file ToJsonWriter.h
3 #ifndef _TOJSONWRITER_H
4 #define _TOJSONWRITER_H
7 #include "ADataOutput.h"
9 /*! Output module: write to json.
10 * "ugly", non-human-readable JSON, though.
12 class ToJsonWriter
: public ADataOutput
15 /*! Convert article to string representation of JSON representation.
16 * \param a pointer to article to be converted
17 * \return json as string
18 * \internal uses the following format:
19 * {"title":{"forward_links":[...]}}
21 std::string
convertToJson(const Article
* a
);
23 /*! Convert article collection to string representation of JSON representation.
24 * \param ac reference to article collection to be converted
25 * \return json as string
26 * \internal uses the following format:
27 * {"title":{"forward_links":[...]}, "title2":{"forward_links":[...]}, ...}
29 std::string
convertToJson(const ArticleCollection
& ac
);
31 //! Output JSON data to output stream
32 virtual void output(const Article
*, std::ostream
&);
33 //! Output JSON data to output stream
34 virtual void output(const ArticleCollection
&, std::ostream
&);
37 #endif // _TOJSONWRITER_H