#include <iostream>
#include "uCalc.h"

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   {
      uCalc::Transformer t;
      t.Owned(); // Causes t to be released when it goes out of scope
      // 1. Define rules to remove whitespace and newlines.
      // The engine's default QuoteSensitive=true ensures whitespace inside strings is protected.
      t.FromTo("{@Whitespace}", "");
      t.FromTo("{@Newline}", "");

      // 2. Define the formatted input string.
      auto formattedJson = R"({
  "id": 123,
  "name": "Example, with spaces",
  "tags": [
    "A",
    "B"
  ]
})";

      // 3. Run the transformation and print the result.
      cout << t.Transform(formattedJson) << endl;
   }
}