initial import of salvium submodule and associated changes (not functional)
This commit is contained in:
32
salvium_libwallet2_api_c/src/main/cpp/helpers.hpp
Normal file
32
salvium_libwallet2_api_c/src/main/cpp/helpers.hpp
Normal file
@@ -0,0 +1,32 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include <sstream>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
|
||||
// Debug macros
|
||||
#define DEBUG_START() \
|
||||
try {
|
||||
|
||||
#define DEBUG_END() \
|
||||
} catch (const std::exception &e) { \
|
||||
std::cerr << "Exception caught in function: " << __FUNCTION__ \
|
||||
<< " at " << __FILE__ << ":" << __LINE__ << std::endl \
|
||||
<< "Message: " << e.what() << std::endl; \
|
||||
std::abort(); \
|
||||
} catch (...) { \
|
||||
std::cerr << "Unknown exception caught in function: " << __FUNCTION__ \
|
||||
<< " at " << __FILE__ << ":" << __LINE__ << std::endl; \
|
||||
std::abort(); \
|
||||
}
|
||||
|
||||
|
||||
const char* vectorToString(const std::vector<std::string>& vec, const std::string separator);
|
||||
const char* vectorToString(const std::vector<uint32_t>& vec, const std::string separator);
|
||||
const char* vectorToString(const std::vector<uint64_t>& vec, const std::string separator);
|
||||
const char* vectorToString(const std::vector<std::set<uint32_t>>& vec, const std::string separator);
|
||||
const char* vectorToString(const std::set<uint32_t>& intSet, const std::string separator);
|
||||
std::set<std::string> splitString(const std::string& str, const std::string& delim);
|
||||
std::vector<uint64_t> splitStringUint(const std::string& str, const std::string& delim);
|
||||
std::vector<std::string> splitStringVector(const std::string& str, const std::string& delim);
|
||||
Reference in New Issue
Block a user