X-Git-Url: https://git.llucax.com/z.facultad/75.42/string.git/blobdiff_plain/f3e36100ec2a1f73877100992cddfdc8dc13312b..6433cf237a213c6ba195e534da110733de9b4716:/universalstring.cpp diff --git a/universalstring.cpp b/universalstring.cpp index 5704ce6..245eac6 100644 --- a/universalstring.cpp +++ b/universalstring.cpp @@ -14,27 +14,50 @@ * $Id$ */ -#include #include "ascii.h" #include "unicode.h" #include "universalstring.h" -#include +#include "quicksort.h" +#include +#include using namespace std; int main(void) { // Ascii. - UniversalString sa("Hola mundo"); - cout << sa << endl; + UniversalString< Ascii > sa("Hola mundo"); +// cout << sa << endl; cin >> sa; cout << sa << endl; - +/* // Unicode. - UniversalString su("Hola mundo"); + UniversalString< Unicode > su("Chau mundo"); cout << su << endl; cin >> su; cout << su << endl; + + // Conversión. + sa = su; + cout << su << endl; +*/ + // Agrego cosas al vector para ordenar. + vector< UniversalString< Ascii > > v; + v.push_back(sa); + v.push_back(UniversalString< Ascii >("Hola mundo!")); + v.push_back(UniversalString< Ascii >("Chau mundo!")); + // Imprimo. + cout << "Sin ordenar (" << v.size() << "):" << endl; + for (int i = 0; i < v.size(); i++) { + cout << v[i] << endl; + } + // Ordeno. + quicksort(v, 0, 2); + // Imprimo. + cout << "Ordenado:" << endl; + copy(v.begin(), v.end(), ostream_iterator< UniversalString< Ascii > >(cout, + "\n")); + return 0; }