70 lines
1.1 KiB
C++
70 lines
1.1 KiB
C++
#include <iostream>
|
|
#include <string>
|
|
#include <list>
|
|
#include "fecha.hpp"
|
|
#include "cuac.hpp"
|
|
#include "diccionariocuacs.hpp"
|
|
#include "tablahash.hpp"
|
|
using namespace std;
|
|
|
|
DiccionarioCuacs dic;
|
|
|
|
void procesar_pcuac() {
|
|
Cuac nuevo;
|
|
nuevo.leer_pcuac();
|
|
dic.insertar(nuevo);
|
|
cout << dic.elem() << " cuac" << endl;
|
|
}
|
|
|
|
void procesar_mcuac() {
|
|
Cuac nuevo;
|
|
nuevo.leer_mcuac();
|
|
dic.insertar(nuevo);
|
|
cout << dic.elem() << " cuac" << endl;
|
|
}
|
|
|
|
void procesar_follow() {
|
|
string nombre;
|
|
cin >> nombre;
|
|
dic.follow(nombre); // follow muestra los mensajes del usuario <nombre>
|
|
}
|
|
|
|
void procesar_last() {
|
|
int n;
|
|
cin >> n;
|
|
dic.last(n);
|
|
}
|
|
|
|
void procesar_date() {
|
|
Fecha f1, f2;
|
|
f1.leer();
|
|
f2.leer();
|
|
dic.date(f1, f2);
|
|
}
|
|
|
|
int main() {
|
|
int cuacs = 1;
|
|
string comando;
|
|
while (cin >> comando) {
|
|
if (comando == "pcuac") {
|
|
procesar_pcuac();
|
|
cuacs++;
|
|
} else if (comando == "mcuac") {
|
|
procesar_mcuac();
|
|
cuacs++;
|
|
} else if (comando == "follow") {
|
|
procesar_follow();
|
|
} else if (comando == "exit") {
|
|
break;
|
|
} else if (comando == "last") {
|
|
procesar_last();
|
|
} else if (comando == "date") {
|
|
procesar_date();
|
|
}
|
|
|
|
}
|
|
return 0;
|
|
|
|
}
|
|
|