소스 검색

2010-06-20 Tatsuhiro Tsujikawa <t-tujikawa@users.sourceforge.net>

	Added separete *.cc files for exception classes.
	* src/DlAbortEx.cc
	* src/DlAbortEx.h
	* src/DlRetryEx.cc
	* src/DlRetryEx.h
	* src/DownloadFailureException.cc
	* src/DownloadFailureException.h
	* src/FatalException.cc
	* src/FatalException.h
	* src/Makefile.am
	* src/RecoverableException.cc
	* src/RecoverableException.h
Tatsuhiro Tsujikawa 15 년 전
부모
커밋
c7795c63ce
12개의 변경된 파일359개의 추가작업 그리고 70개의 파일을 삭제
  1. 15 0
      ChangeLog
  2. 59 0
      src/DlAbortEx.cc
  3. 8 13
      src/DlAbortEx.h
  4. 57 0
      src/DlRetryEx.cc
  5. 8 13
      src/DlRetryEx.h
  6. 65 0
      src/DownloadFailureException.cc
  7. 8 13
      src/DownloadFailureException.h
  8. 56 0
      src/FatalException.cc
  9. 6 10
      src/FatalException.h
  10. 5 5
      src/Makefile.am
  11. 67 0
      src/RecoverableException.cc
  12. 5 16
      src/RecoverableException.h

+ 15 - 0
ChangeLog

@@ -1,3 +1,18 @@
+2010-06-20  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
+
+	Added separete *.cc files for exception classes.
+	* src/DlAbortEx.cc
+	* src/DlAbortEx.h
+	* src/DlRetryEx.cc
+	* src/DlRetryEx.h
+	* src/DownloadFailureException.cc
+	* src/DownloadFailureException.h
+	* src/FatalException.cc
+	* src/FatalException.h
+	* src/Makefile.am
+	* src/RecoverableException.cc
+	* src/RecoverableException.h
+
 2010-06-20  Tatsuhiro Tsujikawa  <t-tujikawa@users.sourceforge.net>
 
 	Moved non-trivial functions to *.cc file

+ 59 - 0
src/DlAbortEx.cc

@@ -0,0 +1,59 @@
+/* <!-- copyright */
+/*
+ * aria2 - The high speed download utility
+ *
+ * Copyright (C) 2006 Tatsuhiro Tsujikawa
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * In addition, as a special exception, the copyright holders give
+ * permission to link the code of portions of this program with the
+ * OpenSSL library under certain conditions as described in each
+ * individual source file, and distribute linked combinations
+ * including the two.
+ * You must obey the GNU General Public License in all respects
+ * for all of the code used other than OpenSSL.  If you modify
+ * file(s) with this exception, you may extend this exception to your
+ * version of the file(s), but you are not obligated to do so.  If you
+ * do not wish to do so, delete this exception statement from your
+ * version.  If you delete this exception statement from all source
+ * files in the program, then also delete it here.
+ */
+/* copyright --> */
+#include "DlAbortEx.h"
+
+namespace aria2 {
+
+SharedHandle<Exception> DlAbortEx::copy() const
+{
+  SharedHandle<Exception> e(new DlAbortEx(*this));
+  return e;
+}
+
+DlAbortEx::DlAbortEx(const char* file, int line, const std::string& msg):
+  RecoverableException(file, line, msg) {}
+
+DlAbortEx::DlAbortEx(const char* file, int line, const std::string& msg,
+                     const Exception& cause):
+  RecoverableException(file, line, msg, cause) {}
+
+DlAbortEx::DlAbortEx(const char* file, int line, const RecoverableException& e):
+  RecoverableException(file, line, e) {}
+
+DlAbortEx::DlAbortEx(const char* file, int line, const std::string& msg,
+                     downloadresultcode::RESULT code):
+  RecoverableException(file, line, msg, code) {}
+
+} // namespace aria2

+ 8 - 13
src/DlAbortEx.h

