Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: Clear warnings #47

Merged
merged 5 commits into from Jan 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
35 changes: 28 additions & 7 deletions src/api/paths.cpp
Expand Up @@ -4,6 +4,9 @@
/**
* Blocks
**/

const char* Ark::Client::API::Paths::Blocks::base() { return "/api/v2/blocks"; }

std::string Ark::Client::API::Paths::Blocks::get(Host& newHost, const char *const blockId)
{
char url[128] = {};
Expand Down Expand Up @@ -43,9 +46,9 @@ std::pair<std::string, std::string> Ark::Client::API::Paths::Blocks::search(
char uri[96] = { };
snprintf(uri, sizeof(uri), "%s%s/search?limit=%d&page=%d", newHost.toString().c_str(), Ark::Client::API::Paths::Blocks::base(), limit, page);
std::string parameterBuffer;
int count = 0;
auto count = 0ul;
for (const auto& p : bodyParameters) {
count++;
++count;
parameterBuffer += p.first + '=' + p.second;
if (bodyParameters.size() > 1 && count < bodyParameters.size()) {
parameterBuffer += '&';
Expand All @@ -59,6 +62,9 @@ std::pair<std::string, std::string> Ark::Client::API::Paths::Blocks::search(
/**
* Delegates
**/

const char* Ark::Client::API::Paths::Delegates::base() { return "/api/v2/delegates"; }

std::string Ark::Client::API::Paths::Delegates::get(Host& newHost, const char *const identifier)
{
char url[128] = {};
Expand Down Expand Up @@ -107,8 +113,11 @@ std::string Ark::Client::API::Paths::Delegates::voters(
/******/

/**
* Delegates
* Node
**/

const char* Ark::Client::API::Paths::Node::base() { return "/api/v2/node"; }

std::string Ark::Client::API::Paths::Node::configuration(Host& newHost)
{
char url[128] = {};
Expand Down Expand Up @@ -139,6 +148,9 @@ std::string Ark::Client::API::Paths::Node::syncing(Host& newHost)
/**
* Peers
**/

const char* Ark::Client::API::Paths::Peers::base() { return "/api/v2/peers"; }

std::string Ark::Client::API::Paths::Peers::get(Host& newHost, const char *const ip)
{
char url[128] = {};
Expand All @@ -163,6 +175,9 @@ std::string Ark::Client::API::Paths::Peers::all(
/**
* Transactions
**/

const char* Ark::Client::API::Paths::Transactions::base() { return "/api/v2/transactions"; }

std::string Ark::Client::API::Paths::Transactions::getUnconfirmed(
Host& newHost,
const char *const identifier
Expand Down Expand Up @@ -228,9 +243,9 @@ std::pair<std::string, std::string> Ark::Client::API::Paths::Transactions::searc
char uri[96] = { };
snprintf(uri, sizeof(uri), "%s%s/search?limit=%d&page=%d", newHost.toString().c_str(), Ark::Client::API::Paths::Transactions::base(), limit, page);
std::string parameterBuffer;
int count = 0;
auto count = 0ul;
for (const auto& p : bodyParameters) {
count++;
++count;
parameterBuffer += p.first + '=' + p.second;
if (bodyParameters.size() > 1 && count < bodyParameters.size()) {
parameterBuffer += '&';
Expand All @@ -244,6 +259,9 @@ std::pair<std::string, std::string> Ark::Client::API::Paths::Transactions::searc
/**
* Votes
**/

const char* Ark::Client::API::Paths::Votes::base() { return "/api/v2/votes"; }

std::string Ark::Client::API::Paths::Votes::get(Host& newHost, const char *const identifier)
{
char url[128] = { };
Expand All @@ -268,6 +286,9 @@ std::string Ark::Client::API::Paths::Votes::all(
/**
* Wallets
**/

const char* Ark::Client::API::Paths::Wallets::base() { return "/api/v2/wallets"; }

std::string Ark::Client::API::Paths::Wallets::get(
Host& newHost,
const char *const identifier
Expand Down Expand Up @@ -364,9 +385,9 @@ std::pair<std::string, std::string> Ark::Client::API::Paths::Wallets::search(
char uri[96] = { };
snprintf(uri, sizeof(uri), "%s%s/search?limit=%d&page=%d", newHost.toString().c_str(), Ark::Client::API::Paths::Wallets::base(), limit, page);
std::string parameterBuffer;
int count = 0;
auto count = 0ul;
for (const auto& p : bodyParameters) {
count++;
++count;
parameterBuffer += p.first + '=' + p.second;
if (bodyParameters.size() > 1 && count < bodyParameters.size()) {
parameterBuffer += '&';
Expand Down
14 changes: 7 additions & 7 deletions src/include/cpp-client/api/paths.h
Expand Up @@ -23,7 +23,7 @@ namespace Paths {

namespace Blocks
{
static const char* base() { return "/api/v2/blocks"; };
extern const char* base();
/***/
extern std::string get(Host& newHost, const char *const blockId);
/***/
Expand All @@ -39,7 +39,7 @@ namespace Blocks

namespace Delegates
{
static const char* base() { return "/api/v2/delegates"; };
extern const char* base();
/***/
extern std::string get(Host& newHost, const char *const identifier);
/***/
Expand All @@ -55,7 +55,7 @@ namespace Delegates

namespace Node
{
static const char* base() { return "/api/v2/node"; };
extern const char* base();
/***/
extern std::string configuration(Host& newHost);
/***/
Expand All @@ -69,7 +69,7 @@ namespace Node

namespace Peers
{
static const char* base() { return "/api/v2/peers"; };
extern const char* base();
/***/
extern std::string get(Host& newHost, const char *const ip);
/***/
Expand All @@ -81,7 +81,7 @@ namespace Peers

namespace Transactions
{
static const char* base() { return "/api/v2/transactions"; };
extern const char* base();
/***/
extern std::string getUnconfirmed(Host& newHost, const char *const identifier);
/***/
Expand All @@ -101,7 +101,7 @@ namespace Transactions

namespace Votes
{
static const char* base() { return "/api/v2/votes"; };
extern const char* base();
/***/
extern std::string get(Host& newHost, const char *const identifier);
/***/
Expand All @@ -113,7 +113,7 @@ namespace Votes

namespace Wallets
{
static const char* base() { return "/api/v2/wallets"; };
extern const char* base();
/***/
extern std::string get(Host& newHost, const char *const identifier);
/***/
Expand Down