| 1 | /************************************************************************* |
| 2 | * libjson-rpc-cpp |
| 3 | ************************************************************************* |
| 4 | * @file specificationwriter.h |
| 5 | * @date 30.04.2013 |
| 6 | * @author Peter Spiess-Knafl <dev@spiessknafl.at> |
| 7 | * @license See attached LICENSE.txt |
| 8 | ************************************************************************/ |
| 9 | |
| 10 | #ifndef JSONRPC_CPP_SPECIFICATIONWRITER_H |
| 11 | #define JSONRPC_CPP_SPECIFICATIONWRITER_H |
| 12 | |
| 13 | #include "procedure.h" |
| 14 | #include "specification.h" |
| 15 | |
| 16 | namespace jsonrpc { |
| 17 | class SpecificationWriter { |
| 18 | public: |
| 19 | static Json::Value toJsonValue(const std::vector<Procedure> &procedures); |
| 20 | static std::string toString(const std::vector<Procedure> &procedures); |
| 21 | static bool toFile(const std::string &filename, const std::vector<Procedure> &procedures); |
| 22 | |
| 23 | private: |
| 24 | static Json::Value toJsonLiteral(jsontype_t type); |
| 25 | static void procedureToJsonValue(const Procedure &procedure, Json::Value &target); |
| 26 | }; |
| 27 | } // namespace jsonrpc |
| 28 | |
| 29 | #endif // JSONRPC_CPP_SPECIFICATIONWRITER_H |
| 30 | |