:-'Generic Commit'
This commit is contained in:
21
dropshell-build/test/src/autogen/version.hpp
Normal file
21
dropshell-build/test/src/autogen/version.hpp
Normal file
@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
|
||||
version.hpp is automatically generated by the build system, from version.hpp.in.
|
||||
|
||||
DO NOT EDIT VERSION.HPP!
|
||||
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace dropshell {
|
||||
|
||||
// Version information
|
||||
const std::string VERSION = "@PROJECT_VERSION@";
|
||||
const std::string RELEASE_DATE = "@RELEASE_DATE@";
|
||||
const std::string AUTHOR = "j842";
|
||||
const std::string LICENSE = "MIT";
|
||||
|
||||
} // namespace dropshell
|
10509
dropshell-build/test/src/httplib.hpp
Normal file
10509
dropshell-build/test/src/httplib.hpp
Normal file
File diff suppressed because it is too large
Load Diff
26
dropshell-build/test/src/main.cpp
Normal file
26
dropshell-build/test/src/main.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <libassert/assert.hpp>
|
||||
|
||||
#include "httplib.hpp"
|
||||
#include "version.hpp"
|
||||
|
||||
int main() {
|
||||
std::cout << "Retrieving IP address..." << std::endl;
|
||||
|
||||
httplib::Client cli("http://ipinfo.io");
|
||||
auto res = cli.Get("/ip");
|
||||
|
||||
ASSERT(res->status == 200, "Failed to get IP");
|
||||
|
||||
nlohmann::json j;
|
||||
j["ip"] = res->body;
|
||||
j["status"] = res->status;
|
||||
|
||||
std::cout << j.dump(4) << std::endl;
|
||||
|
||||
std::cout << "Done" << std::endl;
|
||||
|
||||
return 0;
|
||||
}
|
21
dropshell-build/test/src/version.hpp.in
Normal file
21
dropshell-build/test/src/version.hpp.in
Normal file
@ -0,0 +1,21 @@
|
||||
#pragma once
|
||||
|
||||
/*
|
||||
|
||||
version.hpp is automatically generated by the build system, from version.hpp.in.
|
||||
|
||||
DO NOT EDIT VERSION.HPP!
|
||||
|
||||
*/
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace dropshell {
|
||||
|
||||
// Version information
|
||||
const std::string VERSION = "@PROJECT_VERSION@";
|
||||
const std::string RELEASE_DATE = "@RELEASE_DATE@";
|
||||
const std::string AUTHOR = "j842";
|
||||
const std::string LICENSE = "MIT";
|
||||
|
||||
} // namespace dropshell
|
Reference in New Issue
Block a user