documentation and fixed a typo

This commit is contained in:
Shane Grant
2013-07-09 16:08:25 -07:00
parent 5e6fdb339a
commit a047688c5c
2 changed files with 10 additions and 1 deletions

View File

@@ -283,7 +283,7 @@ namespace cereal
even cout! */
JSONInputArchive(std::istream & stream) :
InputArchive<JSONInputArchive>(this),
itsReadStream(is)
itsReadStream(stream)
{
itsDocument.ParseStream<0>(itsReadStream);
itsValueStack.push_back(itsDocument.MemberBegin());

View File

@@ -294,6 +294,15 @@ int main()
std::cout << "---------------------" << std::endl << str << std::endl << "---------------------" << std::endl;
}
{
cereal::JSONOutputArchive archive( std::cout );
bool arr[] = {true, false};
std::vector<int> vec = {1, 2, 3, 4, 5};
archive( CEREAL_NVP(vec),
arr );
}
//{
// std::ifstream is("file.json");
// cereal::JSONInputArchive iar( is );