@@ -40,22 +40,17 @@ namespace aria2 {
 
 class DlAbortEx:public RecoverableException {
 protected:
-  virtual SharedHandle<Exception> copy() const
-  {
-    SharedHandle<Exception> e(new DlAbortEx(*this));
-    return e;
-  }
+  virtual SharedHandle<Exception> copy() const;
 public:
-  DlAbortEx(const char* file, int line, const std::string& msg):
-    RecoverableException(file, line, msg) {}
+  DlAbortEx(const char* file, int line, const std::string& msg);
+
   DlAbortEx(const char* file, int line, const std::string& msg,
-            const Exception& cause):
-    RecoverableException(file, line, msg, cause) {}
-  DlAbortEx(const char* file, int line, const RecoverableException& e):
-    RecoverableException(file, line, e) {}
+            const Exception& cause);
+
+  DlAbortEx(const char* file, int line, const RecoverableException& e);
+
   DlAbortEx(const char* file, int line, const std::string& msg,
-            downloadresultcode::RESULT code):
-    RecoverableException(file, line, msg, code) {}
+            downloadresultcode::RESULT code);
 };
 
 #define DL_ABORT_EX(arg) DlAbortEx(__FILE__, __LINE__, arg)

+ 57 - 0
src/DlRetryEx.cc

@@ -0,0 +1,57 @@
+/* <!-- copyright */
+/*
+ * aria2 - The high speed download utility
+ *
+ * Copyright (C) 2006 Tatsuhiro Tsujikawa
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * In addition, as a special exception, the copyright holders give
+ * permission to link the code of portions of this program with the
+ * OpenSSL library under certain conditions as described in each
+ * individual source file, and distribute linked combinations
+ * including the two.
+ * You must obey the GNU General Public License in all respects
+ * for all of the code used other than OpenSSL.  If you modify
+ * file(s) with this exception, you may extend this exception to your
+ * version of the file(s), but you are not obligated to do so.  If you
+ * do not wish to do so, delete this exception statement from your
+ * version.  If you delete this exception statement from all source
+ * files in the program, then also delete it here.
+ */
+/* copyright --> */
+#include "DlRetryEx.h"
+
+namespace aria2 {
+
+SharedHandle<Exception> DlRetryEx::copy() const
+{
+  SharedHandle<Exception> e(new DlRetryEx(*this));
+  return e;
+}
+
+DlRetryEx::DlRetryEx(const char* file, int line, const std::string& msg):
+  RecoverableException(file, line, msg) {}
+
+DlRetryEx::DlRetryEx(const char* file, int line, const std::string& msg,
+                     const Exception& cause):
+  RecoverableException(file, line, msg, cause) {}
+DlRetryEx::DlRetryEx(const char* file, int line, const DlRetryEx& e):
+  RecoverableException(file, line, e) {}
+DlRetryEx::DlRetryEx(const char* file, int line, const std::string& msg,
+                     downloadresultcode::RESULT code):
+  RecoverableException(file, line, msg, code) {}
+
+} // namespace aria2

+ 8 - 13
src/DlRetryEx.h

@@ -40,22 +40,17 @@ namespace aria2 {
 
 class DlRetryEx:public RecoverableException {
 protected:
-  virtual SharedHandle<Exception> copy() const
-  {
-    SharedHandle<Exception> e(new DlRetryEx(*this));
-    return e;
-  }
+  virtual SharedHandle<Exception> copy() const;
 public:
-  DlRetryEx(const char* file, int line, const std::string& msg):
-    RecoverableException(file, line, msg) {}
+  DlRetryEx(const char* file, int line, const std::string& msg);
+
   DlRetryEx(const char* file, int line, const std::string& msg,
-            const Exception& cause):
-    RecoverableException(file, line, msg, cause) {}
-  DlRetryEx(const char* file, int line, const DlRetryEx& e):
-    RecoverableException(file, line, e) {}
+            const Exception& cause);
+
+  DlRetryEx(const char* file, int line, const DlRetryEx& e);
+
   DlRetryEx(const char* file, int line, const std::string& msg,
-            downloadresultcode::RESULT code):
-    RecoverableException(file, line, msg, code) {}
+            downloadresultcode::RESULT code);
 };
 
 #define DL_RETRY_EX(arg) DlRetryEx(__FILE__, __LINE__, arg)

+ 65 - 0
src/DownloadFailureException.cc

