-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0bc1787
commit 1e11a30
Showing
4 changed files
with
78 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#include "pch.h" | ||
#include "PhantasmaAPI.h" | ||
|
||
PhantasmaAPI::PhantasmaAPI() | ||
{ | ||
} | ||
|
||
|
||
PhantasmaAPI::~PhantasmaAPI() | ||
{ | ||
} | ||
|
||
std::string FieldToString(value json, string_t field) | ||
{ | ||
return utility::conversions::to_utf8string(json.at(field).as_string().c_str()); | ||
} | ||
|
||
uint16_t FieldToNumber(value json, string_t field) | ||
{ | ||
return json.at(field).as_integer(); | ||
} | ||
|
||
{{#each types}} | ||
struct {{#fix-type Key}} | ||
{ | ||
{{#each Value}} {{#fix-type FieldType.Name}} {{#if FieldType.IsArray}}* {{/if}} {{Name}}; //{{Key.Description}} | ||
}; | ||
{{/each}} | ||
|
||
class PhantasmaAPI | ||
{ | ||
public: | ||
PhantasmaAPI(std::string host); | ||
~PhantasmaAPI(); | ||
|
||
{{#each methods}} | ||
//{{Info.Description}} | ||
{{Info.ReturnType.Name}} {{Info.Name}} ({{#each Info.Parameters}}{{#fix-type Type.Name}} {{Name}}) | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "pch.h" | ||
#include <cpprest/http_client.h> | ||
#include <cpprest/filestream.h> | ||
#include <cpprest/http_listener.h> // HTTP server | ||
#include <cpprest/json.h> // JSON library | ||
#include <cpprest/ws_client.h> // WebSocket client | ||
|
||
using namespace utility; // Common utilities like string conversions | ||
using namespace web; // Common features like URIs. | ||
using namespace http; // Common HTTP functionality | ||
using namespace client; // HTTP client features | ||
using namespace concurrency::streams; // Asynchronous streams | ||
using namespace json; // JSON library | ||
|
||
#pragma once | ||
|
||
{{#each types}} | ||
struct {{#fix-type Key}}Result | ||
{ | ||
{{#each Value}} {{#fix-type FieldType.Name}}{{#if FieldType.IsArray}}* {{/if}}{{Name}}; //{{Key.Description}} | ||
{{/each}} | ||
}; | ||
|
||
|
||
class PhantasmaAPI | ||
{ | ||
public: | ||
PhantasmaAPI(); | ||
~PhantasmaAPI(); | ||
|
||
{{#each methods}} | ||
//{{Info.Description}} | ||
{{Info.ReturnType.Name}} {{Info.Name}} ({{#each Info.Parameters}}{{#fix-type Type.Name}} {{Name}} {{#if !@last}}, {{/if}}{{/each}}) | ||
}; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
String,std::string | ||
UInt32,uint32_t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters