Remove dynamic exceptions
[anna.git] / include / anna / http / Message.hpp
index 3e264d0..78725bb 100644 (file)
@@ -1,37 +1,9 @@
-// ANNA - Anna is Not 'N' Anymore
-//
-// (c) Copyright 2005-2014 Eduardo Ramos Testillano & Francisco Ruiz Rayo
-//
-// https://bitbucket.org/testillano/anna
-//
-// Redistribution and use in source and binary forms, with or without
-// modification, are permitted provided that the following conditions
-// are met:
-//
-//     * Redistributions of source code must retain the above copyright
-// notice, this list of conditions and the following disclaimer.
-//     * Redistributions in binary form must reproduce the above
-// copyright notice, this list of conditions and the following disclaimer
-// in the documentation and/or other materials provided with the
-// distribution.
-//     * Neither the name of Google Inc. nor the names of its
-// contributors may be used to endorse or promote products derived from
-// this software without specific prior written permission.
-//
-// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-//
-// Authors: eduardo.ramos.testillano@gmail.com
-//          cisco.tierra@gmail.com
+// ANNA - Anna is Not Nothingness Anymore                                                         //
+//                                                                                                //
+// (c) Copyright 2005-2015 Eduardo Ramos Testillano & Francisco Ruiz Rayo                         //
+//                                                                                                //
+// See project site at http://redmine.teslayout.com/projects/anna-suite                           //
+// See accompanying file LICENSE or copy at http://www.teslayout.com/projects/public/anna.LICENSE //
 
 
 #ifndef anna_http_Message_hpp
@@ -81,38 +53,38 @@ public:
      Devuelve el tipo de este mensaje HTTP.
      \return el tipo de este mensaje HTTP.
   */
-  Type::_v getType() const throw() { return a_type; }
+  Type::_v getType() const { return a_type; }
 
   /**
      Devuelve la version del protocolo HTTP usada en el mensaje.
      \return la version del protocolo HTTP usada en el mensaje.
   */
-  const std::string& getVersion() const throw() { return a_version; }
+  const std::string& getVersion() const { return a_version; }
 
   /*
    * Devuelve el enumerado que identifica la versión HTTP usada en el mensaje.
    * \return el enumerado que identifica la versión HTTP usada en el mensaje.
    */
-  Version::_v getVersionAsEnum() const throw() { return Version::asEnum(a_version); }
+  Version::_v getVersionAsEnum() const { return Version::asEnum(a_version); }
 
   /**
    * Devuelve los parámetros extras que pueden haber estado contenidos en los bloques
    * de datos, en caso de que el mensaje se haya recibido como un "Transfer-Encoding: chunked".
    * \return Los parámetros extras que pueden haber estado contenidos en los bloques
    */
-  const std::string& getExtraParameters() const throw() { return a_extraParameters;  }
+  const std::string& getExtraParameters() const { return a_extraParameters;  }
 
   /**
      Establece la version a codificar en el mensaje.
      \param version Texto con la version HTTP a usar, HTTP/1.1, por ejemplo.
   */
-  void setVersion(const std::string& version) throw() { a_version = version; }
+  void setVersion(const std::string& version) { a_version = version; }
 
   /**
    * Establece la versión a codificar en el mensaje.
    * \param version Identificador de la versión.
    */
-  void setVersion(const Version::_v version) throw() { a_version = Version::asCString(version); }
+  void setVersion(const Version::_v version) { a_version = Version::asCString(version); }
 
   /**
    * Establece el cuerpo de este mensaje con el contenido del documento XML correspondiente al
@@ -122,7 +94,7 @@ public:
    *
    * \param node Nodo XML que contiene el documento XML.
    */
-  comm::Message* setBody(const xml::Node* node) throw(RuntimeException);
+  comm::Message* setBody(const xml::Node* node) noexcept(false);
 
   /**
      Crea una nueva cabecera en este mensaje.
@@ -130,7 +102,7 @@ public:
      \return La instancia de la nueva cabecera.
   */
   Header* createHeader(const Header::Type::_v type)