@@ -0,0 +1,65 @@
+/* <!-- copyright */
+/*
+ * aria2 - The high speed download utility
+ *
+ * Copyright (C) 2006 Tatsuhiro Tsujikawa
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * In addition, as a special exception, the copyright holders give
+ * permission to link the code of portions of this program with the
+ * OpenSSL library under certain conditions as described in each
+ * individual source file, and distribute linked combinations
+ * including the two.
+ * You must obey the GNU General Public License in all respects
+ * for all of the code used other than OpenSSL.  If you modify
+ * file(s) with this exception, you may extend this exception to your
+ * version of the file(s), but you are not obligated to do so.  If you
+ * do not wish to do so, delete this exception statement from your
+ * version.  If you delete this exception statement from all source
+ * files in the program, then also delete it here.
+ */
+/* copyright --> */
+#include "DownloadFailureException.h"
+
+namespace aria2 {
+
+SharedHandle<Exception> DownloadFailureException::copy() const
+{
+  SharedHandle<Exception> e(new DownloadFailureException(*this));
+  return e;
+}
+
+DownloadFailureException::DownloadFailureException
+(const char* file, int line, const std::string& msg):
+  RecoverableException(file, line, msg) {}
+
+DownloadFailureException::DownloadFailureException
+(const char* file, int line, const std::string& msg,
+ const Exception& cause):
+  RecoverableException(file, line, msg, cause) {}
+
+DownloadFailureException::DownloadFailureException
+(const char* file, int line,
+ const DownloadFailureException& e):
+  RecoverableException(file, line, e) {}
+
+DownloadFailureException::DownloadFailureException
+(const char* file, int line,
+ const std::string& msg,
+ downloadresultcode::RESULT code):
+  RecoverableException(file, line, msg, code) {}
+
+} // namespace aria2

+ 8 - 13
src/DownloadFailureException.h

@@ -44,24 +44,19 @@ namespace aria2 {
  */
 class DownloadFailureException:public RecoverableException {
 protected:
-  virtual SharedHandle<Exception> copy() const
-  {
-    SharedHandle<Exception> e(new DownloadFailureException(*this));
-    return e;
-  }
+  virtual SharedHandle<Exception> copy() const;
 public:
-  DownloadFailureException(const char* file, int line, const std::string& msg):
-    RecoverableException(file, line, msg) {}
+  DownloadFailureException(const char* file, int line, const std::string& msg);
+
   DownloadFailureException(const char* file, int line, const std::string& msg,
-                           const Exception& cause):
-    RecoverableException(file, line, msg, cause) {}
+                           const Exception& cause);
+
   DownloadFailureException(const char* file, int line,
-                           const DownloadFailureException& e):
-    RecoverableException(file, line, e) {}
+                           const DownloadFailureException& e);
+
   DownloadFailureException(const char* file, int line,
                            const std::string& msg,
-                           downloadresultcode::RESULT code):
-    RecoverableException(file, line, msg, code) {}
+                           downloadresultcode::RESULT code);
 };
 
 #define DOWNLOAD_FAILURE_EXCEPTION(arg)                 \

+ 56 - 0
src/FatalException.cc

@@ -0,0 +1,56 @@
+/* <!-- copyright */
+/*
+ * aria2 - The high speed download utility
+ *
+ * Copyright (C) 2006 Tatsuhiro Tsujikawa
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * In addition, as a special exception, the copyright holders give
+ * permission to link the code of portions of this program with the
+ * OpenSSL library under certain conditions as described in each
+ * individual source file, and distribute linked combinations
+ * including the two.
+ * You must obey the GNU General Public License in all respects
+ * for all of the code used other than OpenSSL.  If you modify
+ * file(s) with this exception, you may extend this exception to your
+ * version of the file(s), but you are not obligated to do so.  If you
+ * do not wish to do so, delete this exception statement from your
+ * version.  If you delete this exception statement from all source
+ * files in the program, then also delete it here.
+ */
+/* copyright --> */
+#include "FatalException.h"
+
+namespace aria2 {
+
+SharedHandle<Exception> FatalException::copy() const
+{
+  SharedHandle<Exception> e(new FatalException(*this));
+  return e;
+}
+
+FatalException::FatalException
+(const char* file, int line, const std::string& msg):
+  Exception(file, line, msg) {}
+ 
+FatalException::FatalException
+(const char* file, int line, const std::string& msg,
+ const Exception& cause):
+  Exception(file, line, msg, cause) {}
+
+FatalException::FatalException(const FatalException& e):Exception(e) {}
+
+} // namespace aria2

+ 6 - 10
src/FatalException.h

@@ -40,18 +40,14 @@ namespace aria2 {
 
 class FatalException:public Exception {
 protected:
-  virtual SharedHandle<Exception> copy() const
-  {
-    SharedHandle<Exception> e(new FatalException(*this));
-    return e;
-  }
+  virtual SharedHandle<Exception> copy() const;
 public:
-  FatalException(const char* file, int line, const std::string& msg):
-    Exception(file, line, msg) {}
+  FatalException(const char* file, int line, const std::string& msg);
+
   FatalException(const char* file, int line, const std::string& msg,
-                 const Exception& cause):
-    Exception(file, line, msg, cause) {}
-  FatalException(const FatalException& e):Exception(e) {}
+                 const Exception& cause);
+
+  FatalException(const FatalException& e);
 };
 
 #define FATAL_EXCEPTION(arg)                    \

