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

using namespace std;
using namespace uCalcSoftware;

int main() {
   uCalc uc;
   {
      uCalc::String s("root [child] end");
      s.Owned(); // Causes s to be released when it goes out of scope

      // Get a live view of the block including the brackets
      auto view = s.BetweenInclusive("'['", "']'");

      cout << "Initial parent string: " << s << endl;
      cout << "Initial view: " << view << endl;

      // Modify the view. The change will propagate to the parent.
      view.Replace("child", "MODIFIED");

      cout << "Final parent string: " << s << endl;
   }
}