drogon/tests/HttpViewDataTest.cc

13 lines
503 B
C++
Raw Normal View History

2018-10-05 22:43:51 +08:00
#include <drogon/HttpViewData.h>
#include <iostream>
int main()
{
drogon::HttpViewData data;
2018-10-14 15:56:54 +08:00
std::cout << (data.insert("1", 1), data.get<int>("1")) << std::endl;
std::cout << (data.insertAsString("2", 2.0), data.get<std::string>("2")) << std::endl;
std::cout << (data.insertFormattedString("3", "third value is %d", 3),
data.get<std::string>("3"))
<< std::endl;
std::cout << (data.insertAsString("4", "4"), data.get<std::string>("4")) << std::endl;
2018-11-16 13:26:14 +08:00
}