first commit to move to svelte
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
#include <cstdint>
|
||||
#include <filesystem>
|
||||
#include <map>
|
||||
#include "json.hpp"
|
||||
|
||||
namespace utils {
|
||||
std::map<std::string, std::string> parseBody(const std::string& body);
|
||||
@@ -21,6 +22,17 @@ namespace utils {
|
||||
std::filesystem::path getDataDir();
|
||||
|
||||
std::string urlDecode(const std::string& str);
|
||||
|
||||
std::string currentTime();
|
||||
|
||||
template<typename T>
|
||||
std::string toJsonArray(const std::vector<T>& data){
|
||||
nlohmann::json arr = nlohmann::json::array();
|
||||
for (auto& c : data) {
|
||||
arr.push_back(nlohmann::json(c));
|
||||
}
|
||||
return arr.dump();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user