#include #include "uCalc.h" using namespace std; using namespace uCalcSoftware; int main() { uCalc uc; auto FruitsXML = R"( )"; uCalc::Transformer t; t.Text(FruitsXML); auto fruitsTagRule = t.Pattern(""); auto fruitRule = t.Pattern("CommonName={@string:name}"); cout << "--- Using Minimum (Rule-Level Invalidation) ---" << endl; fruitRule.Minimum(4); // Rule fails if fewer than 4 fruits are found. t.Find(); cout << "Match count when fruit rule fails: " << t.Matches().Count() << endl; cout << "Matches found:" << endl; for(auto m : t.Matches()) { cout << " " << m.Text() << endl; }; cout << "" << endl; cout << "--- Using GlobalMinimum (Transformer-Level Invalidation) ---" << endl; fruitRule.Minimum(0); // Reset local minimum fruitRule.GlobalMinimum(4); // Transformer fails if fewer than 4 fruits are found. t.Find(); cout << "Match count when global rule fails: " << t.Matches().Count() << endl; cout << "Matches found:" << endl; for(auto m : t.Matches()) { cout << " " << m.Text() << endl; }; }