libtabula

Check-in [bc21e10c05]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Dropped throw-specs, that being one of the things we always wanted to do for "MySQL++ 4.0". This obviates the porting of the MAY_THROW() stuff from MySQL++ 3.2.x.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: bc21e10c05dea38963b618918d9693bca9daf37c
User & Date: tangent 2018-10-28 11:08:57
Context
2018-10-28
11:53
Forward-ported all of the differences between MySQL++ 3.2.1 (the point where libtabula originally forked off) and the current trunk version, which includes changes made after the release of MySQL++ 3.2.4. Leaf check-in: 6c22637ceb user: tangent tags: trunk
11:08
Dropped throw-specs, that being one of the things we always wanted to do for "MySQL++ 4.0". This obviates the porting of the MAY_THROW() stuff from MySQL++ 3.2.x. check-in: bc21e10c05 user: tangent tags: trunk
10:47
Updated the Doxyfile.in files for Doxygen 1.8.14. check-in: f3a0657c56 user: tangent tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/beemutex.cpp.

     1      1   /***********************************************************************
     2      2    beemutex.cpp - Implements the BeecryptMutex class.  The name comes
     3      3   	from the fact that we lifted this essentially intact from the
     4      4   	Beecrypt library, which is also LGPL.  See beecrypt.h for the list
     5      5   	of changes we made on integrating it into libtabula.
     6      6   
     7         - Copyright © 2004 Beeyond Software Holding BV and © 2007 by
            7  + Copyright © 2004 Beeyond Software Holding BV and © 2007, 2018 by
     8      8    Educational Technology Resources, Inc.  Others may also hold
     9      9    copyrights on code in this file.  See the CREDITS.md file in the
    10     10    top directory of the distribution for details.
    11     11   
    12     12    This file is part of libtabula.
    13     13   
    14     14    libtabula is free software; you can redistribute it and/or modify it
................................................................................
    57     57   #	if defined(LIBTABULA_PLATFORM_WINDOWS)
    58     58   		static bc_mutex_t impl_val(void* p)
    59     59   				{ return *static_cast<bc_mutex_t*>(p); }
    60     60   #	endif
    61     61   #endif
    62     62   
    63     63   
    64         -BeecryptMutex::BeecryptMutex() throw (MutexFailed)
           64  +BeecryptMutex::BeecryptMutex()
    65     65   #if defined(ACTUALLY_DOES_SOMETHING)
    66     66   	: pmutex_(new bc_mutex_t)
    67     67   #endif
    68     68   {
    69     69   #if defined(LIBTABULA_PLATFORM_WINDOWS)
    70     70   	*impl_ptr(pmutex_) = CreateMutex((LPSECURITY_ATTRIBUTES) 0, FALSE,
    71     71   			(LPCTSTR) 0);
................................................................................
    99     99   
   100    100   	delete impl_ptr(pmutex_);
   101    101   #endif
   102    102   }
   103    103   
   104    104   
   105    105   void
   106         -BeecryptMutex::lock() throw (MutexFailed)
          106  +BeecryptMutex::lock()
   107    107   {
   108    108   #if defined(LIBTABULA_PLATFORM_WINDOWS)
   109    109   	if (WaitForSingleObject(impl_val(pmutex_), INFINITE) == WAIT_OBJECT_0)
   110    110   		return;
   111    111   	throw MutexFailed("WaitForSingleObject failed");
   112    112   #else
   113    113   #	if HAVE_SYNCH_H || HAVE_PTHREAD
................................................................................
   121    121   			throw MutexFailed(strerror(rc));
   122    122   #	endif
   123    123   #endif
   124    124   }
   125    125   
   126    126   
   127    127   bool
   128         -BeecryptMutex::trylock() throw (MutexFailed)
          128  +BeecryptMutex::trylock()
   129    129   {
   130    130   #if defined(ACTUALLY_DOES_SOMETHING)
   131    131   #	if defined(LIBTABULA_PLATFORM_WINDOWS)
   132    132   		switch (WaitForSingleObject(impl_val(pmutex_), 0)) {
   133    133   			case WAIT_TIMEOUT:
   134    134   				return false;
   135    135   			case WAIT_OBJECT_0:
................................................................................
   156    156   #else
   157    157   	return true;		// no-op build, so always succeed
   158    158   #endif
   159    159   }
   160    160   
   161    161   
   162    162   void
   163         -BeecryptMutex::unlock() throw (MutexFailed)
          163  +BeecryptMutex::unlock()
   164    164   {
   165    165   #if defined(LIBTABULA_PLATFORM_WINDOWS)
   166    166   	if (!ReleaseMutex(impl_val(pmutex_)))
   167    167   		throw MutexFailed("ReleaseMutex failed");
   168    168   #else
   169    169   #	if HAVE_SYNCH_H || HAVE_PTHREAD
   170    170   		register int rc;

Changes to src/beemutex.h.

    13     13   ///   a .cpp file so we don't have to make the header depend on config.h
    14     14   ///   on autoconf-using systems
    15     15   /// - made private mutex member a void* so we don't have to define the
    16     16   ///   full type in the .h file, due to previous item
    17     17   /// - added more Doxygen comments, and changed some existing comments
    18     18   
    19     19   /***********************************************************************
    20         - Copyright © 2004 Beeyond Software Holding BV and © 2007-2008
           20  + Copyright © 2004 Beeyond Software Holding BV and © 2007-2008, 2018
    21     21    by Educational Technology Resources, Inc.  Others may also hold
    22     22    copyrights on code in this file.  See the CREDITS.md file in the
    23     23    top directory of the distribution for details.
    24     24   
    25     25    This file is part of libtabula.
    26     26   
    27     27    libtabula is free software; you can redistribute it and/or modify it
................................................................................
    57     57   class LIBTABULA_EXPORT BeecryptMutex
    58     58   {
    59     59   public:
    60     60   	/// \brief Create the mutex object
    61     61   	///
    62     62   	/// Throws a MutexFailed exception if we can't acquire the lock for
    63     63   	/// some reason.  The exception contains a message saying why.
    64         -	BeecryptMutex() throw (MutexFailed);
           64  +	BeecryptMutex();
    65     65   
    66     66   	/// \brief Destroy the mutex
    67     67   	///
    68     68   	/// Failures are quietly ignored.
    69     69   	~BeecryptMutex();
    70     70   
    71     71   	/// \brief Acquire the mutex, blocking if it can't be acquired
    72     72   	/// immediately.
    73         -	void lock() throw (MutexFailed);
           73  +	void lock();
    74     74   
    75     75   	/// \brief Acquire the mutex immediately and return true, or return
    76     76   	/// false if it would have to block to acquire the mutex.
    77         -	bool trylock() throw (MutexFailed);
           77  +	bool trylock();
    78     78   
    79     79   	/// \brief Release the mutex
    80         -	void unlock() throw (MutexFailed);
           80  +	void unlock();
    81     81   
    82     82   private:
    83     83   	void* pmutex_;
    84     84   };
    85     85   
    86     86   
    87     87   /// \brief Wrapper around BeecryptMutex to add scope-bound locking

Changes to src/common.h.

     4      4   ///
     5      5   /// This file mostly takes care of platform differences.
     6      6   
     7      7   /***********************************************************************
     8      8    Copyright
     9      9      © 1998 by Kevin Atkinson
    10     10      © 1999-2001 by MySQL AB
    11         -   © 2004-2009, 2015 by Educational Technology Resources, Inc.
           11  +   © 2004-2009, 2015, 2018 by Educational Technology Resources, Inc.
    12     12      © 2009, 2014 by Warren Young
    13     13      
    14     14    Others may also hold copyrights on code in this file.  See the
    15     15    CREDITS.md file in the top directory of the distribution for details.
    16     16   
    17     17    This file is part of libtabula.
    18     18   
................................................................................
   121    121   	// Make DLL stuff a no-op on this platform.
   122    122   	#define LIBTABULA_EXPORT
   123    123   
   124    124   	// Assume POSIX path separator
   125    125   	#define LIBTABULA_PATH_SEPARATOR '/'
   126    126   #endif
   127    127   
   128         -#if defined(LIBTABULA_MYSQL_HEADERS_BURIED)
   129         -#	include <mysql/mysql_version.h>
   130         -#else
   131         -#	include <mysql_version.h>
          128  +// C++11 added unique_ptr as a replacement for auto_ptr.  We don't have
          129  +// the ABI problem above with this one, so we switch to it with the
          130  +// oldest release possible.  As with the above ifdef, this one only
          131  +// currently works for g++ and clang++.
          132  +#if __cplusplus >= 201103L
          133  +#	define UNIQUE_PTR(what) std::unique_ptr<what>
          134  +#	define UNIQUE_PTR(what) std::auto_ptr<what>
   132    135   #endif
   133    136   
   134    137   namespace libtabula {
   135    138   
   136    139   /// \brief Alias for 'true', to make code requesting exceptions more
   137    140   /// readable.
   138    141   const bool use_exceptions = true;

Changes to src/exceptions.h.

     2      2   /// \brief Declares the libtabula-specific exception classes.
     3      3   ///
     4      4   /// When exceptions are enabled for a given libtabula::OptionalExceptions
     5      5   /// derivative, any of these exceptions can be thrown on error.
     6      6   
     7      7   /***********************************************************************
     8      8    Copyright © 1998 by Kevin Atkinson, © 1999-2001 by MySQL AB, and
     9         - © 2004-2010 by Educational Technology Resources, Inc.  Others may
            9  + © 2004-2010, 2018 by Educational Technology Resources, Inc.  Others may
    10     10    also hold copyrights on code in this file.  See the CREDITS.md file
    11     11    in the top directory of the distribution for details.
    12     12   
    13     13    This file is part of libtabula.
    14     14   
    15     15    libtabula is free software; you can redistribute it and/or modify it
    16     16    under the terms of the GNU Lesser General Public License as published
................................................................................
    42     42   
    43     43   /// \brief Base class for all libtabula custom exceptions
    44     44   
    45     45   class LIBTABULA_EXPORT Exception : public std::exception
    46     46   {
    47     47   public:
    48     48   	/// \brief Create exception object as copy of another
    49         -	Exception(const Exception& e) throw() :
           49  +	Exception(const Exception& e) :
    50     50   	std::exception(e),
    51     51   	what_(e.what_)
    52     52   	{
    53     53   	}
    54     54   
    55     55   	/// \brief Assign another exception object's contents to this one
    56     56   	Exception& operator=(const Exception& rhs) throw()

Changes to src/stadapter.cpp.

     1      1   /***********************************************************************
     2      2    stadapter.cpp - Implements the SQLTypeAdapter class.
     3      3   
     4      4    Copyright © 1998 by Kevin Atkinson, © 1999-2001 by MySQL AB, and
     5         - © 2004-2009 by Educational Technology Resources, Inc.  Others may
            5  + © 2004-2009, 2018 by Educational Technology Resources, Inc.  Others may
     6      6    also hold copyrights on code in this file.  See the CREDITS.md file
     7      7    in the top directory of the distribution for details.
     8      8   
     9      9    This file is part of libtabula.
    10     10   
    11     11    libtabula is free software; you can redistribute it and/or modify it
    12     12    under the terms of the GNU Lesser General Public License as published
................................................................................
   412    412   {
   413    413   	buffer_ = new SQLBuffer(null_str, typeid(void), true);
   414    414   	is_processed_ = false;
   415    415   	return *this;
   416    416   }
   417    417   
   418    418   char
   419         -SQLTypeAdapter::at(size_type i) const throw(std::out_of_range)
          419  +SQLTypeAdapter::at(size_type i) const
   420    420   {
   421    421   	if (buffer_) {
   422    422   		if (i <= length()) {
   423    423   			return *(buffer_->data() + i);
   424    424   		}
   425    425   		else {
   426    426   			throw BadIndex("Not enough chars in SQLTypeAdapter", int(i),

Changes to src/stadapter.h.

     1      1   /// \file stadapter.h
     2      2   /// \brief Declares the SQLTypeAdapter class
     3      3   
     4      4   /***********************************************************************
     5      5    Copyright © 1998 by Kevin Atkinson, © 1999-2001 by MySQL AB, and
     6         - © 2004-2009 by Educational Technology Resources, Inc.  Others may
            6  + © 2004-2009, 2018 by Educational Technology Resources, Inc.  Others may
     7      7    also hold copyrights on code in this file.  See the CREDITS.md file
     8      8    in the top directory of the distribution for details.
     9      9   
    10     10    This file is part of libtabula.
    11     11   
    12     12    libtabula is free software; you can redistribute it and/or modify it
    13     13    under the terms of the GNU Lesser General Public License as published
................................................................................
   213    213   
   214    214   	/// \brief Returns the character at a given position within the
   215    215   	/// string buffer.
   216    216   	///
   217    217   	/// \throw libtabula::BadIndex if the internal buffer is not
   218    218   	/// initialized (default ctor called, and no subsequent assignment)
   219    219   	/// or if there are not at least i + 1 characters in the buffer.
   220         -	///
   221         -	/// WARNING: The throw-spec is incorrect, but it can't be changed
   222         -	/// until v4, where we can break the ABI.  Throw-specs shouldn't be
   223         -	/// relied on anyway.
   224         -	char at(size_type i) const throw(std::out_of_range);
          220  +	char at(size_type i) const;
   225    221   
   226    222   	/// \brief Compare the internal buffer to the given string
   227    223   	///
   228    224   	/// Works just like string::compare(const std::string&).
   229    225   	int compare(const SQLTypeAdapter& other) const;
   230    226   
   231    227   	/// \brief Compare the internal buffer to the given string