-  throw(RuntimeException) {
+  noexcept(false) {
     return a_headers.create()->initialize(type);
   }
 
@@ -140,7 +112,7 @@ public:
      \return La instancia de la nueva cabecera.
   */
   Header* createHeader(const std::string& name)
-  throw(RuntimeException) {
+  noexcept(false) {
     return a_headers.create()->initialize(name);
   }
 
@@ -151,7 +123,7 @@ public:
      \param type Tipo de cabecera buscado.
      \return La primera cabecera que coincide con el tipo recibido como parametro.
   */
-  const Header* find(const Header::Type::_v type) const throw() {
+  const Header* find(const Header::Type::_v type) const {
     return const_cast <Message*>(this)->find(type);
   }
 
@@ -162,7 +134,7 @@ public:
      \param type Tipo de cabecera buscado.
      \return La primera cabecera que coincide con el tipo recibido como parametro.
   */
-  Header* find(const Header::Type::_v type) throw();
+  Header* find(const Header::Type::_v type) ;
 
   /**
      Devuelve la instancia de la primera cabecera de tipo Header::Category::Extension cuyo
@@ -170,48 +142,48 @@ public:
      \param name Nombre de la extension buscada.
      \return La primera cabecera que coincide con el tipo recibido como parametro.
   */
-  Header* find(const char* name) throw();
+  Header* find(const char* name) ;
 
   /**
      Inicializa el contenido de este mensaje. Libera las cabeceras y el cuerpo del mensaje.
   */
-  void clear() throw() { a_headers.clear(); clearBody(); a_extraParameters.clear();}
+  void clear() { a_headers.clear(); clearBody(); a_extraParameters.clear();}
 
   /**
      Devuelve un iterador al comienzo de la lista de cabeceras.
      \return un iterador al comienzo de la lista de cabeceras.
   */
-  header_iterator header_begin() throw() { return a_headers.begin(); }
+  header_iterator header_begin() { return a_headers.begin(); }
 
   /**
      Devuelve un iterador al final de la lista de cabeceras.
      \return un iterador al final de la lista de cabeceras.
   */
-  header_iterator header_end() throw() { return a_headers.end(); }
+  header_iterator header_end() { return a_headers.end(); }
 
   /**
      Devuelve un iterador al comienzo de la lista de cabeceras.
      \return un iterador al comienzo de la lista de cabeceras.
   */
-  const_header_iterator header_begin() const throw() { return a_headers.begin(); }
+  const_header_iterator header_begin() const { return a_headers.begin(); }
 
   /**
      Devuelve un iterador al final de la lista de cabeceras.
      \return un iterador al final de la lista de cabeceras.
   */
-  const_header_iterator header_end() const throw() { return a_headers.end(); }
+  const_header_iterator header_end() const { return a_headers.end(); }
 
   /**
      Codifica este mensaje.
      \return El bloque de datos que contiene el mensaje codificado.
   */
-  const DataBlock& code() throw(anna::RuntimeException);
+  const DataBlock& code() noexcept(false);
 
   /**
      Devuelve una cadena con toda la informacion relevante de este objeto.
      \return una cadena con toda la informacion relevante de este objeto.
   */
-  virtual std::string asString() const throw() = 0;
+  virtual std::string asString() const  = 0;
 
   /**
      Devuelve la instancia de la cabecera a la que referencia el iterator
@@ -219,7 +191,7 @@ public:
      \return la instancia de la cabecera a la que referencia el iterator
      recibido como parametro.
   */
-  static Header* header(header_iterator& ii) throw() { return Recycler<Header>::data(ii); }
+  static Header* header(header_iterator& ii) { return Recycler<Header>::data(ii); }
 
   /**
      Devuelve la instancia de la cabecera a la que referencia el iterator
@@ -227,7 +199,7 @@ public:
      \return la instancia de la cabecera a la que referencia el iterator
      recibido como parametro.
   */
-  static const Header* header(const_header_iterator& ii) throw() { return Recycler<Header>::data(ii); }
+  static const Header* header(const_header_iterator& ii) { return Recycler<Header>::data(ii); }
 
 protected:
   /**
@@ -244,14 +216,14 @@ private:
   Recycler <Header> a_headers;
   std::string a_extraParameters;
 
-  void codeLine(const std::string& line) throw(RuntimeException);
+  void codeLine(const std::string& line) noexcept(false);
 
-  void appendExtraParameter(const std::string& extraParameter) throw() {
+  void appendExtraParameter(const std::string& extraParameter) {
     a_extraParameters += ' ';
     a_extraParameters += extraParameter;
   }
 
-  virtual std::string codeStartLine() const throw(anna::RuntimeException) = 0;
+  virtual std::string codeStartLine() const noexcept(false) = 0;
 
   friend class parser::Abstract;
 };