Remove dynamic exceptions
[anna.git] / include / anna / xml / Node.hpp
index 7050a81..3af8f26 100644 (file)
@@ -55,7 +55,7 @@ class Decompressor;
 */
 class Node {
   struct NamespaceByName {
-    static const std::string& value(const Namespace* ns) throw() { return ns->getName(); }
+    static const std::string& value(const Namespace* ns) { return ns->getName(); }
   };
 
 public:
@@ -86,25 +86,25 @@ public:
      Devuelve el nombre del nodo.
      \return El nombre del nodo.
   */
-  const char* getName() const throw() { return a_name.c_str(); }
+  const char* getName() const { return a_name.c_str(); }
 
   /**
    * Devuelve el nombre del nodo.
    * \return El nombre del nodo.
    */
-  const std::string& getNameAsString() const throw() { return a_name; }
+  const std::string& getNameAsString() const { return a_name; }
 
   /**
      Devuelve la referencia al nodo predecesor de este nodo. Pueder ser NULL.
      \return La referencia al nodo predecesor de este nodo. Pueder ser NULL.
   */
-  const Node* getParent() const throw() { return a_parent; }
+  const Node* getParent() const { return a_parent; }
 
   /**
      Devuelve la referencia al nodo predecesor de este nodo. Pueder ser NULL.
      \return La referencia al nodo predecesor de este nodo. Pueder ser NULL.
   */
-  Node* getParent() throw() { return const_cast <Node*>(a_parent); }
+  Node* getParent() { return const_cast <Node*>(a_parent); }
 
   /**
      Devuelve la referencia al atributo que coincide con el nombre dado, si no existe lanzara
@@ -114,19 +114,19 @@ public:
      coincida con el nombre buscado.
      \return La referencia al atributo que coincide con el nombre dado.
   */
-  const Attribute* getAttribute(const char* name, const bool exceptionWhenNotFound = true) const throw(anna::RuntimeException);
+  const Attribute* getAttribute(const char* name, const bool exceptionWhenNotFound = true) const noexcept(false);
 
   /**
      Devuelve la referencia al texto asociado a este nodo. Pueder ser NULL.
      \return La referencia al texto asociado a este nodo. Pueder ser NULL.
   */
-  const Text* getText() const throw() { return a_text; }
+  const Text* getText() const { return a_text; }
 
   /**
    * Devuelve el namespace asociado a este nodo. Puede ser NULL.
    * \return el namespace asociado a este nodo. Puede ser NULL.
    */
-  const Namespace* getNamespace() const throw() { return a_namespace; }
+  const Namespace* getNamespace() const { return a_namespace; }
 
   /**
      Devuelve un iterador al comienzo de la lista de nodo hijos.
@@ -151,7 +151,7 @@ public:
 
      \return Un iterador al comienzo de la lista de nodo hijos.
   */
-  child_iterator child_begin() throw() { return a_children.begin(); }
+  child_iterator child_begin() { return a_children.begin(); }
 
   /**
      Devuelve un iterador al comienzo de la lista de nodos hijos no modificables.
@@ -176,19 +176,19 @@ public:
 
      \return Un iterador al comienzo de la lista de nodo hijos no modificables.
   */
-  const_child_iterator child_begin() const throw() { return a_children.begin(); }
+  const_child_iterator child_begin() const { return a_children.begin(); }
 
   /**
      Devuelve un iterador al comienzo de la lista de atributos no modificables.
      \return Un iterador al comienzo de la lista de atributos no modificables.
   */
-  const_attribute_iterator attribute_begin() const throw() { return a_attributes.begin(); }
+  const_attribute_iterator attribute_begin() const { return a_attributes.begin(); }
 
   /**
      Devuelve un iterador al comienzo de la lista de namespaces no modificables.
      \return Un iterador al comienzo de la lista de namespaces no modificables.
   */
-  const_namespace_iterator namespace_begin() const throw() { return a_root->a_namespaces->begin(); }
+  const_namespace_iterator namespace_begin() const { return a_root->a_namespaces->begin(); }
 
 
   /**
@@ -196,38 +196,38 @@ public:
      \return Un iterador al final de la lista de nodo hijos.
      \see #child_begin
   */
-  child_iterator child_end() throw() { return a_children.end(); }
+  child_iterator child_end() { return a_children.end(); }
 
   /**
      Devuelve un iterador al final de la lista de nodo hijos no modificables.
      \return Un iterador al final de la lista de nodo hijos no modificables.
      \see #begin
   */
-  const_child_iterator child_end() const throw() { return a_children.end(); }
+  const_child_iterator child_end() const { return a_children.end(); }
 
   /**
    * Devuelve el número de hijos definidos.
    * \return el número de hijos definidos.
    */
-  int child_size() const throw() { return a_children.size(); }
+  int child_size() const { return a_children.size(); }
 
   /**
      Devuelve un iterador al final de la lista de atributos no modificables.
      \return Un iterador al final de la lista de atributos no modificables.
   */
-  const_attribute_iterator attribute_end() const throw() { return a_attributes.end(); }
+  const_attribute_iterator attribute_end() const { return a_attributes.end(); }
 
   /**
      Devuelve un iterador al comienzo de la lista de namespaces no modificables.
      \return Un iterador al comienzo de la lista de namespaces no modificables.
   */
-  const_namespace_iterator namespace_end() const throw() { return a_root->a_namespaces->end(); }
+  const_namespace_iterator namespace_end() const { return a_root->a_namespaces->end(); }
 
   /**
    * Devuelve el número de namespace definidos.
    * \return el número de namespace definidos.
    */
-  int namespace_size() const throw() { return a_root->a_namespaces->size(); }
+  int namespace_size() const { return a_root->a_namespaces->size(); }
 
   /**
      Busca un nodo sucesor directo de este cuyo nombre coincida con el nombre recibido
@@ -241,7 +241,7 @@ public:
      y ninguno de los hijos cumple con la busqueda sera NULL.
   */
   const Node* find(const char* childName, const bool exceptionWhenNotFound = true) const
-  throw(RuntimeException);
+  noexcept(false);
 
   /**
      Crea un atributo que depende de este nodo.
@@ -250,7 +250,7 @@ public:
      \param _namespace Referencia al namespace al que pertenece el atributo. Puede ser NULL.
      \return La instancia del nuevo atributo.
   */
-  xml::Attribute* createAttribute(const char* name, const char* value, const Namespace* _namespace = NULL) throw();
+  xml::Attribute* createAttribute(const char* name, const char* value, const Namespace* _namespace = NULL) ;
 
   /**
      Crea un atributo que depende de este nodo.
@@ -259,7 +259,7 @@ public:
      \param _namespace Referencia al namespace al que pertenece el atributo. Puede ser NULL.
      \return La instancia del nuevo atributo.
   */
-  xml::Attribute* createAttribute(const char* name, const std::string& value, const Namespace* _namespace = NULL) throw() {
+  xml::Attribute* createAttribute(const char* name, const std::string& value, const Namespace* _namespace = NULL) {
     return createAttribute(name, value.c_str(), _namespace);
   }
 
@@ -270,7 +270,7 @@ public:
      \param _namespace Referencia al namespace al que pertenece el atributo. Puede ser NULL.
      \return La instancia del nuevo atributo.
   */
-  xml::Attribute* createAttribute(const char* name, const int value, const Namespace* _namespace = NULL) throw() {
+  xml::Attribute* createAttribute(const char* name, const int value, const Namespace* _namespace = NULL) {
     return createAttribute(name, anna::functions::asString(value), _namespace);
   }
 
@@ -282,7 +282,7 @@ public:
      \param _namespace Referencia al namespace al que pertenece el atributo. Puede ser NULL.
      \return La instancia del nuevo atributo.
   */
-  xml::Attribute* createAttribute(const char* name, const S64* value, const Namespace* _namespace = NULL) throw() {
+  xml::Attribute* createAttribute(const char* name, const S64* value, const Namespace* _namespace = NULL) {
     return createAttribute(name, anna::functions::asString(*value), _namespace);
   }
 
@@ -294,7 +294,7 @@ public:
      \param _namespace Referencia al namespace al que pertenece el atributo. Puede ser NULL.
      \return La instancia del nuevo atributo.
   */
-  xml::Attribute* createAttribute(const char* name, const U64* value, const Namespace* _namespace = NULL) throw() {
+  xml::Attribute* createAttribute(const char* name, const U64* value, const Namespace* _namespace = NULL) {
     return createAttribute(name, anna::functions::asString(*value), _namespace);
   }
 
@@ -303,20 +303,20 @@ public:
      \param text contain Valor del texto asociado a este nodo.
      \return La instancia del nuevo texto.
   */
-  xml::Text* createText(const char* text) throw(RuntimeException);
+  xml::Text* createText(const char* text) noexcept(false);
 
   /**
      Crea el texto asociado a este nodo.
      \param text contain Valor del texto asociado a este nodo.
      \return La instancia del nuevo texto.
   */
-  xml::Text* createText(const std::string& text) throw(RuntimeException) { return createText(text.c_str()); }
+  xml::Text* createText(const std::string& text) noexcept(false) { return createText(text.c_str()); }
 
   /**
      Crea un nuevo nodo que depende de este.
      \param name Nombre del nodo hijo.
   */
-  Node* createChild(const char* name) throw();
+  Node* createChild(const char* name) ;
 
   /**
    * Crea un nuevo namespace (si procede) que podemos usar para asignar a los distintos nodos. Si el nodo ya existe y la referencia no coincide
@@ -326,7 +326,7 @@ public:
    * \param reference URI de la que obtener las definiciones.
    * \return La instancia de un namespace con los parámetros indicados.
    */
-  const Namespace* createNamespace(const char* name, const char* reference) throw(RuntimeException) {
+  const Namespace* createNamespace(const char* name, const char* reference) noexcept(false) {
     std::string _name(name);
     return createNamespace(_name, reference);
   }
@@ -339,19 +339,19 @@ public:
    * \param reference URI de la que obtener las definiciones.
    * \return La instancia de un namespace con los parámetros indicados.
    */
-  const Namespace* createNamespace(const std::string& name, const char* reference) throw(RuntimeException);
+  const Namespace* createNamespace(const std::string& name, const char* reference) noexcept(false);
 
   /**
    * Establece el namespace asociado a este nodo.
    * \param _namespace Instancia del namespace que vamos a asociar al nodo.
    */
-  void setNamespace(const Namespace* _namespace) throw() { a_namespace = _namespace; }
+  void setNamespace(const Namespace* _namespace) { a_namespace = _namespace; }
 
   /**
    * Devuelve la instancia del namespace que coincide con el nombre recibido como parámetro. Puede ser NULL.
    * \return la instancia del namespace que coincide con el nombre recibido como parámetro. Puede ser NULL.
    */
-  Namespace* namespace_find(const char* name,  const bool exceptionWhenNotFound = true) throw(RuntimeException) {
+  Namespace* namespace_find(const char* name,  const bool exceptionWhenNotFound = true) noexcept(false) {
     const std::string _name(name);
     return namespace_find(_name, exceptionWhenNotFound);
   }
@@ -360,13 +360,13 @@ public:
    * Devuelve la instancia del namespace que coincide con el nombre recibido como parámetro. Puede ser NULL.
    * \return la instancia del namespace que coincide con el nombre recibido como parámetro. Puede ser NULL.
    */
-  Namespace* namespace_find(const std::string& name,  const bool exceptionWhenNotFound = true) throw(RuntimeException);
+  Namespace* namespace_find(const std::string& name,  const bool exceptionWhenNotFound = true) noexcept(false);
 
   /**
    * Devuelve la instancia del namespace que coincide con el nombre recibido como parámetro. Puede ser NULL.
    * \return la instancia del namespace que coincide con el nombre recibido como parámetro. Pueder ser NULL.
    */
-  const Namespace* namespace_find(const char* name, const bool exceptionWhenNotFound = true) const throw(RuntimeException) {
+  const Namespace* namespace_find(const char* name, const bool exceptionWhenNotFound = true) const noexcept(false) {
     return const_cast <Node*>(this)->namespace_find(name, exceptionWhenNotFound);
   }
 
@@ -374,20 +374,20 @@ public:
    * Devuelve la instancia del namespace que coincide con el nombre recibido como parámetro. Puede ser NULL.
    * \return la instancia del namespace que coincide con el nombre recibido como parámetro. Pueder ser NULL.
    */
-  const Namespace* namespace_find(const std::string& name, const bool exceptionWhenNotFound = true) const throw(RuntimeException) {
+  const Namespace* namespace_find(const std::string& name, const bool exceptionWhenNotFound = true) const noexcept(false) {
     return const_cast <Node*>(this)->namespace_find(name, exceptionWhenNotFound);
   }
 
   /**
    * Libera todos los componentes (atributos, namespaces y nodos hijos) asociados a este nodo.
    */
-  void clear() throw();
+  void clear() ;
 
   /**
      Devuelve una cadena con toda la información relevante de esta instancia.
      \return Una cadena con toda la información relevante de esta instancia.
   */
-  std::string asString() const throw();
+  std::string asString() const ;
 
   /**
      Devuelve la refencia al nodo sobre el que se encuentra el iterador pasado como
@@ -396,28 +396,28 @@ public:
      \return La refencia al nodo sobre el que se encuentra el iterador pasado como
      parámetro.
   */
-  static Node* node(child_iterator& ii) throw() { return *ii; }
+  static Node* node(child_iterator& ii) { return *ii; }
 
   /**
      Devuelve la refencia al nodo sobre el que se encuentra el iterador pasado como  parámetro.
      \param ii Iterador que estamos recorriendo.
      \return La refencia al nodo sobre el que se encuentra el iterador pasado como  parámetro.
   */
-  static const Node* node(const_child_iterator& ii) throw() { return *ii; }
+  static const Node* node(const_child_iterator& ii) { return *ii; }
 
   /**
      Devuelve la refencia al atributo sobre el que se encuentra el iterador pasado como parámetro.
      \param ii Iterador que estamos recorriendo.
      \return La refencia al atributo sobre el que se encuentra el iterador pasado como parámetro.
   */
-  static const Attribute* attribute(const_attribute_iterator& ii) throw() { return *ii; }
+  static const Attribute* attribute(const_attribute_iterator& ii) { return *ii; }
 
   /**
      Devuelve la refencia al namespace sobre el que se encuentra el iterador pasado como parámetro.
      \param ii Iterador que estamos recorriendo.
      \return La refencia al namespace sobre el que se encuentra el iterador pasado como parámetro.
   */
-  static const Namespace* xnamespace(const_namespace_iterator& ii) throw() { return namespace_container::data(ii);; }
+  static const Namespace* xnamespace(const_namespace_iterator& ii) { return namespace_container::data(ii);; }
 
 protected:
   /**
@@ -425,7 +425,7 @@ protected:
      \param ii Iterador que estamos recorriendo.
      \return La refencia al atributo sobre el que se encuentra el iterador pasado como parámetro.
   */
-  static Attribute* attribute(attribute_iterator& ii) throw() { return *ii; }
+  static Attribute* attribute(attribute_iterator& ii) { return *ii; }
 
 private:
   std::string a_name;
@@ -453,14 +453,14 @@ private:
   /* Para evitar que se pueda crear desde el exterior */
   Node();
 
-  void setRoot(Node* root) throw() { a_root = root; }
-  void setName(const char* name) throw() { a_name = name; }
+  void setRoot(Node* root) { a_root = root; }
+  void setName(const char* name) { a_name = name; }
 
-  static const Attribute* find(const char* attrName, const_attribute_iterator, const_attribute_iterator) throw();
+  static const Attribute* find(const char* attrName, const_attribute_iterator, const_attribute_iterator) ;
 
   // Allow sort in compiler
-  attribute_iterator attribute_begin() throw() { return a_attributes.begin(); }
-  attribute_iterator attribute_end() throw() { return a_attributes.end(); }
+  attribute_iterator attribute_begin() { return a_attributes.begin(); }
+  attribute_iterator attribute_end() { return a_attributes.end(); }
 
   friend class Parser;
   friend class Allocator<Node>;