Create c++ project

This commit is contained in:
Guilherme Werner
2023-12-01 21:19:37 -03:00
parent 482662b7bd
commit 64c60a294c
24 changed files with 9882 additions and 32 deletions

5
include/tribufu.h Normal file
View File

@ -0,0 +1,5 @@
// Copyright (c) Tribufu. All Rights Reserved.
#pragma once
#include <tribufu/sdk.h>

35
include/tribufu/client.h Normal file
View File

@ -0,0 +1,35 @@
// Copyright (c) Tribufu. All Rights Reserved.
#pragma once
#include <tribufu/pch.h>
#include <cpp-httplib/httplib.h>
const char *VERSION = "0.0.4";
class TribufuClient
{
private:
uint64_t id;
std::string secret;
// httplib::Client http;
public:
TribufuClient(uint64_t id, const std::string &secret) //: http("https://api.tribufu.com")
{
this->id = id;
this->secret = secret;
/*
this->http.set_default_headers({{"User-Agent", "Tribufu/" + std::string(VERSION) + " (+https://api.tribufu.com; C++)"},
{"X-Tribufu-Language", "cpp"},
{"X-Tribufu-Version", VERSION}});
*/
}
uint64_t get_id() const
{
return this->id;
}
};

12
include/tribufu/pch.h Normal file
View File

@ -0,0 +1,12 @@
// Copyright (c) Tribufu. All Rights Reserved.
#pragma once
#ifdef __cplusplus
#include <iostream>
#include <string>
#else
#error "C++ compiler required."
#endif

5
include/tribufu/sdk.h Normal file
View File

@ -0,0 +1,5 @@
// Copyright (c) Tribufu. All Rights Reserved.
#pragma once
#include <tribufu/client.h>