Skip to content

Commit

Permalink
Another simple addition for constructor initialization, PathArgument.
Browse files Browse the repository at this point in the history
git-svn-id: https://jsoncpp.svn.sourceforge.net/svnroot/jsoncpp/trunk@240 1f120ed1-78a5-a849-adca-83f0a9e25bb6
  • Loading branch information
christopherdunn authored and rjeczalik committed Dec 17, 2012
1 parent 807ee08 commit 6dc5ccb
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/lib_json/json_value.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2007-2010 Baptiste Lepilleur
// Copyright 2011 Baptiste Lepilleur
// Distributed under MIT license, or public domain if desired and
// recognized in your jurisdiction.
// See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE
Expand Down Expand Up @@ -270,7 +270,7 @@ Value::CZString::isStaticString() const
*/
Value::Value( ValueType type )
: type_( type )
, allocated_( 0 )
, allocated_( false )
# ifdef JSON_VALUE_USE_INTERNAL_MAP
, itemIsUsed_( 0 )
#endif
Expand Down Expand Up @@ -314,6 +314,7 @@ Value::Value( ValueType type )

Value::Value( UInt value )
: type_( uintValue )
, allocated_( false )
# ifdef JSON_VALUE_USE_INTERNAL_MAP
, itemIsUsed_( 0 )
#endif
Expand All @@ -324,6 +325,7 @@ Value::Value( UInt value )

Value::Value( Int value )
: type_( intValue )
, allocated_( false )
# ifdef JSON_VALUE_USE_INTERNAL_MAP
, itemIsUsed_( 0 )
#endif
Expand All @@ -336,6 +338,7 @@ Value::Value( Int value )
# if defined(JSON_HAS_INT64)
Value::Value( Int64 value )
: type_( intValue )
, allocated_( false )
# ifdef JSON_VALUE_USE_INTERNAL_MAP
, itemIsUsed_( 0 )
#endif
Expand All @@ -347,6 +350,7 @@ Value::Value( Int64 value )

Value::Value( UInt64 value )
: type_( uintValue )
, allocated_( false )
# ifdef JSON_VALUE_USE_INTERNAL_MAP
, itemIsUsed_( 0 )
#endif
Expand All @@ -358,6 +362,7 @@ Value::Value( UInt64 value )

Value::Value( double value )
: type_( realValue )
, allocated_( false )
# ifdef JSON_VALUE_USE_INTERNAL_MAP
, itemIsUsed_( 0 )
#endif
Expand Down Expand Up @@ -432,6 +437,7 @@ Value::Value( const CppTL::ConstString &value )

Value::Value( bool value )
: type_( booleanValue )
, allocated_( false )
# ifdef JSON_VALUE_USE_INTERNAL_MAP
, itemIsUsed_( 0 )
#endif
Expand All @@ -443,6 +449,7 @@ Value::Value( bool value )

Value::Value( const Value &other )
: type_( other.type_ )
, allocated_( false )
# ifdef JSON_VALUE_USE_INTERNAL_MAP
, itemIsUsed_( 0 )
#endif
Expand Down Expand Up @@ -1701,27 +1708,32 @@ Value::end()
// //////////////////////////////////////////////////////////////////

PathArgument::PathArgument()
: kind_( kindNone )
: key_()
, index_()
, kind_( kindNone )
{
}


PathArgument::PathArgument( ArrayIndex index )
: index_( index )
: key_()
, index_( index )
, kind_( kindIndex )
{
}


PathArgument::PathArgument( const char *key )
: key_( key )
, index_()
, kind_( kindKey )
{
}


PathArgument::PathArgument( const std::string &key )
: key_( key.c_str() )
, index_()
, kind_( kindKey )
{
}
Expand Down

0 comments on commit 6dc5ccb

Please sign in to comment.