This repository has been archived by the owner on Jan 22, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #33 from codecurve/code-synthesis-xsd-lib02
Merge CodeSynthesis XSD library (take 2)
- Loading branch information
Showing
180 changed files
with
53,457 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
1. Intent | ||
|
||
We want specified Free/Libre and Open Source Software ("FLOSS") to be | ||
able to use the specified GPL-licensed XSD runtime library (libxsd) and | ||
XSD generated code (collectively called the "Program") despite the fact | ||
that not all FLOSS licenses are compatible with version 2 of the GNU | ||
General Public License (the "GPL"). | ||
|
||
It is our intent to allow distribution of the entire Derivative Work | ||
(including the Program) under one or more of the FLOSS licenses listed | ||
in section 3 (section 2.a). It is also our intent to disallow simple | ||
relicensing of the Program for the sole purpose of using it in | ||
proprietary applications (section 2.b and 2.c). As an example, consider | ||
two hypothetical scenarios: | ||
|
||
a) You created a program that uses the XSD generated code and the XSD | ||
runtime library to access information in XML instance documents. | ||
Your program performs useful computations based on this information | ||
(sections 2.b and 2.c are satisfied). You distribute your program, | ||
including the XSD generated code and the XSD runtime library under | ||
the BSD license and make it available at no charge to all third | ||
parties (section 2.a is satisfied). Later you (or someone else) may | ||
choose to base their proprietary application on your code since the | ||
BSD license does not prohibit it. | ||
|
||
This scenario falls under this FLOSS Exception. | ||
|
||
|
||
b) You created a library that uses the XSD generated code and the XSD | ||
runtime library to access information in XML instance documents. You | ||
did not add to the library any other useful code that uses the XSD | ||
generated code or the XSD runtime library (neither section 2.b nor | ||
2.c is satisfied). You distribute your library, including the XSD | ||
generated code and the XSD runtime library under the BSD license and | ||
make it available at no charge to all third parties (section 2.a | ||
is satisfied). Later you base your proprietary application on this | ||
library since the BSD license does not prohibit it. | ||
|
||
This scenario does not fall under this FLOSS Exception (neither | ||
section 2.b nor 2.c is satisfied). You created the library for the | ||
sole purpose of making the XSD generated code and the XSD runtime | ||
library available to your proprietary application. | ||
|
||
|
||
2. Legal Terms and Conditions | ||
|
||
As a special exception to the terms and conditions of version 2 of | ||
the GPL you are free to distribute a verbatim copy of the Program | ||
as part of the Derivative Work that is formed from the Program or | ||
any part thereof and one or more works (each, a "FLOSS Work") as | ||
long as you also meet all of these conditions: | ||
|
||
a) You must cause the Derivative Work that in whole or in part | ||
contains or is derived from the Program or any part thereof, | ||
to be licensed as a whole at no charge to all third parties | ||
under the terms of one or more of the licenses listed in | ||
section 3. | ||
|
||
b) The Derivative Work should contain one or more FLOSS Work that | ||
can be reasonably considered as derived from the Program or some | ||
part thereof. | ||
|
||
c) The Derivative Work should not contain any part of the Program | ||
that cannot be reasonably considered as a base of one or more | ||
FLOSS Work. | ||
|
||
|
||
3. FLOSS License List | ||
|
||
a) Any license listed in the "GPL-Compatible Free Software Licenses" | ||
and the "GPL-Incompatible Free Software Licenses" sections of the | ||
License List as published by the Free Software Foundation (FSF): | ||
|
||
http://www.gnu.org/licenses/license-list.html | ||
|
||
|
||
4. Definitions | ||
|
||
Terms used, but not defined, herein shall have the meaning provided in | ||
the GPL. | ||
|
||
Derivative Work means a derivative work under copyright law. | ||
|
||
|
||
5. Applicability | ||
|
||
You may choose to redistribute a copy of the Program exclusively under | ||
the terms of the GPL by removing the FLOSS Exception notice from that | ||
copy of the Program. |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
This program is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License version 2 as | ||
published by the Free Software Foundation. | ||
|
||
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 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 St, Fifth Floor, Boston, MA 02110-1301 USA | ||
|
||
In addition, as a special exception, Code Synthesis Tools CC gives | ||
permission to link this program with the Xerces-C++ library (or with | ||
modified versions of Xerces-C++ that use the same license as Xerces-C++), | ||
and distribute linked combinations including the two. You must obey | ||
the GNU General Public License version 2 in all respects for all of | ||
the code used other than Xerces-C++. If you modify this copy of the | ||
program, you may extend this exception to your version of the program, | ||
but you are not obligated to do so. If you do not wish to do so, delete | ||
this exception statement from your version. | ||
|
||
In addition, Code Synthesis Tools CC makes a special exception for | ||
the Free/Libre and Open Source Software (FLOSS) which is described | ||
in the accompanying FLOSSE file. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
libxsd is a runtime library for language mappings generated by | ||
CodeSynthesis XSD, a W3C XML Schema to C++ data binding compiler. | ||
|
||
See the LICENSE file for distribution conditions. | ||
|
||
See the INSTALL file for prerequisites and installation instructions. | ||
|
||
The project page is at http://www.codesynthesis.com/projects/xsd/ | ||
|
||
Send bug reports or any other feedback to the [email protected] | ||
mailing list. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,119 @@ | ||
// file : xsd/cxx/auto-array.hxx | ||
// copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC | ||
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file | ||
|
||
#ifndef XSD_CXX_AUTO_ARRAY_HXX | ||
#define XSD_CXX_AUTO_ARRAY_HXX | ||
|
||
#include <xsd/cxx/config.hxx> // XSD_CXX11 | ||
|
||
#ifdef XSD_CXX11 | ||
# error use std::unique_ptr instead of non-standard auto_array | ||
#endif | ||
|
||
#include <cstddef> // std::size_t | ||
|
||
namespace xsd | ||
{ | ||
namespace cxx | ||
{ | ||
template <typename T> | ||
struct std_array_deleter | ||
{ | ||
void | ||
operator() (T* p) const | ||
{ | ||
delete[] p; | ||
} | ||
}; | ||
|
||
// Simple automatic array. The second template parameter is | ||
// an optional deleter type. If not specified, delete[] | ||
// is used. | ||
// | ||
template <typename T, typename D = std_array_deleter<T> > | ||
struct auto_array | ||
{ | ||
auto_array (T a[]) | ||
: a_ (a), d_ (0) | ||
{ | ||
} | ||
|
||
auto_array (T a[], const D& d) | ||
: a_ (a), d_ (&d) | ||
{ | ||
} | ||
|
||
~auto_array () | ||
{ | ||
if (d_ != 0) | ||
(*d_) (a_); | ||
else | ||
delete[] a_; | ||
} | ||
|
||
T& | ||
operator[] (std::size_t index) const | ||
{ | ||
return a_[index]; | ||
} | ||
|
||
T* | ||
get () const | ||
{ | ||
return a_; | ||
} | ||
|
||
T* | ||
release () | ||
{ | ||
T* tmp (a_); | ||
a_ = 0; | ||
return tmp; | ||
} | ||
|
||
void | ||
reset (T a[] = 0) | ||
{ | ||
if (a_ != a) | ||
{ | ||
if (d_ != 0) | ||
(*d_) (a_); | ||
else | ||
delete[] a_; | ||
|
||
a_ = a; | ||
} | ||
} | ||
|
||
typedef void (auto_array::*bool_convertible)(); | ||
|
||
operator bool_convertible () const | ||
{ | ||
return a_ ? &auto_array<T, D>::true_ : 0; | ||
} | ||
|
||
private: | ||
auto_array (const auto_array&); | ||
|
||
auto_array& | ||
operator= (const auto_array&); | ||
|
||
private: | ||
void | ||
true_ (); | ||
|
||
private: | ||
T* a_; | ||
const D* d_; | ||
}; | ||
|
||
template <typename T, typename D> | ||
void auto_array<T, D>:: | ||
true_ () | ||
{ | ||
} | ||
} | ||
} | ||
|
||
#endif // XSD_CXX_AUTO_ARRAY_HXX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
// file : xsd/cxx/compilers/vc-8/post.hxx | ||
// copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC | ||
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file | ||
|
||
#pragma warning (pop) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// file : xsd/cxx/compilers/vc-8/pre.hxx | ||
// copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC | ||
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file | ||
|
||
// These warnings had to be disabled "for good". | ||
// | ||
#pragma warning (disable:4250) // inherits via dominance | ||
#pragma warning (disable:4661) // no definition for explicit instantiation | ||
|
||
|
||
// Push warning state. | ||
// | ||
#pragma warning (push, 3) | ||
|
||
|
||
// Disabled warnings. | ||
// | ||
#pragma warning (disable:4355) // passing 'this' to a member | ||
#pragma warning (disable:4800) // forcing value to bool | ||
#pragma warning (disable:4275) // non dll-interface base | ||
#pragma warning (disable:4251) // base needs to have dll-interface | ||
#pragma warning (disable:4224) // nonstandard extension (/Za option) | ||
|
||
|
||
// Elevated warnings. | ||
// | ||
#pragma warning (2:4239) // standard doesn't allow this conversion |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// file : xsd/cxx/config.hxx | ||
// copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC | ||
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file | ||
|
||
#ifndef XSD_CXX_CONFIG_HXX | ||
#define XSD_CXX_CONFIG_HXX | ||
|
||
#include <xsd/cxx/version.hxx> | ||
|
||
// Available C++11 features. | ||
// | ||
#ifdef XSD_CXX11 | ||
#ifdef _MSC_VER | ||
# if _MSC_VER >= 1600 | ||
# define XSD_CXX11_NULLPTR | ||
# if _MSC_VER >= 1800 | ||
# define XSD_CXX11_TEMPLATE_ALIAS | ||
# endif | ||
# endif | ||
#else | ||
# if defined(__GXX_EXPERIMENTAL_CXX0X__) || __cplusplus >= 201103L | ||
# ifdef __GNUC__ | ||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || __GNUC__ > 4 | ||
# define XSD_CXX11_NULLPTR | ||
# endif | ||
# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) || __GNUC__ > 4 | ||
# define XSD_CXX11_TEMPLATE_ALIAS | ||
# endif | ||
# else | ||
# define XSD_CXX11_NULLPTR | ||
# define XSD_CXX11_TEMPLATE_ALIAS | ||
# endif | ||
# endif | ||
#endif | ||
#endif // XSD_CXX11 | ||
|
||
#ifdef XSD_CXX11 | ||
# define XSD_AUTO_PTR std::unique_ptr | ||
#else | ||
# define XSD_AUTO_PTR std::auto_ptr | ||
#endif | ||
|
||
// Macro to suppress the unused variable warning. | ||
// | ||
#define XSD_UNUSED(x) (void)x | ||
|
||
#endif // XSD_CXX_CONFIG_HXX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// file : xsd/cxx/exceptions.hxx | ||
// copyright : Copyright (c) 2005-2014 Code Synthesis Tools CC | ||
// license : GNU GPL v2 + exceptions; see accompanying LICENSE file | ||
|
||
#ifndef XSD_CXX_EXCEPTIONS_HXX | ||
#define XSD_CXX_EXCEPTIONS_HXX | ||
|
||
#include <exception> // std::exception | ||
|
||
namespace xsd | ||
{ | ||
namespace cxx | ||
{ | ||
struct exception: std::exception | ||
{ | ||
}; | ||
} | ||
} | ||
|
||
#endif // XSD_CXX_EXCEPTIONS_HXX |
Oops, something went wrong.