Source

lrc / src / lrcExceptions.hxx

Diff from to

File src/lrcExceptions.hxx

 //      lrcExceptions.hxx
 //
-//      Copyright 2011 Andreas Tscharner <andy@vis.ethz.ch>
+//      Copyright 2011, 2012 Andreas Tscharner <andy@vis.ethz.ch>
 //
 //      This program is free software; you can redistribute it and/or modify
 //      it under the terms of the GNU Lesser General Public License as
  * This file contains all exception classes for lrc project
  *
  * \author Andreas Tscharner
- * \date 2011-06-19
+ * \date 2012-01-07
  */
 
 #ifndef __LRC_EXCEPTIONS_HXX__
 		lrcFileNotFoundException(char *);
 		/*! \brief Destructor
 		 */
-		~lrcFileNotFoundException() throw();
+		~lrcFileNotFoundException(void) throw();
 
 		/*! \brief Method to return reason
 		 *
 		 *
 		 * Frees up memory needed by the class
 		 */
-		~lrcFileExistsException() throw();
+		~lrcFileExistsException(void) throw();
 
 		/*! \brief Gives a reason for the exception
 		 *
 		virtual const char *what(void) const throw();
 };
 
+/*! \class lrcEncryptionDisabledException
+ *  \brief Exception if encryption is disabled but required
+ *
+ * This exception is thrown if the compiler is compiled without encryption
+ * support, but the defined input file (.rc or .rif) defines to encrypt a
+ * resource
+ */
+class lrcEncryptionDisabledException : public std::exception
+{
+	private:
+		char *m_resourceID;            //!< Resource that requires encryption
+
+	public:
+		/*! \brief Constructor
+		 *
+		 * The constructor expects the name of the resource that requires
+		 * encryption
+		 *
+		 * \param[in] p_resourceID Resource ID
+		 */
+		lrcEncryptionDisabledException(char *);
+		/*! \brief Destructor
+		 *
+		 * Frees the memory of the exception
+		 */
+		~lrcEncryptionDisabledException(void) throw();
+
+		/*! \brief Gives a reason for the exception
+		 *
+		 * Returns a message explaining that the user disabled encryption at
+		 * compile time and therefore encryption of the resource is not
+		 * possible
+		 *
+		 * \return Reason for exception
+		 */
+		virtual const char *what(void) const throw();
+};
+
 
 #endif /* __LRC_EXCEPTIONS_HXX__ */