Helpers

Three small utility classes live under vendors/Garvan/include/tools/. You'll meet them as you write controllers and services.

Helper

The Helper class is the base of both BaseContoller and BaseService. It provides convenience methods that don't fit anywhere else — date formatting, slug generation, response building.

#include "tools/Helper.h"

std::string slug = Helper::slug("Hello, World!"); // "hello-world"

JsonValue

A wrapper around crow::json::wvalue with helpers for nested objects and arrays. Use it as the return type of service and controller methods:

#include "tools/JsonValue.h"
using json = JsonValue;

json out;
out["status"] = "ok";
out["data"]   = json::Array();
out["data"].append({ {"id", 1}, {"name", "Ada"} });
return out;

Logger

Already covered on the Logging page. Use it whenever you want to log something from a place where the Crow logger isn't reachable.