A version of jinja2cpp for inclusion in gd-webview.
axel -a -n6 https://archives.boost.io/release/1.74.0/source/boost_1_74_0.tar.gz
tar -xzf boost_1_74_0.tar.gz
rm boost_1_74_0.tar.gz
cd boost_1_74_0
./bootstrap.sh
sudo ./b2 --with-atomic --with-system --with-filesystem variant=release link=static runtime-link=static cflags=-fPIC cxxflags=-fPIC install -a --prefix=/usr/local/boost/Download the installer boost_1_74_0-msvc-14.2-64.exe
it installs into C:\local\boost_1_74_0
- A more straightforward
CMakeLists.txt - Removed git submodules, vendor instead
- Removed support for the
nlohmann/jsonlibrary (only support RapidJSON) - Removed support for the Conan build system (only support CMake)
- Removed test suite and CI/CD definition(s)
- Added support for
ccache(compilation cache) - Removed documentation
install into /usr/local/jinja/:
cmake -Bbuild -DCMAKE_INSTALL_PREFIX=/usr/local/jinja/ .
make -Cbuild -j4
sudo make -Cbuild install#include <iostream>
#include <string>
#include "jinja2cpp/template.h"
using namespace jinja2;
int main(void) {
std::string source = R"(
{% if TrueVal %}
Hello from Jinja template!
{% endif %}
)";
Template tpl;
tpl.Load(source);
ValuesMap params = {
{"TrueVal", true},
{"FalseVal", true},
};
std::string result = tpl.RenderAsString(params).value();
std::cout << result << std::endl;
return 0;
}RapidJSON:
#include <iostream>
#include <string>
#include "jinja2cpp/template.h"
#include <jinja2cpp/binding/rapid_json.h>
using namespace jinja2;
int main(void) {
const char *json = R"(
{
"message": "Hello World from Parser!",
"big_int": 100500100500100,
"bool_true": true
}
)";
rapidjson::Document doc;
doc.Parse(json);
std::string source = R"(
{{ json.message }}
)";
Template tpl;
tpl.Load(source);
ValuesMap params = {
{"json", Reflect(doc)},
};
std::string result = tpl.RenderAsString(params).value();
std::cout << result << std::endl;
return 0;
}remove throw everywhere, so we can compile MacOS scons with disable_exceptions=no removed.
MPL 2.0