595 Commits

Author SHA1 Message Date
Joel Holdsworth
2b2e80cda1 XMLOutputArchive: Do not take c_str from a temporary string 2014-04-01 11:14:48 -07:00
Shane Grant
631aace6cf Adding macros for minimal functions
Also added some documentation to macros.hpp

relates #60
2014-03-26 17:09:16 -07:00
Shane Grant
f56a51b2f1 Merge branch 'capitalization' of https://github.com/mattyclarkson/cereal into mattyclarkson-capitalization
Conflicts:
	include/cereal/types/common.hpp
2014-03-26 14:45:39 -07:00
Randolph Voorhies
798a598f48 Commenting out OS X fixes for now.
This breaks the build on travis, so I'll need to wait until I can use an
Ubuntu machine to check this out further. Relevant to issue #81.
2014-03-24 15:07:47 -07:00
Randolph Voorhies
8230f54bb4 Better checking for long on OS X for JSON 2014-03-24 14:44:56 -07:00
Randolph Voorhies
8934f65578 Accidently committed commented out version.
This actually does address issue #81.
2014-03-24 14:19:37 -07:00
Randolph Voorhies
0001a31100 (unsigned)long JSONInputArchive::loadValue overloads
Adding overloads for cereal::JSONINputArchive(long & value) and
cereal::JSONINputArchive(unsigned long & value) to fix a compile issue
on OS X with clang 3.3 and libc++. This addresses issue #81. Please
check to make sure this works on the rest of the standard compilers
before closing.
2014-03-24 14:15:20 -07:00
Shane Grant
b6026f6e32 Merge branch 'issue23_new' into develop 2014-03-20 23:12:36 -07:00
Shane Grant
26d31872e3 Update copyright 2013 -> 2014 2014-03-20 20:36:04 -07:00
Shane Grant
074ab07bfe removing unnecessary const 2014-03-20 20:03:19 -07:00
Shane Grant
4bc8dada80 Removing superflous template disambiguation
Also added some GCC 4.7.3 workaround, hurray for supporting more than one compiler!
2014-03-20 19:29:23 -07:00
Shane Grant
a088095518 cleanup 2014-03-20 15:07:54 -07:00
Shane Grant
4fb9e3bf73 removing dead code 2014-03-20 15:06:45 -07:00
Shane Grant
348d2d763d Updating unit tests to include minimal specializations 2014-03-20 14:18:56 -07:00
Shane Grant
41082f702d minimal working with enums
see #23
2014-03-20 11:16:24 -07:00
Shane Grant
8abfa583b0 Nearly done with #23
Still some kinks to work out in regards to trait checks on a non-member
load_minimal that accepts everything as template parameters and does
enable_if style checks
2014-03-19 22:41:34 -07:00
Shane Grant
0423779b94 minimal serialize functions now take Archive as const ref parameter
Even though there is currently no need to use this archive parameter, it is now
passed to the various minimal serialization functions instead of simply being
a template parameter.

The reason for this was ultimately allow for correct name-lookup of the functions
using ADL when the type was unable to provide this (e.g. a generic serialize function
for enums written in the cereal namespace).

Also fixed some issues with GCC 4.7 and the various traits that warn if the type for the
load isn't passed by const ref.  Had to use a workaround found here:

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51213 (=delete instead of private).
2014-03-19 17:55:03 -07:00
Shane Grant
738da2bedb about to make some changes 2014-03-19 14:25:03 -07:00
Shane Grant
267d489a03 doxygen updates 2014-03-18 21:52:11 -07:00
Shane Grant
084532fe53 traits now compiling properly for #23 2014-03-18 17:44:58 -07:00
Shane Grant
b915326877 Another attempt at #72 2014-03-18 12:05:27 -07:00
Shane Grant
12a70b1336 work on traits
revisit the static assert on line 691 of traits firing at the wrong time
2014-03-17 22:51:08 -07:00
Shane Grant
d0d23980d5 adding const check to versioned 2014-03-17 22:24:39 -07:00
Shane Grant
e4429f0df4 Putting in check for invalid load_minmal type parameter 2014-03-17 22:22:52 -07:00
Shane Grant
3a35be8ffc adding traits for load_minimal non member versioned 2014-03-17 21:14:04 -07:00
Shane Grant
e6c3192b18 adding traits for load_minimal versioned member 2014-03-17 21:10:05 -07:00
Shane Grant
e7928a7c8d fairly happy with load_minimal traits 2014-03-17 20:55:57 -07:00
Shane Grant
cda37514d4 tidying up error messages 2014-03-17 19:41:31 -07:00
Shane Grant
6c5e776efb fixing issues with any and noconvert in traits
see #23
2014-03-17 19:33:48 -07:00
Shane Grant
02517c27f9 work on traits
see #23
2014-03-17 18:48:51 -07:00
Matt Clarkson
e7f7692d6a Preprocessor defines for serialization function names
The following preprocessor defines have been added:

 - CEREAL_SERIALIZE_FUNCTION_NAME
 - CEREAL_SAVE_FUNCTION_NAME
 - CEREAL_LOAD_FUNCTION_NAME

