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

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   uCalc::Transformer t;

   // Define multiple rules with the same anchor ("Log:")
   t.FromTo("Log: {msg}", "DEFAULT: {msg}");
   t.FromTo("Log: ERROR {msg}", "CRITICAL: {msg}");
   auto lastRule = t.FromTo("Log: INFO {msg}", "INFO: {msg}"); // This has the highest priority

   cout << "--- Overload Chain for 'Log:' anchor ---" << endl;
   auto currentRule = lastRule;
   do {
      cout << "Pattern: '" << currentRule.Pattern() << "' -> Replacement: '" << currentRule.Replacement() << "'" << endl;
      currentRule = currentRule.NextOverload();
   } while (currentRule.NotEmpty());
}