Skip to content

Commit

Permalink
Para compilar con C++17 cambia declaracion throw(tipo) por noexcept(f…
Browse files Browse the repository at this point in the history
  • Loading branch information
vtamara committed May 19, 2024
1 parent d00c905 commit cb95241
Show file tree
Hide file tree
Showing 14 changed files with 32 additions and 32 deletions.
4 changes: 2 additions & 2 deletions Elias.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ uint64_t decodifica_elias_gama(vector<bool> &vb)
* Una secuencia de números quedará cada numero comenzando en un byte.
*/
uint64_t
lee_elias_gama(std::istream &is) throw (string)
lee_elias_gama(std::istream &is) noexcept(false)
{
vector<bool> vb(0);
vb.clear();
Expand Down Expand Up @@ -435,7 +435,7 @@ lee_elias_gama(std::istream &is) throw (string)
*/
uint64_t
lee_elias_gama2(std::istream &is) throw (string)
lee_elias_gama2(std::istream &is) noexcept(false)
{
//clog << "OJO lee_elias_gama2(is)" << endl;
uint32_t p2;
Expand Down
4 changes: 2 additions & 2 deletions Elias.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,14 +100,14 @@ decodifica_elias_gama(vector<bool> &vb);
* @param is flujo de entrada
**/
uint64_t
lee_elias_gama(std::istream &is) throw(string);
lee_elias_gama(std::istream &is) noexcept(false);

/**
* Lee rapidamente un número en codificación elias gama de un flujo.
* @param is flujo de entrada
**/
uint64_t
lee_elias_gama2(std::istream &is) throw(string);
lee_elias_gama2(std::istream &is) noexcept(false);

/**
* Escribe al flujo os un entero en codificación gama de Elias.
Expand Down
2 changes: 1 addition & 1 deletion NodoTrieS.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ NodoTrieS::inserta(string pal, set<Pos> *npos)

void
NodoTrieS::aDotty(std::ostream &os, string pref, bool primero, bool mayor)
throw(string)
noexcept(false)
{
static int numcluster = 0;
if (primero) {
Expand Down
2 changes: 1 addition & 1 deletion NodoTrieS.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ class NodoTrieS
* @param mayor Si es el mayor de los hermanos del nivel
*/
void aDotty(ostream &os, string pref = "",
bool primero = true, bool mayor = true) throw(string);
bool primero = true, bool mayor = true) noexcept(false);

/* Arbol mas simple en formato dot */
void aDotty2(ostream &os, string pref = "", bool primero = true);
Expand Down
6 changes: 3 additions & 3 deletions Operaciones.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ muestraStream(std::istream &is, string pre)
}


void listaPalabras(char *noma, char *nrel) throw(string)
void listaPalabras(char *noma, char *nrel) noexcept(false)
{
ASSERT(noma != NULL);
ASSERT(nrel != NULL);
Expand All @@ -135,7 +135,7 @@ void listaPalabras(char *noma, char *nrel) throw(string)


void
eliminaDoc(char *noma, char *nomind, uint32_t nd) throw(string)
eliminaDoc(char *noma, char *nomind, uint32_t nd) noexcept(false)
{
ASSERT(nd > 0);
char nrel1[MAXLURL];
Expand Down Expand Up @@ -236,7 +236,7 @@ calcRenum(uint32_t td1, uint32_t td2, uint32_t nd, vector<int64_t> *reord,

void
mezclaDosDisco(const char *indsal, const char *ind1, const char *ind2,
uint32_t nd) throw(string)
uint32_t nd) noexcept(false)
{
ASSERT(nd >= 0);
char nrel[MAXLURL], nrel1[MAXLURL], nrel2[MAXLURL];
Expand Down
8 changes: 4 additions & 4 deletions Operaciones.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@ using namespace std;
* @param pre Prefijo para indentar
*/
void
muestraStream(std::istream &is, string pre); //throw(char *)
muestraStream(std::istream &is, string pre); //noexcept(false)

/**
* Lista por salida estándar palabras y frecuencias contenidas en índice.
* @param noma Nombre de archivo con índice
* @param nrel Nombre de archivo con relación de documentos
*/
void listaPalabras(char *noma, char *nrel) throw(string);
void listaPalabras(char *noma, char *nrel) noexcept(false);

/**
* Elimina del indice nomind el documento nd y deja resultado en noma
Expand All @@ -37,7 +37,7 @@ void listaPalabras(char *noma, char *nrel) throw(string);
* @param nd Número de documento a eliminar de nomind
*/
void
eliminaDoc(char *noma, char *nomind, uint32_t nd) throw(string);
eliminaDoc(char *noma, char *nomind, uint32_t nd) noexcept(false);


/**
Expand Down Expand Up @@ -66,7 +66,7 @@ string determinaFormato(string narch);
*/
void
mezclaDosDisco(const char *indsal, const char *ind1, const char *ind2,
uint32_t nd = 0) throw(string);
uint32_t nd = 0) noexcept(false);

/**
* Agrega un documento a un índice
Expand Down
4 changes: 2 additions & 2 deletions RamDisco.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ escribePlanoStream(NodoTrieS *n, std::iostream &os, uint32_t desp)


NodoTrieS *
leePlanoStream(std::istream &is) throw(string)
leePlanoStream(std::istream &is) noexcept(false)
{
string cad;
set<Pos> *cpos;
Expand Down Expand Up @@ -730,7 +730,7 @@ mezclaDiscoRam(istream &is1, NodoTrieS *a2, int saltacad, iostream &os,

void
subindiceDiscoaRAM(std::istream &is, NodoTrieS *t, uint32_t nd, string pcad)
throw(string)
noexcept(false)
{
//clog << "OJO subindiceDiscoaRAM(is, t, nd=" << nd << ", pcad=" << pcad << ")" << endl;
string cad;
Expand Down
4 changes: 2 additions & 2 deletions RamDisco.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ escribePlanoStream(NodoTrieS *n, std::ostream &os, uint32_t desp = 0);
* @return trieS que construye
*/
NodoTrieS *
leePlanoStream(std::istream &is) throw(string);
leePlanoStream(std::istream &is) noexcept(false);

/**
* Escribe en formato plano en un archivo
Expand Down Expand Up @@ -137,6 +137,6 @@ mezclaDiscoRam(istream &is1, NodoTrieS *a2, int saltacad, iostream &os,
void
subindiceDiscoaRAM(std::istream &is, NodoTrieS *t, uint32_t nd,
string pcad = "")
throw(string);
noexcept(false);

#endif
4 changes: 2 additions & 2 deletions TrieSDisco.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -634,7 +634,7 @@ mezclaRec(istream &is1, istream &is2, iostream &os,
* formato extra-simple
*/
set<Pos> *
buscaPlanoStream(std::istream &is, string pal) throw(string)
buscaPlanoStream(std::istream &is, string pal) noexcept(false)
{
string cad;
set<Pos> *cpos;
Expand Down Expand Up @@ -713,7 +713,7 @@ buscaPlano(const char *na, const char *nrel, string pal, vector<Doc> &docs)


uint32_t
leeRelacion(const char *nrel, vector<Doc> &docs) throw(string)
leeRelacion(const char *nrel, vector<Doc> &docs) noexcept(false)
{
ASSERT(nrel != NULL);
ASSERT(nrel[0] != '\0');
Expand Down
4 changes: 2 additions & 2 deletions TrieSDisco.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ set<Pos> *buscaPlano(const char *na, const char *nrel, string pal,
* @param pal Palabra por buscar
* @return Conjunto de posiciones donde aparece la palabra
**/
set<Pos> *buscaPlanoStream(std::istream &is, string pal) throw(string);
set<Pos> *buscaPlanoStream(std::istream &is, string pal) noexcept(false);



Expand All @@ -195,7 +195,7 @@ set<Pos> *buscaPlanoStream(std::istream &is, string pal) throw(string);
* Lanza excepción si no puede leer archivo.
*/
uint32_t
leeRelacion(const char *nrel, vector<Doc> &docs) throw(string);
leeRelacion(const char *nrel, vector<Doc> &docs) noexcept(false);


/**
Expand Down
8 changes: 4 additions & 4 deletions comun.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ vector<string> estalla(const string &delimitador, const string &cad)
return arr;
}

void verificaNombre(const char *na, char *nrel) throw(string)
void verificaNombre(const char *na, char *nrel) noexcept(false)
{
ASSERT(na != NULL);
ASSERT(nrel != NULL);
Expand Down Expand Up @@ -109,7 +109,7 @@ std::string errorFormato(std::istream &is, string m)

/** Lee de un stream una cadena vacía (si el stream no puede leerse) o
* terminada con { o de MAXCAD caracteres*/
string leeCad(std::istream &is) throw(string)
string leeCad(std::istream &is) noexcept(false)
{
int c = is.get();
string cad = "";
Expand All @@ -135,7 +135,7 @@ string leeCad(std::istream &is) throw(string)

/** Lee un número hexadecimal */
long
leeHex(std::istream &is) throw(std::string)
leeHex(std::istream &is) noexcept(false)
{
uint32_t i;
long valor = 0;
Expand Down Expand Up @@ -191,7 +191,7 @@ void escribe128b(std::ostream &os, uint32_t n)


long
lee128b(std::istream &is) throw (std::string)
lee128b(std::istream &is) noexcept(false)
{
int i;
long valor = 0;
Expand Down
10 changes: 5 additions & 5 deletions comun.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ const char FINCADENA = '{';
* @param na Nombre de índice
* @param nrel con espacio para MAXLURL caracteres, retorna nombre de rel.
*/
void verificaNombre(const char *na, char *nrel) throw(string);
void verificaNombre(const char *na, char *nrel) noexcept(false);


/**
Expand Down Expand Up @@ -125,13 +125,13 @@ std::string errorFormato(std::istream &is, string m);
* Lee una cadena
* @param is flujo de entrada
**/
string leeCad(istream &is) throw(string);
string leeCad(istream &is) noexcept(false);

/**
* Lee un número hexadecimal
* @param is flujo de entrada
**/
long leeHex(std::istream &is) throw(string);
long leeHex(std::istream &is) noexcept(false);


/**
Expand All @@ -147,7 +147,7 @@ void escribeHex(std::ostream &os, uint32_t n);
* Con 5 dígitos de estos puede representarse más de 4294967295 = 0xFFFFFFFF
* @param is flujo de entrada
**/
long lee128b(std::istream &is) throw(string);
long lee128b(std::istream &is) noexcept(false);


/**
Expand Down Expand Up @@ -190,7 +190,7 @@ long128b(uint32_t n)
* @param is flujo de entrada
**/
inline uint32_t
leeNDesp(std::istream &is) throw (std::string)
leeNDesp(std::istream &is) noexcept(false)
{
return lee128b(is);
}
Expand Down
2 changes: 1 addition & 1 deletion leePDF.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ string escapeshellarg(string s)

/** Construye un trieS a partir de un PDF */
void leePDF(const char *na, long ndoc, NodoTrieS &t, bool normalizaPal)
throw(std::string)
noexcept(false)
{
ASSERT(na != NULL && na[0] != '\0' && strlen(na) < FILENAME_MAX);
ASSERT(ndoc >= 0);
Expand Down
2 changes: 1 addition & 1 deletion leePDF.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
* @return void
*/
void leePDF(const char *na, long ndoc, NodoTrieS &t, bool normalizaPal)
throw(std::string);
noexcept(false);

#endif

0 comments on commit cb95241

Please sign in to comment.