Refactor json return type generation.

This commit is contained in:
chriseth
2017-01-26 18:21:19 +01:00
parent ff8008cdf7
commit a9c6ff4ac8
5 changed files with 49 additions and 51 deletions
+10
View File
@@ -37,6 +37,8 @@ namespace solidity
// Forward declarations
class ContractDefinition;
class Type;
using TypePointer = std::shared_ptr<Type const>;
struct DocTag;
enum class DocumentationType: uint8_t;
@@ -84,6 +86,14 @@ public:
static Json::Value devDocumentation(ContractDefinition const& _contractDef);
private:
/// @returns a json value suitable for a list of types in function input or output
/// parameters or other places. If @a _forLibrary is true, complex types are referenced
/// by name, otherwise they are anonymously expanded.
static Json::Value formatTypeList(
std::vector<std::string> const& _names,
std::vector<TypePointer> const& _types,
bool _forLibrary
);
/// @returns concatenation of all content under the given tag name.
static std::string extractDoc(std::multimap<std::string, DocTag> const& _tags, std::string const& _name);
};