+ 5 - 5
src/Makefile.am

@@ -34,11 +34,11 @@ SRCS =  Socket.h\
 	common.h\
 	message.h\
 	Exception.cc Exception.h\
-	FatalException.h\
-	RecoverableException.h\
-	DlAbortEx.h\
-	DlRetryEx.h\
-	DownloadFailureException.h\
+	FatalException.cc FatalException.h\
+	RecoverableException.cc RecoverableException.h\
+	DlAbortEx.cc DlAbortEx.h\
+	DlRetryEx.cc DlRetryEx.h\
+	DownloadFailureException.cc DownloadFailureException.h\
 	Logger.cc Logger.h\
 	SimpleLogger.cc SimpleLogger.h\
 	DiskWriter.h\

+ 67 - 0
src/RecoverableException.cc

@@ -0,0 +1,67 @@
+/* <!-- copyright */
+/*
+ * aria2 - The high speed download utility
+ *
+ * Copyright (C) 2006 Tatsuhiro Tsujikawa
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ *
+ * In addition, as a special exception, the copyright holders give
+ * permission to link the code of portions of this program with the
+ * OpenSSL library under certain conditions as described in each
+ * individual source file, and distribute linked combinations
+ * including the two.
+ * You must obey the GNU General Public License in all respects
+ * for all of the code used other than OpenSSL.  If you modify
+ * file(s) with this exception, you may extend this exception to your
+ * version of the file(s), but you are not obligated to do so.  If you
+ * do not wish to do so, delete this exception statement from your
+ * version.  If you delete this exception statement from all source
+ * files in the program, then also delete it here.
+ */
+/* copyright --> */
+#include "RecoverableException.h"
+
+namespace aria2 {
+
+SharedHandle<Exception> RecoverableException::copy() const
+{
+  SharedHandle<Exception> e(new RecoverableException(*this));
+  return e;
+}
+
+RecoverableException::RecoverableException
+(const char* file, int line, const std::string& msg):
+  Exception(file, line, msg),
+  _code(downloadresultcode::UNKNOWN_ERROR) {}
+
+RecoverableException::RecoverableException
+(const char* file, int line, const std::string& msg,
+ const Exception& cause):
+  Exception(file, line, msg, cause),
+  _code(downloadresultcode::UNKNOWN_ERROR) {}
+
+RecoverableException::RecoverableException
+(const char* file, int line,
+ const RecoverableException& e):
+  Exception(file, line, e),
+  _code(downloadresultcode::UNKNOWN_ERROR) {}
+  
+RecoverableException::RecoverableException
+(const char* file, int line, const std::string& msg,
+ downloadresultcode::RESULT result):
+  Exception(file, line, msg), _code(result) {}
+
+} // namespace aria2

+ 5 - 16
src/RecoverableException.h

@@ -44,29 +44,18 @@ private:
   downloadresultcode::RESULT _code;
 
 protected:
-  virtual SharedHandle<Exception> copy() const
-  {
-    SharedHandle<Exception> e(new RecoverableException(*this));
-    return e;
-  }
+  virtual SharedHandle<Exception> copy() const;
 public:
-  RecoverableException(const char* file, int line, const std::string& msg):
-    Exception(file, line, msg),
-    _code(downloadresultcode::UNKNOWN_ERROR) {}
+  RecoverableException(const char* file, int line, const std::string& msg);
 
   RecoverableException(const char* file, int line, const std::string& msg,
-                       const Exception& cause):
-    Exception(file, line, msg, cause),
-    _code(downloadresultcode::UNKNOWN_ERROR) {}
+                       const Exception& cause);
 
   RecoverableException(const char* file, int line,
-                       const RecoverableException& e):
-    Exception(file, line, e),
-    _code(downloadresultcode::UNKNOWN_ERROR) {}
+                       const RecoverableException& e);
   
   RecoverableException(const char* file, int line, const std::string& msg,
-                       downloadresultcode::RESULT result):
-    Exception(file, line, msg), _code(result) {}
+                       downloadresultcode::RESULT result);
 
   downloadresultcode::RESULT getCode() const { return _code; }
 };