/*
test de classe string
par Martin Robinson
jeu d'essaie de la classe string
_______________________________________
preprocesseur*/

#include <iostream>

using namespace std;

#include "stringMR.hpp"

/*programme principal*/

int main()
{
    stringMR test;
    test = "Hello";
    cout << test << endl;
    test += "world";
    cout << test << endl;
    test.insert(5," ");
    cout << test << endl;
    test.insert(5,1," all the ");
    cout << test << endl;
    test.insert(13,1," human of this ");
    cout << test << endl;
    cout << "human found at " << test.find("human") << endl;
    stringMR test2(test);
    test2.substr(0,9);
    cout << "modified copy : " << test2 << endl;
    cout << "compare with modified copy : " << test.compare(test2) << endl;
    test.substr(14,test.size()-14);
    cout << test << endl;
    test.resize(5);
    cout << test << endl;
    test.resize(10,'!');
    cout << test << endl;
    
    cout << "\nnow let undo all this modif\n\n";
    for(int i=0;i<8;i++)
    {
        cout << test << endl;
        test.undo();
    }

    return 0;
}
