X-Git-Url: https://git.llucax.com/z.facultad/75.42/string.git/blobdiff_plain/18dabcacb51313294c968b9a9217674666b4bbf9..b18e440563dabec6bef71cbfa954bc5e38c84ca6:/universalstring.cpp?ds=sidebyside diff --git a/universalstring.cpp b/universalstring.cpp index 57d458f..245eac6 100644 --- a/universalstring.cpp +++ b/universalstring.cpp @@ -15,13 +15,49 @@ */ #include "ascii.h" +#include "unicode.h" #include "universalstring.h" -#include +#include "quicksort.h" #include +#include + +using namespace std; int main(void) { - UniversalString s("Hola mundo"); - std::cout << s << std::endl; + + // Ascii. + UniversalString< Ascii > sa("Hola mundo"); +// cout << sa << endl; + cin >> sa; + cout << sa << endl; +/* + // Unicode. + 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; }