These defines specifiy the name of the cereal serialization/deserialization
functions so that they can be customised by users. This is especially useful if
the user would like to have capitialized function names.
2014-03-17 15:56:18 +00:00
Shane Grant
db8b0919a0 traits improvements
see #23
2014-03-16 18:36:28 -07:00
Shane Grant
f51145c906 Cleaning up prior work on traits for load_minimal
writing type traits is a wonderful battle against the compiler

see #23
2014-03-16 17:57:04 -07:00
Shane Grant
5116ced7ba progress on load type traits
see #23
2014-03-16 17:39:27 -07:00
Shane Grant
454d3ca438 update bad serialize static_assert 2014-03-15 21:35:04 -07:00
Shane Grant
dd6cf4c3cf Now emitting errors if mixing versioning on output serialization
If someone attempts to have both a versioned and non-versioned serialization
function, they will get a compile time error.

relates to improvements in #23
2014-03-15 21:21:02 -07:00
Shane Grant
5c87e68cb9 Increasing readability of static_assert on clang and other compilers that don't
actually print newlines
2014-03-15 19:36:59 -07:00
Shane Grant
22f0070a83 making versioned compatible with specialization
Also fixed a bug with some type traits that would erroneously return true if
an odd number of boolean variables were true when the desired behavior was to return
false if more than one boolean variable was true.

Need to revise the no matching serialization to properly fire if a type is specialized
but has both versioned and non-versioned functions of the specialization type.
2014-03-15 19:09:57 -07:00
Shane Grant
2225fcaf91 specialize_serialize now works with versioning
todo: load, save, and non member versions of them all
2014-03-15 18:24:40 -07:00
Shane Grant
be617d0a62 Adding save_minimal to many other traits 2014-03-15 17:51:55 -07:00
Shane Grant
88d76b3866 Detecting invalid return types for save_minimal
both member and non-member, static_asserts look good
2014-03-15 17:42:01 -07:00
Shane Grant
953090e645 Progress on traits for #23
Re-made a repo based on a more recent version of develop.
Syntax for save_minimal looking good so far.
2014-03-15 17:27:51 -07:00
Shane Grant
5f3e9fb9f1 code tidy up 2014-03-15 14:29:37 -07:00
Shane Grant
ab5a89a16f Fixing support for several numeric types in JSON
longs should now properly serialize under 32 or 64 bit machines.

long long, unsigned long long, and long double now serialize as base10
strings instead of base64.

see issue #72
2014-03-14 23:31:25 -07:00
Shane Grant
33180eac14 doc update and fix minor bug with vector test 2014-03-14 00:20:41 -07:00
Shane Grant
fd02187150 Making VS happy with #64 2014-03-13 22:55:43 -07:00
Shane Grant
c8b6e2444a Merge branch 'new_options' into develop 2014-03-13 22:30:10 -07:00
Shane Grant
5a303d33e2 Finishing up options
see #64
2014-03-13 22:28:29 -07:00
Shane Grant
ae3a27510f minor formatting 2014-03-13 12:20:16 -07:00
Shane Grant
2a0510506c No more messing up enable_shared_from_this refcounts
Modified the polymorphic saving of pointers to use a second
shared_ptr to manage the refcount of the wrapper proper polymorphic
shared_ptr (previously we were using an empty deleter).  The result of
this is that the wrapper doesn't actually manage the pointer it holds,
it just allows access to it so long as there is still a refcount in
the second refcount pointer.

Modified the polymorphic wrapper and enable shared from this state
saver to be RAII style.
2014-03-13 11:53:24 -07:00