You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(30) |
Aug
|
Sep
(3) |
Oct
(3) |
Nov
|
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
|
Feb
(7) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(4) |
Dec
|
2010 |
Jan
(1) |
Feb
(41) |
Mar
(15) |
Apr
(5) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(4) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(79) |
Jun
(11) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(1) |
2012 |
Jan
(1) |
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
(1) |
2013 |
Jan
|
Feb
(1) |
Mar
|
Apr
(3) |
May
(13) |
Jun
|
Jul
|
Aug
(6) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
(1) |
Feb
|
Mar
|
Apr
(6) |
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
From: Baptiste L. <bl...@us...> - 2006-02-11 21:17:56
|
Update of /cvsroot/jsoncpp/jsoncpp/src/lib_json In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3848/src/lib_json Modified Files: json_reader.cpp json_writer.cpp Log Message: Fixed compilation issues with Visual C++ 6.0 Index: json_reader.cpp =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/src/lib_json/json_reader.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** json_reader.cpp 30 Jul 2005 17:40:59 -0000 1.3 --- json_reader.cpp 11 Feb 2006 21:17:48 -0000 1.4 *************** *** 50,55 **** lastValueEnd_ = 0; lastValue_ = 0; ! commentsBefore_.clear(); ! errors_.clear(); while ( !nodes_.empty() ) nodes_.pop(); --- 50,55 ---- lastValueEnd_ = 0; lastValue_ = 0; ! commentsBefore_.resize(0); ! errors_.resize(0); while ( !nodes_.empty() ) nodes_.pop(); *************** *** 75,79 **** { currentValue().setComment( commentsBefore_, commentBefore ); ! commentsBefore_.clear(); } --- 75,79 ---- { currentValue().setComment( commentsBefore_, commentBefore ); ! commentsBefore_.resize(0); } *************** *** 361,365 **** break; ! name.clear(); if ( !decodeString( tokenName, name ) ) return recoverFromError( tokenObjectEnd ); --- 361,365 ---- break; ! name.resize(0); if ( !decodeString( tokenName, name ) ) return recoverFromError( tokenObjectEnd ); Index: json_writer.cpp =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/src/lib_json/json_writer.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** json_writer.cpp 30 Jul 2005 17:40:59 -0000 1.5 --- json_writer.cpp 11 Feb 2006 21:17:48 -0000 1.6 *************** *** 68,72 **** FastWriter::write( const Value &root ) { ! document_.clear(); writeValue( root ); document_ += "\n"; --- 68,72 ---- FastWriter::write( const Value &root ) { ! document_.resize(0); writeValue( root ); document_ += "\n"; *************** *** 146,152 **** StyledWriter::write( const Value &root ) { ! document_.clear(); addChildValues_ = false; ! indentString_.clear(); writeCommentBeforeValue( root ); writeValue( root ); --- 146,152 ---- StyledWriter::write( const Value &root ) { ! document_.resize(0); addChildValues_ = false; ! indentString_.resize(0); writeCommentBeforeValue( root ); writeValue( root ); |
From: Baptiste L. <bl...@us...> - 2006-02-11 21:15:39
|
Update of /cvsroot/jsoncpp/jsoncpp/src/lib_json In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3166/src/lib_json Modified Files: json_value.cpp Log Message: Report bug fixes found when working with cppunit2. Index: json_value.cpp =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/src/lib_json/json_value.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** json_value.cpp 31 Oct 2005 17:30:10 -0000 1.6 --- json_value.cpp 11 Feb 2006 21:15:30 -0000 1.7 *************** *** 36,40 **** if ( comment_ ) free( comment_ ); ! comment_ = strdup( text ); } --- 36,40 ---- if ( comment_ ) free( comment_ ); ! comment_ = text ? strdup( text ) : 0; } *************** *** 57,62 **** Value::CZString::CZString( const CZString &other ) ! : cstr_( other.index_ != noDuplication ? strdup( other.cstr_ ) ! : other.cstr_ ) , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate) : other.index_ ) --- 57,62 ---- Value::CZString::CZString( const CZString &other ) ! : cstr_( other.index_ != noDuplication && other.cstr_ != 0 ? strdup( other.cstr_ ) ! : other.cstr_ ) , index_( other.cstr_ ? (other.index_ == noDuplication ? noDuplication : duplicate) : other.index_ ) *************** *** 216,220 **** break; case stringValue: ! value_.string_ = strdup( other.value_.string_ ); break; case arrayValue: --- 216,223 ---- break; case stringValue: ! if ( other.value_.string_ ) ! value_.string_ = strdup( other.value_.string_ ); ! else ! value_.string_ = 0; break; case arrayValue: |
From: Baptiste L. <bl...@us...> - 2006-02-08 22:59:50
|
Update of /cvsroot/jsoncpp/jsoncpp/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1531/test Modified Files: jsontestrunner.py Added Files: runjsontests.py Removed Files: runtests.py Log Message: - added SCons script to build the library and run tests. Index: jsontestrunner.py =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/test/jsontestrunner.py,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** jsontestrunner.py 30 Jul 2005 17:44:25 -0000 1.1 --- jsontestrunner.py 8 Feb 2006 22:59:41 -0000 1.2 *************** *** 1,3 **** ! # Simple implementatoin of a json test runner to run the test against json-py. import sys --- 1,3 ---- ! # Simple implementation of a json test runner to run the test against json-py. import sys --- NEW FILE: runjsontests.py --- import sys import os import os.path import glob def compareOutputs( expected, actual, message ): expected = expected.strip().replace('\r','').split('\n') actual = actual.strip().replace('\r','').split('\n') diff_line = 0 max_line_to_compare = min( len(expected), len(actual) ) for index in xrange(0,max_line_to_compare): if expected[index].strip() != actual[index].strip(): diff_line = index + 1 break if diff_line == 0 and len(expected) != len(actual): diff_line = max_line_to_compare+1 if diff_line == 0: return None def safeGetLine( lines, index ): index += -1 if index >= len(lines): return '' return lines[index].strip() return """ Difference in %s at line %d: Expected: '%s' Actual: '%s' """ % (message, diff_line, safeGetLine(expected,diff_line), safeGetLine(actual,diff_line) ) def safeReadFile( path ): try: return file( path, 'rt' ).read() except IOError, e: return '<File "%s" is missing: %s>' % (path,e) def runAllTests( jsontest_executable_path, input_dir = None ): if not input_dir: input_dir = os.getcwd() tests = glob.glob( os.path.join( input_dir, '*.json' ) ) failed_tests = [] for input_path in tests: print 'TESTING:', input_path, pipe = os.popen( "%s %s" % (jsontest_executable_path, input_path) ) process_output = pipe.read() status = pipe.close() base_path = os.path.splitext(input_path)[0] actual_output = safeReadFile( base_path + '.actual' ) actual_rewrite_output = safeReadFile( base_path + '.actual-rewrite' ) file(base_path + '.process-output','wt').write( process_output ) if status: print 'parsing failed' failed_tests.append( (input_path, 'Parsing failed:\n' + process_output) ) else: expected_output_path = os.path.splitext(input_path)[0] + '.expected' expected_output = file( expected_output_path, 'rt' ).read() detail = ( compareOutputs( expected_output, actual_output, 'input' ) or compareOutputs( expected_output, actual_rewrite_output, 'rewrite' ) ) if detail: print 'FAILED' failed_tests.append( (input_path, detail) ) else: print 'OK' if failed_tests: print print 'Failure details:' for failed_test in failed_tests: print '* Test', failed_test[0] print failed_test[1] print print 'Test results: %d passed, %d failed.' % (len(tests)-len(failed_tests), len(failed_tests) ) return 1 else: print 'All %d tests passed.' % len(tests) return 0 if __name__ == '__main__': if len(sys.argv) < 1 or len(sys.argv) > 2: print "Usage: %s jsontest-executable-path [input-testcase-directory]" % sys.argv[0] sys.exit( 1 ) jsontest_executable_path = os.path.normpath( os.path.abspath( sys.argv[1] ) ) if len(sys.argv) > 1: input_path = os.path.normpath( os.path.abspath( sys.argv[2] ) ) else: input_path = None status = runAllTests( jsontest_executable_path, input_path ) sys.exit( status ) --- runtests.py DELETED --- |
From: Baptiste L. <bl...@us...> - 2006-02-08 22:59:49
|
Update of /cvsroot/jsoncpp/jsoncpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1531 Added Files: SConstruct Log Message: - added SCons script to build the library and run tests. --- NEW FILE: SConstruct --- import os import os.path import sys options = Options() options.Add( EnumOption('platform', 'Platform (compiler/stl) used to build the project', 'msvc71', allowed_values='suncc vacpp mingw msvc6 msvc7 msvc71 msvc80 linux-gcc'.split(), ignorecase=2) ) try: platform = ARGUMENTS['platform'] except KeyError: print 'You must specify a "platform"' sys.exit(2) print "Building using PLATFORM =", platform build_dir = os.path.join( '#buildscons', platform ) bin_dir = os.path.join( '#bin', platform ) lib_dir = os.path.join( '#libs', platform ) sconsign_dir_path = Dir(build_dir).abspath sconsign_path = os.path.join( sconsign_dir_path, '.sconsign.dbm' ) # Ensure build directory exist (SConsignFile fail otherwise!) if not os.path.exists( sconsign_dir_path ): os.makedirs( sconsign_dir_path ) # Store all dependencies signature in a database SConsignFile( sconsign_path ) env = Environment( ENV = {'PATH' : os.environ['PATH']}, tools=[] ) #, tools=['default'] ) if platform == 'suncc': env.Tool( 'sunc++' ) env.Tool( 'sunlink' ) env.Tool( 'sunar' ) env.Append( LIBS = ['pthreads'] ) elif platform == 'vacpp': env.Tool( 'default' ) env.Tool( 'aixcc' ) env['CXX'] = 'xlC_r' #scons does not pick-up the correct one ! # using xlC_r ensure multi-threading is enabled: # http://publib.boulder.ibm.com/infocenter/pseries/index.jsp?topic=/com.ibm.vacpp7a.doc/compiler/ref/cuselect.htm env.Append( CCFLAGS = '-qrtti=all', LINKFLAGS='-bh:5' ) # -bh:5 remove duplicate symbol warning elif platform == 'msvc6': env['MSVS_VERSION']='6.0' for tool in ['msvc', 'msvs', 'mslink', 'masm', 'mslib']: env.Tool( tool ) env['CXXFLAGS']='-GR -GX /nologo /MT' elif platform == 'msvc70': env['MSVS_VERSION']='7.0' for tool in ['msvc', 'msvs', 'mslink', 'masm', 'mslib']: env.Tool( tool ) env['CXXFLAGS']='-GR -GX /nologo /MT' elif platform == 'msvc71': env['MSVS_VERSION']='7.1' for tool in ['msvc', 'msvs', 'mslink', 'masm', 'mslib']: env.Tool( tool ) env['CXXFLAGS']='-GR -GX /nologo /MT' elif platform == 'msvc80': env['MSVS_VERSION']='8.0' for tool in ['msvc', 'msvs', 'mslink', 'masm', 'mslib']: env.Tool( tool ) env['CXXFLAGS']='-GR -GX /nologo /MT' elif platform == 'mingw': env.Tool( 'mingw' ) env.Append( CPPDEFINES=[ "WIN32", "NDEBUG", "_MT" ] ) elif platform == 'linux-gcc': env.Tool( 'default' ) env.Append( LIBS = ['pthread'] ) else: print "UNSUPPORTED PLATFORM." env.Exit(1) env.Append( CPPPATH = ['#include'], LIBPATH = lib_dir ) short_platform = platform if short_platform.startswith('msvc'): short_platform = short_platform[2:] env['LIB_PLATFORM'] = short_platform env['LIB_LINK_TYPE'] = 'lib' # static env['LIB_CRUNTIME'] = 'mt' env['LIB_NAME_SUFFIX'] = '${LIB_PLATFORM}_${LIB_LINK_TYPE}${LIB_CRUNTIME}' # must match autolink naming convention env_testing = env.Copy( ) env_testing.Append( LIBS = ['json_${LIB_NAME_SUFFIX}'] ) def buildJSONExample( env, target_sources, target_name ): env = env.Copy() env.Append( CPPPATH = ['#'] ) exe = env.Program( target=target_name, source=target_sources ) global bin_dir return env.Install( bin_dir, exe ) def buildJSONTests( env, target_sources, target_name ): jsontests_node = buildJSONExample( env, target_sources, target_name ) check_alias_target = env.Alias( 'check', jsontests_node, RunJSONTests( jsontests_node, jsontests_node ) ) env.AlwaysBuild( check_alias_target ) def buildLibary( env, target_sources, target_name ): static_lib = env.StaticLibrary( target=target_name + '_${LIB_NAME_SUFFIX}', source=target_sources ) global lib_dir env.Install( lib_dir, static_lib ) Export( 'env env_testing buildJSONExample buildLibary buildJSONTests' ) def buildProjectInDirectory( target_directory ): global build_dir target_build_dir = os.path.join( build_dir, target_directory ) target = os.path.join( target_directory, 'sconscript' ) SConscript( target, build_dir=target_build_dir, duplicate=0 ) def runJSONTests_action( target, source = None, env = None ): # Add test scripts to python path jsontest_path = Dir( '#test' ).abspath sys.path.insert( 0, jsontest_path ) import runjsontests return runjsontests.runAllTests( os.path.abspath(source), jsontest_path ) def runJSONTests_string( target, source = None, env = None ): return 'RunJSONTests("%s")' % source import SCons.Action ActionFactory = SCons.Action.ActionFactory RunJSONTests = ActionFactory(runJSONTests_action, runJSONTests_string ) env.Alias( 'check' ) buildProjectInDirectory( 'src/jsontest' ) buildProjectInDirectory( 'src/lib_json' ) |
From: Baptiste L. <bl...@us...> - 2006-02-08 22:59:49
|
Update of /cvsroot/jsoncpp/jsoncpp/src/jsontest In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1531/src/jsontest Added Files: sconscript Log Message: - added SCons script to build the library and run tests. --- NEW FILE: sconscript --- Import( 'env_testing buildJSONTests' ) buildJSONTests( env_testing, Split( """ main.cpp """ ), 'jsontest' ) |
From: Baptiste L. <bl...@us...> - 2006-02-08 22:59:49
|
Update of /cvsroot/jsoncpp/jsoncpp/src/lib_json In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1531/src/lib_json Added Files: sconscript Log Message: - added SCons script to build the library and run tests. --- NEW FILE: sconscript --- Import( 'env buildLibary' ) buildLibary( env, Split( """ json_reader.cpp json_value.cpp json_writer.cpp """ ), 'json' ) |
From: Baptiste L. <bl...@us...> - 2006-02-06 21:29:27
|
Update of /cvsroot/jsoncpp/jsoncpp/include/json In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22168/include/json Modified Files: json_config.h Log Message: * fixed compilation: CPPTL is no longer required. Index: json_config.h =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/include/json/json_config.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** json_config.h 31 Oct 2005 17:30:09 -0000 1.3 --- json_config.h 6 Feb 2006 21:29:19 -0000 1.4 *************** *** 6,10 **** /// If defined, indicates that json may leverage CppTL library ! # define JSON_USE_CPPTL 1 --- 6,10 ---- /// If defined, indicates that json may leverage CppTL library ! //# define JSON_USE_CPPTL 1 |
From: Baptiste L. <bl...@us...> - 2005-10-31 17:30:35
|
Update of /cvsroot/jsoncpp/jsoncpp/src/lib_json In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7828/src/lib_json Modified Files: json_value.cpp Log Message: * added optional support for CppTL library enumerator and ConstString. Index: json_value.cpp =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/src/lib_json/json_value.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** json_value.cpp 30 Jul 2005 17:40:59 -0000 1.5 --- json_value.cpp 31 Oct 2005 17:30:10 -0000 1.6 *************** *** 1,5 **** --- 1,10 ---- #include <json/json_value.h> + #include <json/json_writer.h> #include <utility> #include "assert.h" + #ifdef JSON_USE_CPPTL + # include <cpptl/conststring.h> + # include <cpptl/enumerator.h> + #endif #define JSON_ASSERT_UNREACHABLE assert( false ) *************** *** 178,182 **** --- 183,196 ---- { value_.string_ = value.empty() ? 0 : strdup( value.c_str() ); + } + # ifdef JSON_USE_CPPTL + Value::Value( const CppTL::ConstString &value ) + : type_( stringValue ) + , comments_( 0 ) + { + value_.string_ = value.empty() ? 0 : strdup( value.c_str() ); + } + # endif Value::Value( bool value ) *************** *** 366,370 **** { case nullValue: ! return false; case intValue: return value_.int_ == other.value_.int_; --- 380,384 ---- { case nullValue: ! return true; case intValue: return value_.int_ == other.value_.int_; *************** *** 427,430 **** --- 441,452 ---- } + # ifdef JSON_USE_CPPTL + CppTL::ConstString + Value::asConstString() const + { + return CppTL::ConstString( asString().c_str() ); + } + # endif + Value::Int Value::asInt() const *************** *** 532,535 **** --- 554,608 ---- + bool + Value::isConvertibleTo( ValueType other ) const + { + switch ( type_ ) + { + case nullValue: + return true; + case intValue: + return ( other == nullValue && value_.int_ == 0 ) + || other == intValue + || ( other == uintValue && value_.int_ >= 0 ) + || other == realValue + || other == stringValue + || other == booleanValue; + case uintValue: + return ( other == nullValue && value_.uint_ == 0 ) + || ( other == intValue && value_.uint_ <= maxInt ) + || other == uintValue + || other == realValue + || other == stringValue + || other == booleanValue; + case realValue: + return ( other == nullValue && value_.real_ == 0.0 ) + || ( other == intValue && value_.real_ >= minInt && value_.real_ <= maxInt ) + || ( other == uintValue && value_.real_ >= 0 && value_.real_ <= maxUInt ) + || other == realValue + || other == stringValue + || other == booleanValue; + case booleanValue: + return ( other == nullValue && value_.bool_ == false ) + || other == intValue + || other == uintValue + || other == realValue + || other == stringValue + || other == booleanValue; + case stringValue: + return other == stringValue + || ( other == nullValue && (!value_.string_ || value_.string_[0] == 0) ); + case arrayValue: + return other == arrayValue + || ( other == nullValue && value_.map_->size() == 0 ); + case objectValue: + return other == objectValue + || ( other == nullValue && value_.map_->size() == 0 ); + default: + JSON_ASSERT_UNREACHABLE; + } + return false; // unreachable; + } + + /// Number of values in array or object Value::UInt *************** *** 691,694 **** --- 764,790 ---- + # ifdef JSON_USE_CPPTL + Value & + Value::operator[]( const CppTL::ConstString &key ) + { + return (*this)[ key.c_str() ]; + } + + + const Value & + Value::operator[]( const CppTL::ConstString &key ) const + { + return (*this)[ key.c_str() ]; + } + # endif + + + Value & + Value::append( const Value &value ) + { + return (*this)[size()] = value; + } + + Value Value::get( const char *key, *************** *** 708,711 **** --- 804,816 ---- + # ifdef JSON_USE_CPPTL + Value + Value::get( const CppTL::ConstString &key, + const Value &defaultValue ) const + { + return get( key.c_str(), defaultValue ); + } + # endif + bool Value::isMember( const char *key ) const *************** *** 723,726 **** --- 828,839 ---- + # ifdef JSON_USE_CPPTL + bool + Value::isMember( const CppTL::ConstString &key ) const + { + return isMember( key.c_str() ); + } + #endif + Value::Members Value::getMemberNames() const *************** *** 736,739 **** --- 849,877 ---- } + # ifdef JSON_USE_CPPTL + EnumMemberNames + Value::enumMemberNames() const + { + if ( type_ == objectValue ) + { + return CppTL::Enum::any( CppTL::Enum::transform( + CppTL::Enum::keys( *(value_.map_), CppTL::Type<const CZString &>() ), + MemberNamesTransform() ) ); + } + return EnumMemberNames(); + } + + + EnumValues + Value::enumValues() const + { + if ( type_ == objectValue || type_ == arrayValue ) + return CppTL::Enum::anyValues( *(value_.map_), + CppTL::Type<const Value &>() ); + return EnumValues(); + } + + # endif + bool *************** *** 835,838 **** --- 973,984 ---- + std::string + Value::toStyledString() const + { + StyledWriter writer; + return writer.write( *this ); + } + + // class PathArgument // ////////////////////////////////////////////////////////////////// |
From: Baptiste L. <bl...@us...> - 2005-10-31 17:30:28
|
Update of /cvsroot/jsoncpp/jsoncpp/include/json In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7828/include/json Modified Files: json_config.h json_value.h json_writer.h Log Message: * added optional support for CppTL library enumerator and ConstString. Index: json_value.h =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/include/json/json_value.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** json_value.h 29 Sep 2005 21:11:49 -0000 1.5 --- json_value.h 31 Oct 2005 17:30:09 -0000 1.6 *************** *** 7,10 **** --- 7,14 ---- # include <vector> + # ifdef JSON_USE_CPPTL + # include <cpptl/forwards.h> + # endif + namespace Json { *************** *** 33,36 **** --- 37,44 ---- }; + # ifdef JSON_USE_CPPTL + typedef CppTL::AnyEnumerator<const char *> EnumMemberNames; + typedef CppTL::AnyEnumerator<const Value &> EnumValues; + # endif /** \brief Represents a <a HREF="http://www.json.org">JSON</a> value. *************** *** 79,82 **** --- 87,93 ---- Value( const char *value ); Value( const std::string &value ); + # ifdef JSON_USE_CPPTL + Value( const CppTL::ConstString &value ); + # endif Value( bool value ); Value( const Value &other ); *************** *** 100,103 **** --- 111,117 ---- const char *asCString() const; std::string asString() const; + # ifdef JSON_USE_CPPTL + CppTL::ConstString asConstString() const; + # endif Int asInt() const; UInt asUInt() const; *************** *** 115,118 **** --- 129,134 ---- bool isObject() const; + bool isConvertibleTo( ValueType other ) const; + /// Number of values in array or object UInt size() const; *************** *** 138,141 **** --- 154,160 ---- /// Returns true if index < size(). bool isValidIndex( UInt index ) const; + /// Append value to array at the end. + /// Equivalent to jsonvalue[jsonvalue.size()] = value; + Value &append( const Value &value ); // Access an object value by name, create a null member if it does not exist. *************** *** 147,150 **** --- 166,175 ---- // Access an object value by name, returns null if there is no member with that name. const Value &operator[]( const std::string &key ) const; + # ifdef JSON_USE_CPPTL + // Access an object value by name, create a null member if it does not exist. + Value &operator[]( const CppTL::ConstString &key ); + // Access an object value by name, returns null if there is no member with that name. + const Value &operator[]( const CppTL::ConstString &key ) const; + # endif /// Returns the member named key if it exist, defaultValue otherwise. Value get( const char *key, *************** *** 153,164 **** --- 178,203 ---- Value get( const std::string &key, const Value &defaultValue ) const; + # ifdef JSON_USE_CPPTL + /// Returns the member named key if it exist, defaultValue otherwise. + Value get( const CppTL::ConstString &key, + const Value &defaultValue ) const; + # endif /// Returns true if the object has a member named key. bool isMember( const char *key ) const; /// Returns true if the object has a member named key. bool isMember( const std::string &key ) const; + # ifdef JSON_USE_CPPTL + /// Returns true if the object has a member named key. + bool isMember( const CppTL::ConstString &key ) const; + # endif // Returns a list of the member names. Members getMemberNames() const; + # ifdef JSON_USE_CPPTL + EnumMemberNames enumMemberNames() const; + EnumValues enumValues() const; + # endif + void setComment( const char *comment, CommentPlacement placement ); *************** *** 168,171 **** --- 207,212 ---- std::string getComment( CommentPlacement placement ) const; + std::string toStyledString() const; + private: struct CommentInfo *************** *** 204,207 **** --- 245,257 ---- typedef std::map<CZString, Value> ObjectValues; + struct MemberNamesTransform + { + typedef const char *result_type; + const char *operator()( const CZString &name ) const + { + return name.c_str(); + } + }; + union ValueHolder { Index: json_config.h =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/include/json/json_config.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** json_config.h 29 Sep 2005 21:11:49 -0000 1.2 --- json_config.h 31 Oct 2005 17:30:09 -0000 1.3 *************** *** 5,10 **** --- 5,17 ---- //# define JSON_IN_CPPTL 1 + /// If defined, indicates that json may leverage CppTL library + # define JSON_USE_CPPTL 1 + + # ifdef JSON_IN_CPPTL # include <cpptl/config.h> + # ifndef JSON_USE_CPPTL + # define JSON_USE_CPPTL 1 + # endif # endif *************** *** 19,26 **** # endif - # ifdef JSON_IN_CPPTL - /// If defined, indicates that json may leverage CppTL library - # define JSON_USE_CPPTL 1 - # endif - #endif // JSON_CONFIG_H_INCLUDED --- 26,28 ---- Index: json_writer.h =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/include/json/json_writer.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** json_writer.h 30 Jul 2005 17:40:58 -0000 1.4 --- json_writer.h 31 Oct 2005 17:30:09 -0000 1.5 *************** *** 3,7 **** # include "json_value.h" ! # include "json_reader.h" # include <deque> # include <string> --- 3,7 ---- # include "json_value.h" ! //# include "json_reader.h" # include <deque> # include <string> *************** *** 81,85 **** }; - std::string JSON_API valueToString( Value::Int value ); std::string JSON_API valueToString( Value::UInt value ); --- 81,84 ---- *************** *** 88,92 **** std::string JSON_API valueToQuotedString( const char *value ); - } // namespace Json --- 87,90 ---- |
From: Baptiste L. <bl...@us...> - 2005-10-31 17:29:19
|
Update of /cvsroot/jsoncpp/jsoncpp/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7619/doc Modified Files: doxyfile Log Message: * made it possible to use the file on both unix and windows Index: doxyfile =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/doc/doxyfile,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** doxyfile 30 Jul 2005 17:40:58 -0000 1.2 --- doxyfile 31 Oct 2005 17:29:07 -0000 1.3 *************** *** 82,86 **** # configuration options related to the input files #--------------------------------------------------------------------------- ! INPUT = ..\include\json ..\src\lib_json . FILE_PATTERNS = *.h *.cpp *.dox RECURSIVE = NO --- 82,86 ---- # configuration options related to the input files #--------------------------------------------------------------------------- ! INPUT = ../include/json ../src/lib_json . FILE_PATTERNS = *.h *.cpp *.dox RECURSIVE = NO *************** *** 188,192 **** EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES ! INCLUDE_PATH = ..\include INCLUDE_FILE_PATTERNS = *.h PREDEFINED = --- 188,192 ---- EXPAND_ONLY_PREDEF = NO SEARCH_INCLUDES = YES ! INCLUDE_PATH = ../include INCLUDE_FILE_PATTERNS = *.h PREDEFINED = |
From: Baptiste L. <bl...@us...> - 2005-09-29 21:12:00
|
Update of /cvsroot/jsoncpp/jsoncpp/include/json In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18775/include/json Modified Files: json_autolink.h json_config.h json_forwards.h json_reader.h json_value.h Log Message: * added configuration option JSON_IN_CPPTL to allow linking cpptl & json as a single library * json_forwardS.h now includes json_config.h Index: json_value.h =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/include/json/json_value.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** json_value.h 30 Jul 2005 17:40:58 -0000 1.4 --- json_value.h 29 Sep 2005 21:11:49 -0000 1.5 *************** *** 3,7 **** # include "json_forwards.h" - # include "json_config.h" # include <string> # include <map> --- 3,6 ---- Index: json_forwards.h =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/include/json/json_forwards.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** json_forwards.h 30 Jul 2005 17:40:58 -0000 1.4 --- json_forwards.h 29 Sep 2005 21:11:49 -0000 1.5 *************** *** 2,5 **** --- 2,7 ---- # define JSON_FORWARDS_H_INCLUDED + # include "json_config.h" + namespace Json { Index: json_config.h =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/include/json/json_config.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** json_config.h 27 Jul 2005 07:09:23 -0000 1.1.1.1 --- json_config.h 29 Sep 2005 21:11:49 -0000 1.2 *************** *** 2,13 **** # define JSON_CONFIG_H_INCLUDED ! #ifdef JSON_DLL_BUILD ! # define JSON_API __declspec(dllexport) ! #elif defined(JSON_DLL) ! # define JSON_API __declspec(dllimport) ! #else ! # define JSON_API ! #endif #endif // JSON_CONFIG_H_INCLUDED --- 2,26 ---- # define JSON_CONFIG_H_INCLUDED ! /// If defined, indicates that json library is embedded in CppTL library. ! //# define JSON_IN_CPPTL 1 + # ifdef JSON_IN_CPPTL + # include <cpptl/config.h> + # endif + + # ifdef JSON_IN_CPPTL + # define JSON_API CPPTL_API + # elif defined(JSON_DLL_BUILD) + # define JSON_API __declspec(dllexport) + # elif defined(JSON_DLL) + # define JSON_API __declspec(dllimport) + # else + # define JSON_API + # endif + + # ifdef JSON_IN_CPPTL + /// If defined, indicates that json may leverage CppTL library + # define JSON_USE_CPPTL 1 + # endif #endif // JSON_CONFIG_H_INCLUDED Index: json_reader.h =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/include/json/json_reader.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** json_reader.h 30 Jul 2005 17:40:58 -0000 1.3 --- json_reader.h 29 Sep 2005 21:11:49 -0000 1.4 *************** *** 3,7 **** # include "json_forwards.h" - # include "json_config.h" # include "json_value.h" # include <deque> --- 3,6 ---- Index: json_autolink.h =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/include/json/json_autolink.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** json_autolink.h 27 Jul 2005 07:09:23 -0000 1.1.1.1 --- json_autolink.h 29 Sep 2005 21:11:49 -0000 1.2 *************** *** 2,6 **** # define JSON_AUTOLINK_H_INCLUDED ! # if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) # define CPPTL_AUTOLINK_NAME "json" # undef CPPTL_AUTOLINK_DLL --- 2,12 ---- # define JSON_AUTOLINK_H_INCLUDED ! # include "json_config.h" ! ! # ifdef JSON_IN_CPPTL ! # include <cpptl/cpptl_autolink.h> ! # endif ! ! # if !defined(JSON_NO_AUTOLINK) && !defined(JSON_DLL_BUILD) && !defined(JSON_IN_CPPTL) # define CPPTL_AUTOLINK_NAME "json" # undef CPPTL_AUTOLINK_DLL |
From: Baptiste L. <bl...@us...> - 2005-09-29 21:11:57
|
Update of /cvsroot/jsoncpp/jsoncpp/makefiles/vs71 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18775/makefiles/vs71 Modified Files: jsoncpp.suo Log Message: * added configuration option JSON_IN_CPPTL to allow linking cpptl & json as a single library * json_forwardS.h now includes json_config.h Index: jsoncpp.suo =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/makefiles/vs71/jsoncpp.suo,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 Binary files /tmp/cvsFfzyvZ and /tmp/cvs7qr8Pm differ |
From: Baptiste L. <bl...@us...> - 2005-09-29 21:11:57
|
Update of /cvsroot/jsoncpp/jsoncpp/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18775/test Modified Files: runtests.py Log Message: * added configuration option JSON_IN_CPPTL to allow linking cpptl & json as a single library * json_forwardS.h now includes json_config.h Index: runtests.py =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/test/runtests.py,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** runtests.py 30 Jul 2005 17:40:59 -0000 1.3 --- runtests.py 29 Sep 2005 21:11:49 -0000 1.4 *************** *** 6,10 **** if len(sys.argv) != 2: print "Usage: %s jsontest-executable-path" % sys.argv[0] ! sys.Exit( 1 ) jsontest_executable_path = os.path.normpath( os.path.abspath( sys.argv[1] ) ) --- 6,10 ---- if len(sys.argv) != 2: print "Usage: %s jsontest-executable-path" % sys.argv[0] ! sys.exit( 1 ) jsontest_executable_path = os.path.normpath( os.path.abspath( sys.argv[1] ) ) |
From: Baptiste L. <bl...@us...> - 2005-07-30 17:44:35
|
Update of /cvsroot/jsoncpp/jsoncpp/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9416/test Added Files: jsontestrunner.py Log Message: * a tentative implement of a test runner for json-py implementation. --- NEW FILE: jsontestrunner.py --- # Simple implementatoin of a json test runner to run the test against json-py. import sys import os.path import json import types if len(sys.argv) != 2: print "Usage: %s input-json-file", sys.argv[0] sys.exit(3) input_path = sys.argv[1] base_path = os.path.splitext(input_path)[0] actual_path = base_path + '.actual' rewrite_path = base_path + '.rewrite' rewrite_actual_path = base_path + '.actual-rewrite' def valueTreeToString( fout, value, path = '.' ): ty = type(value) if ty is types.DictType: fout.write( '%s={}\n' % path ) suffix = path[-1] != '.' and '.' or '' names = value.keys() names.sort() for name in names: valueTreeToString( fout, value[name], path + suffix + name ) elif ty is types.ListType: fout.write( '%s=[]\n' % path ) for index, childValue in zip( xrange(0,len(value)), value ): valueTreeToString( fout, childValue, path + '[%d]' % index ) elif ty is types.StringType: fout.write( '%s="%s"\n' % (path,value) ) elif ty is types.IntType: fout.write( '%s=%d\n' % (path,value) ) elif ty is types.FloatType: fout.write( '%s=%.16g\n' % (path,value) ) elif value is True: fout.write( '%s=true\n' % path ) elif value is False: fout.write( '%s=false\n' % path ) elif value is None: fout.write( '%s=null\n' % path ) else: assert False and "Unexpected value type" def parseAndSaveValueTree( input, actual_path ): root = json.read( input ) fout = file( actual_path, 'wt' ) valueTreeToString( fout, root ) fout.close() return root def rewriteValueTree( value, rewrite_path ): rewrite = json.write( value ) rewrite = rewrite[1:-1] # Somehow the string is quoted ! jsonpy bug ? file( rewrite_path, 'wt').write( rewrite + '\n' ) return rewrite input = file( input_path, 'rt' ).read() root = parseAndSaveValueTree( input, actual_path ) rewrite = rewriteValueTree( json.write( root ), rewrite_path ) rewrite_root = parseAndSaveValueTree( rewrite, rewrite_actual_path ) sys.exit( 0 ) |
From: Baptiste L. <bl...@us...> - 2005-07-30 17:43:56
|
Update of /cvsroot/jsoncpp/jsoncpp/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9236/test Added Files: test_preserve_comment_01.expected test_preserve_comment_01.json Log Message: * test to check comment rewrite of style writer. --- NEW FILE: test_preserve_comment_01.expected --- .={} .first=1 .second=2 --- NEW FILE: test_preserve_comment_01.json --- /* A comment at the beginning of the file. */ { "first" : 1, // comment after 'first' on the same line /* Comment before 'second' */ "second" : 2 } /* A comment at the end of the file. */ |
From: Baptiste L. <bl...@us...> - 2005-07-30 17:43:34
|
Update of /cvsroot/jsoncpp/jsoncpp/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9127/test Added Files: cleantests.py Log Message: * remove test output files --- NEW FILE: cleantests.py --- # removes all files created during testing import glob import os paths = [] for pattern in [ '*.actual', '*.actual-rewrite', '*.rewrite', '*.process-output' ]: paths += glob.glob( pattern ) for path in paths: os.unlink( path ) |
From: Baptiste L. <bl...@us...> - 2005-07-30 17:43:05
|
Update of /cvsroot/jsoncpp/jsoncpp/makefiles/vs71 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9014/makefiles/vs71 Modified Files: .cvsignore Log Message: * updated Index: .cvsignore =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/makefiles/vs71/.cvsignore,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** .cvsignore 27 Jul 2005 07:09:23 -0000 1.1.1.1 --- .cvsignore 30 Jul 2005 17:42:57 -0000 1.2 *************** *** 1 **** ! .ncb --- 1 ---- ! *.ncb |
From: Baptiste L. <bl...@us...> - 2005-07-30 17:43:05
|
Update of /cvsroot/jsoncpp/jsoncpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9014 Modified Files: .cvsignore Log Message: * updated Index: .cvsignore =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 30 Jul 2005 17:40:58 -0000 1.2 --- .cvsignore 30 Jul 2005 17:42:56 -0000 1.3 *************** *** 1,2 **** --- 1,3 ---- build web + dependencies |
From: Baptiste L. <bl...@us...> - 2005-07-30 17:42:02
|
Update of /cvsroot/jsoncpp/jsoncpp/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8751 Added Files: footer.html header.html jsoncpp.dox readme.txt Log Message: * added more doxygen documentation * added header & footer for web site --- NEW FILE: jsoncpp.dox --- /** \mainpage \section _intro Introduction <a HREF="http://www.json.org/">JSON (JavaScript Object Notation)</a> is a lightweight data-interchange format. It can represents integer, real number, string, an ordered sequence of value, and a collection of name/value pairs. Here is an example of JSON data: \verbatim // Configuration options { // Default encoding for text "encoding" : "UTF-8", // Plug-ins loaded at start-up "plug-ins" : [ "python", "c++", "ruby" ], // Tab indent size indent : 3 } \endverbatim \section _features Features - read and write JSON document - rewrite JSON document preserving original comments \code Json::Value root; // will contains the root value after parsing. Json::Reader reader; bool parsingSuccessful = reader.parse( config_doc, root ); if ( !parsingSuccessful ) { // report to the user the failure and their locations in the document. std::cout << "Failed to parse configuration\n" << reader.getFormatedErrorMessages(); return; } // Get the value of the member of root named 'encoding', return 'UTF-8' if there is no // such member. std::string encoding = root.get("encoding", "UTF-8" ).asString(); // Get the value of the member of root named 'encoding', return a 'null' value if // there is no such member. const Json::Value plugins = root["plug-ins"]; for ( int index = 0; index < plugins.size(); ++index ) // Iterates over the sequence elements. loadPlugIn( plugins[index].asString() ); setIndent( root.get("indent", 3).asInt() ); // ... // At application shutdown to make the new configuration document: // Since Json::Value has implicit constructor for all value types, it is not // necessary to explicitely construct the Json::Value object: root["encoding"] = getCurrentEncoding(); root["indent"] = getCurrentIndent(); Json::StyledWriter writer; // Make a new JSON document for the configuration. Preserve original comments. std::string outputConfig = writer.write( root ); \endcode \section _plinks Project links - <a HREF="http://jsoncpp.sourceforge.net">json-cpp home</a> - <a HREF="http://www.sourceforge.net/projects/jsoncpp">json-cpp sourceforge project</a> \section _rlinks Related links - <a HREF="http://www.json.org/">JSON</a> Specification and alternate language implementations. - <a HREF="http://www.yaml.org/">YAML</a> A data format designed for human readability. - <a HREF="http://www.cl.cam.ac.uk/~mgk25/unicode.html">UTF-8 and Unicode FAQ</a>. \section _license License The json-cpp library and this documentation are in Public Domain. \author Baptiste Lepilleur <bl...@us...> */ --- NEW FILE: footer.html --- <hr> <table width="100%"> <tr> <td width="10%" align="left" valign="center"> <a href="http://sourceforge.net"> <img src="http://sourceforge.net/sflogo.php?group_id=144446" width="88" height="31" border="0" alt="SourceForge Logo"></a> </td> <td width="20%" align="left" valign="center"> hosts this site. </td> <td> </td> <td align="right" valign="center"> Send comments to:<br> <a href="mailto:jso...@li...">Json-cpp Developers</a> </td> </tr> </table> </body> </html> --- NEW FILE: readme.txt --- The documentation is generated using doxygen (http://www.doxygen.org). --- NEW FILE: header.html --- <html> <head> <title> JsonCpp - JSON data format manipulation library </title> <link href="doxygen.css" rel="stylesheet" type="text/css"> </head> <body bgcolor="#ffffff"> <table width="100%"> <tr> <td width="40%" align="left" valign="center"> <a href="http://sourceforge.net/projects/jsoncpp"> JsonCpp project page </a> </td> <td width="40%" align="right" valign="center"> <a href="http://jsoncpp.sourceforge.net">JsonCpp home page</a> </td> </tr> </table> <hr> |
From: Baptiste L. <bl...@us...> - 2005-07-30 17:41:14
|
Update of /cvsroot/jsoncpp/jsoncpp/include/json In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8466/include/json Modified Files: json_forwards.h json_reader.h json_value.h json_writer.h Log Message: * added more doxygen documentation * added support for comment in StyledWriter Index: json_value.h =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/include/json/json_value.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** json_value.h 30 Jul 2005 11:15:11 -0000 1.3 --- json_value.h 30 Jul 2005 17:40:58 -0000 1.4 *************** *** 26,29 **** --- 26,38 ---- }; + enum CommentPlacement + { + commentBefore = 0, ///< a comment placed on the line before a value + commentAfterOnSameLine, ///< a comment just after a value on the same line + commentAfter, ///< a comment on the line after a value (only make sense for root value) + numberOfCommentPlacement + }; + + /** \brief Represents a <a HREF="http://www.json.org">JSON</a> value. * *************** *** 153,160 **** Members getMemberNames() const; ! void setId( ValueId id ); ! ValueId id() const; private: struct CZString { --- 162,183 ---- Members getMemberNames() const; ! void setComment( const char *comment, ! CommentPlacement placement ); ! void setComment( const std::string &comment, ! CommentPlacement placement ); ! bool hasComment( CommentPlacement placement ) const; ! std::string getComment( CommentPlacement placement ) const; private: + struct CommentInfo + { + CommentInfo(); + ~CommentInfo(); + + void setComment( const char *text ); + + char *comment_; + }; + struct CZString { *************** *** 192,199 **** } value_; ValueType type_; ! ValueId id_; }; class PathArgument { --- 215,224 ---- } value_; ValueType type_; ! CommentInfo *comments_; }; + /** \brief Experimental and untested: represents an element of the "path" to access a node. + */ class PathArgument { *************** *** 218,230 **** }; ! /* * Syntax: ! * "." => root node ! * ".[n]" => elements at index 'n' of root node (an array value) ! * ".name" => member named 'name' of root node (an object value) ! * ".name1.name2.name3" ! * ".[0][1][2].name1[3]" ! * ".%" => member name is provided as parameter ! * ".[%]" => index is provied as parameter */ class Path --- 243,256 ---- }; ! /** \brief Experimental and untested: represents a "path" to access a node. ! * * Syntax: ! * - "." => root node ! * - ".[n]" => elements at index 'n' of root node (an array value) ! * - ".name" => member named 'name' of root node (an object value) ! * - ".name1.name2.name3" ! * - ".[0][1][2].name1[3]" ! * - ".%" => member name is provided as parameter ! * - ".[%]" => index is provied as parameter */ class Path *************** *** 241,244 **** --- 267,271 ---- Value resolve( const Value &root, const Value &defaultValue ) const; + /// Creates the "path" to access the specified node and returns a reference on the node. Value &make( Value &root ) const; Index: json_reader.h =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/include/json/json_reader.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** json_reader.h 30 Jul 2005 11:15:11 -0000 1.2 --- json_reader.h 30 Jul 2005 17:40:58 -0000 1.3 *************** *** 4,7 **** --- 4,8 ---- # include "json_forwards.h" # include "json_config.h" + # include "json_value.h" # include <deque> # include <map> *************** *** 11,15 **** namespace Json { - class CommentMemo; class Value; --- 12,15 ---- *************** *** 30,49 **** * \param root [out] Contains the root value of the document if it was * successfully parsed. ! * \return \c true if the document was successfully parsed, \c false if an error occurred. ! */ ! bool parse( const std::string &document, ! Value &root ); ! ! /** \brief Read a Value from a <a HREF="http://www.json.org">JSON</a> document and preserve comments. ! * \param document [in] UTF-8 encoded string containing the document to read. ! * \param root [out] Contains the root value of the document if it was ! * successfully parsed. ! * \param commentMemo [out] Contains the comment associated with the value if it was successfully ! * parsed. * \return \c true if the document was successfully parsed, \c false if an error occurred. */ bool parse( const std::string &document, Value &root, ! CommentMemo &commentMemo ); /** \brief Returns a user friendly string that list errors in the parsed document. --- 30,40 ---- * \param root [out] Contains the root value of the document if it was * successfully parsed. ! * \param collectComments \c true to collect comment and allow writing them back during ! * serialization, \c false to discard comments. * \return \c true if the document was successfully parsed, \c false if an error occurred. */ bool parse( const std::string &document, Value &root, ! bool collectComments = true ); /** \brief Returns a user friendly string that list errors in the parsed document. *************** *** 126,129 **** --- 117,124 ---- int &column ) const; std::string getLocationLineAndColumn( Location location ) const; + void addComment( Location begin, + Location end, + CommentPlacement placement ); + void skipCommentTokens( Token &token ); typedef std::stack<Value *> Nodes; *************** *** 134,191 **** Location end_; Location current_; ! CommentMemo *commentMemo_; ! }; ! ! class JSON_API CommentMemo ! { ! public: ! enum Placement ! { ! atDocumentStart = 1, ! beforeValue, ! afterValueOnSameLine, ! atDocumentEnd ! }; ! ! class CommentInfo ! { ! public: ! std::string comment_; ! Placement placement_; ! ValueId id_; ! }; ! ! CommentMemo(); ! ! void beginDocumentParsing(); ! void parsedCComment( Reader::Location begin, ! Reader::Location end ); ! void parsedCppComment( Reader::Location begin, ! Reader::Location end ); ! void parsedValue( Reader::Location begin, ! Reader::Location end, ! Value &value ); ! void endDocumentParsing(); ! ! unsigned int getCommentCount() const; ! const CommentInfo &getComment( unsigned int index ) const; ! const CommentInfo *findComment( ValueId id, Placement placement ) const; ! private: ! static bool containsNewLine( Reader::Location begin, ! Reader::Location end ); ! void addComment( Reader::Location begin, ! Reader::Location end, ! Placement placement ); ! void registerComment( Placement placement, ! unsigned int index ); ! ! ! typedef std::deque<CommentInfo> Comments; ! typedef std::map<unsigned int> CommentsById; ! Comments comments_; ! CommentsById commentsById_; ! ValueId currentId_; ! Reader::Location lastValueEnd_; ! int monitorNextValue_; }; --- 129,136 ---- Location end_; Location current_; ! Location lastValueEnd_; ! Value *lastValue_; ! std::string commentsBefore_; ! bool collectComments_; }; Index: json_forwards.h =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/include/json/json_forwards.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** json_forwards.h 30 Jul 2005 11:15:11 -0000 1.3 --- json_forwards.h 30 Jul 2005 17:40:58 -0000 1.4 *************** *** 4,8 **** namespace Json { - class CommentMemo; class FastWriter; class Path; --- 4,7 ---- *************** *** 12,17 **** class Value; - typedef unsigned int ValueId; - } // namespace Json --- 11,14 ---- Index: json_writer.h =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/include/json/json_writer.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** json_writer.h 30 Jul 2005 11:15:11 -0000 1.3 --- json_writer.h 30 Jul 2005 17:40:58 -0000 1.4 *************** *** 41,45 **** * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. ! * \sa Reader, Value */ class JSON_API StyledWriter --- 41,48 ---- * - otherwise, it the values do not fit on one line, or the array contains * object or non empty array, then print one value per line. ! * ! * If the Value have comments then they are outputed according to their #CommentPlacement. ! * ! * \sa Reader, Value, Value::setComment() */ class JSON_API StyledWriter *************** *** 54,65 **** std::string write( const Value &root ); - /** \brief Serialize a Value in <a HREF="http://www.json.org">JSON</a> format. - * \param root Value to serialize. - * \param commentMemo Memo generated while parsing a JSON document. - * \return String containing the JSON document that represent the root value. - */ - std::string write( const Value &root, - const CommentMemo &commentMemo ); - private: void writeValue( const Value &value ); --- 57,60 ---- *************** *** 71,80 **** void indent(); void unindent(); ! void writeInitialComment( const Value &root ); ! void writeFinalComment( const Value &root ); ! bool hasMoreComments() const; ! const CommentMemo::CommentInfo &getCurrentComment() const; ! void writeComment( const CommentMemo::CommentInfo &comment ); ! bool hasCommentForValue( const Value &value ) const; typedef std::vector<std::string> ChildValues; --- 66,73 ---- void indent(); void unindent(); ! void writeCommentBeforeValue( const Value &root ); ! void writeCommentAfterValueOnSameLine( const Value &root ); ! bool hasCommentForValue( const Value &value ); ! static std::string normalizeEOL( const std::string &text ); typedef std::vector<std::string> ChildValues; *************** *** 85,90 **** int rightMargin_; int indentSize_; - const CommentMemo *commentMemo_; - unsigned int currentComment_; bool addChildValues_; }; --- 78,81 ---- |
From: Baptiste L. <bl...@us...> - 2005-07-30 17:41:14
|
Update of /cvsroot/jsoncpp/jsoncpp/src/lib_json In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8466/src/lib_json Modified Files: json_reader.cpp json_value.cpp json_writer.cpp Log Message: * added more doxygen documentation * added support for comment in StyledWriter Index: json_value.cpp =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/src/lib_json/json_value.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** json_value.cpp 30 Jul 2005 11:15:11 -0000 1.4 --- json_value.cpp 30 Jul 2005 17:40:59 -0000 1.5 *************** *** 13,16 **** --- 13,39 ---- const Value::UInt Value::maxUInt = Value::UInt(-1); + + Value::CommentInfo::CommentInfo() + : comment_( 0 ) + { + } + + Value::CommentInfo::~CommentInfo() + { + if ( comment_ ) + free( comment_ ); + } + + + void + Value::CommentInfo::setComment( const char *text ) + { + if ( comment_ ) + free( comment_ ); + comment_ = strdup( text ); + } + + + // Notes: index_ indicates if the string was allocated when // a string is stored. *************** *** 92,96 **** Value::Value( ValueType type ) : type_( type ) ! , id_( 0 ) { switch ( type ) --- 115,119 ---- Value::Value( ValueType type ) : type_( type ) ! , comments_( 0 ) { switch ( type ) *************** *** 123,127 **** Value::Value( Int value ) : type_( intValue ) ! , id_( 0 ) { value_.int_ = value; --- 146,150 ---- Value::Value( Int value ) : type_( intValue ) ! , comments_( 0 ) { value_.int_ = value; *************** *** 131,135 **** Value::Value( UInt value ) : type_( uintValue ) ! , id_( 0 ) { value_.uint_ = value; --- 154,158 ---- Value::Value( UInt value ) : type_( uintValue ) ! , comments_( 0 ) { value_.uint_ = value; *************** *** 138,142 **** Value::Value( double value ) : type_( realValue ) ! , id_( 0 ) { value_.real_ = value; --- 161,165 ---- Value::Value( double value ) : type_( realValue ) ! , comments_( 0 ) { value_.real_ = value; *************** *** 145,149 **** Value::Value( const char *value ) : type_( stringValue ) ! , id_( 0 ) { value_.string_ = value ? strdup( value ) : 0; --- 168,172 ---- Value::Value( const char *value ) : type_( stringValue ) ! , comments_( 0 ) { value_.string_ = value ? strdup( value ) : 0; *************** *** 152,156 **** Value::Value( const std::string &value ) : type_( stringValue ) ! , id_( 0 ) { value_.string_ = value.empty() ? 0 : strdup( value.c_str() ); --- 175,179 ---- Value::Value( const std::string &value ) : type_( stringValue ) ! , comments_( 0 ) { value_.string_ = value.empty() ? 0 : strdup( value.c_str() ); *************** *** 159,163 **** Value::Value( bool value ) : type_( booleanValue ) ! , id_( 0 ) { value_.bool_ = value; --- 182,186 ---- Value::Value( bool value ) : type_( booleanValue ) ! , comments_( 0 ) { value_.bool_ = value; *************** *** 167,171 **** Value::Value( const Value &other ) : type_( other.type_ ) ! , id_( 0 ) { switch ( type_ ) --- 190,194 ---- Value::Value( const Value &other ) : type_( other.type_ ) ! , comments_( 0 ) { switch ( type_ ) *************** *** 189,192 **** --- 212,225 ---- JSON_ASSERT_UNREACHABLE; } + if ( other.comments_ ) + { + comments_ = new CommentInfo[numberOfCommentPlacement]; + for ( int comment =0; comment < numberOfCommentPlacement; ++comment ) + { + const CommentInfo &otherComment = other.comments_[comment]; + if ( otherComment.comment_ ) + comments_[comment].setComment( otherComment.comment_ ); + } + } } *************** *** 212,215 **** --- 245,251 ---- JSON_ASSERT_UNREACHABLE; } + + if ( comments_ ) + delete[] comments_; } *************** *** 767,780 **** void ! Value::setId( ValueId id ) { ! id_ = id; } ! ValueId ! Value::id() const { ! return id_; } --- 803,835 ---- void ! Value::setComment( const char *comment, ! CommentPlacement placement ) { ! if ( !comments_ ) ! comments_ = new CommentInfo[numberOfCommentPlacement]; ! comments_[placement].setComment( comment ); } ! void ! Value::setComment( const std::string &comment, ! CommentPlacement placement ) { ! setComment( comment.c_str(), placement ); ! } ! ! ! bool ! Value::hasComment( CommentPlacement placement ) const ! { ! return comments_ != 0 && comments_[placement].comment_ != 0; ! } ! ! std::string ! Value::getComment( CommentPlacement placement ) const ! { ! if ( hasComment(placement) ) ! return comments_[placement].comment_; ! return ""; } Index: json_reader.cpp =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/src/lib_json/json_reader.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** json_reader.cpp 30 Jul 2005 11:15:11 -0000 1.2 --- json_reader.cpp 30 Jul 2005 17:40:59 -0000 1.3 *************** *** 3,6 **** --- 3,7 ---- #include <utility> #include <stdio.h> + #include <assert.h> namespace Json { *************** *** 19,27 **** // Class Reader // ////////////////////////////////////////////////////////////////// Reader::Reader() - : commentMemo_( 0 ) { } --- 20,38 ---- + static bool + containsNewLine( Reader::Location begin, + Reader::Location end ) + { + for ( ;begin < end; ++begin ) + if ( *begin == '\n' || *begin == '\r' ) + return true; + return false; + } + + // Class Reader // ////////////////////////////////////////////////////////////////// Reader::Reader() { } *************** *** 29,57 **** bool Reader::parse( const std::string &document, ! Value &root ) { document_ = document; begin_ = document_.c_str(); end_ = begin_ + document_.length(); current_ = begin_; errors_.clear(); while ( !nodes_.empty() ) nodes_.pop(); nodes_.push( &root ); ! return readValue(); ! } ! ! ! bool ! Reader::parse( const std::string &document, ! Value &root, ! CommentMemo &commentMemo ) ! { ! commentMemo_ = &commentMemo; ! commentMemo.beginDocumentParsing(); ! bool success = parse( document, root ); ! commentMemo.endDocumentParsing(); ! commentMemo_ = 0; ! return success; } --- 40,65 ---- bool Reader::parse( const std::string &document, ! Value &root, ! bool collectComments ) { + collectComments_ = collectComments; document_ = document; begin_ = document_.c_str(); end_ = begin_ + document_.length(); current_ = begin_; + lastValueEnd_ = 0; + lastValue_ = 0; + commentsBefore_.clear(); errors_.clear(); while ( !nodes_.empty() ) nodes_.pop(); nodes_.push( &root ); ! ! bool successful = readValue(); ! Token token; ! skipCommentTokens( token ); ! if ( collectComments_ && !commentsBefore_.empty() ) ! root.setComment( commentsBefore_, commentAfter ); ! return successful; } *************** *** 61,80 **** { Token token; ! do { ! readToken( token ); } ! while ( token.type_ == tokenComment ); switch ( token.type_ ) { case tokenObjectBegin: ! return readObject( token ); case tokenArrayBegin: ! return readArray( token ); case tokenNumber: ! return decodeNumber( token ); case tokenString: ! return decodeString( token ); case tokenTrue: currentValue() = true; --- 69,96 ---- { Token token; ! skipCommentTokens( token ); ! bool successful = true; ! ! if ( collectComments_ && !commentsBefore_.empty() ) { ! currentValue().setComment( commentsBefore_, commentBefore ); ! commentsBefore_.clear(); } ! switch ( token.type_ ) { case tokenObjectBegin: ! successful = readObject( token ); ! break; case tokenArrayBegin: ! successful = readArray( token ); ! break; case tokenNumber: ! successful = decodeNumber( token ); ! break; case tokenString: ! successful = decodeString( token ); ! break; case tokenTrue: currentValue() = true; *************** *** 89,93 **** return addError( "Syntax error: value, object or array expected.", token ); } ! return true; } --- 105,127 ---- return addError( "Syntax error: value, object or array expected.", token ); } ! ! if ( collectComments_ ) ! { ! lastValueEnd_ = current_; ! lastValue_ = ¤tValue(); ! } ! ! return successful; ! } ! ! ! void ! Reader::skipCommentTokens( Token &token ) ! { ! do ! { ! readToken( token ); ! } ! while ( token.type_ == tokenComment ); } *************** *** 210,219 **** Reader::readComment() { Char c = getNextChar(); if ( c == '*' ) ! return readCStyleComment(); else if ( c == '/' ) ! return readCppStyleComment(); ! return false; } --- 244,289 ---- Reader::readComment() { + Location commentBegin = current_ - 1; Char c = getNextChar(); + bool successful = false; if ( c == '*' ) ! successful = readCStyleComment(); else if ( c == '/' ) ! successful = readCppStyleComment(); ! if ( !successful ) ! return false; ! ! if ( collectComments_ ) ! { ! CommentPlacement placement = commentBefore; ! if ( lastValueEnd_ && !containsNewLine( lastValueEnd_, commentBegin ) ) ! { ! if ( c != '*' || !containsNewLine( commentBegin, current_ ) ) ! placement = commentAfterOnSameLine; ! } ! ! addComment( commentBegin, current_, placement ); ! } ! return true; ! } ! ! ! void ! Reader::addComment( Location begin, ! Location end, ! CommentPlacement placement ) ! { ! assert( collectComments_ ); ! if ( placement == commentAfterOnSameLine ) ! { ! assert( lastValue_ != 0 ); ! lastValue_->setComment( std::string( begin, end ), placement ); ! } ! else ! { ! if ( !commentsBefore_.empty() ) ! commentsBefore_ += "\n"; ! commentsBefore_ += std::string( begin, end ); ! } } *************** *** 281,284 **** --- 351,359 ---- while ( readToken( tokenName ) ) { + bool initialTokenOk = true; + while ( tokenName.type_ == tokenComment && initialTokenOk ) + initialTokenOk = readToken( tokenName ); + if ( !initialTokenOk ) + break; if ( tokenName.type_ == tokenObjectEnd && name.empty() ) // empty object return true; *************** *** 624,768 **** - // Class Reader - // ////////////////////////////////////////////////////////////////// - CommentMemo::CommentMemo() - : currentId_( 0 ) - , lastValueEnd_( 0 ) - { - } - - - void - CommentMemo::beginDocumentParsing() - { - monitorNextValue_ = 0; - lastValueEnd_ = 0; - } - - - void - CommentMemo::parsedCComment( Reader::Location begin, - Reader::Location end ) - { - if ( lastValueEnd_ == 0 ) - addComment( begin, end, atDocumentStart ); - else if ( containsNewLine( begin, end ) || containsNewLine( lastValueEnd_, begin ) ) - addComment( begin, end, beforeValue ); - else - addComment( begin, end, afterValueOnSameLine ); - } - - - void - CommentMemo::parsedCppComment( Reader::Location begin, - Reader::Location end ) - { - if ( lastValueEnd_ == 0 ) - addComment( begin, end, atDocumentStart ); - else if ( containsNewLine( lastValueEnd_, begin ) ) - addComment( begin, end, beforeValue ); - else - addComment( begin, end, afterValueOnSameLine ); - } - - - void - CommentMemo::parsedValue( Reader::Location begin, - Reader::Location end, - Value &value ) - { - value.setId( ++currentId_ ); - for ( ; monitorNextValue_ > 0; --monitorNextValue_ ) - { - unsigned int index = (unsigned int)(comments_.size() - monitorNextValue_); - comments_[ index ].id_ = currentId_; - registerComment( comments_[index].placement_, index ); - // commentsById_[currentId_ << 4 | comments_[index].placement_] = index; - } - } - - - void - CommentMemo::endDocumentParsing() - { - unsigned int size = (unsigned int)comments_.size(); - if ( !size ) - return; - while ( --size && comments_[size].id_ == ValueId(-1) ) - { - comments_[size].id_ = currentId_; - comments_[size].placement_ = atDocumentEnd; - registerComment( atDocumentEnd, size ); - } - } - - - unsigned int - CommentMemo::getCommentCount() const - { - return (unsigned int)comments_.size(); - } - - - const CommentMemo::CommentInfo & - CommentMemo::getComment( unsigned int index ) const - { - return comments_.at(index); - } - - - bool - CommentMemo::containsNewLine( Reader::Location begin, - Reader::Location end ) - { - for ( ;begin < end; ++begin ) - if ( *begin == '\n' || *begin == '\r' ) - return true; - return false; - } - - - void - CommentMemo::addComment( Reader::Location begin, - Reader::Location end, - Placement placement ) - { - CommentInfo info; - info.comment_ = std::string( begin, end ); - info.placement_ = placement; - if ( placement == afterValueOnSameLine ) - { - info.id_ = currentId_; - registerComment( placement, comments_.size() ); - } - else - { - info.id_ = -1; - ++monitorNextValue_; - } - - comments_.push_back( info ); - } - - - void - CommentMemo::registerComment( Placement placement, - unsigned int index ) - { - commentsById_[ placement | currentId_ * 8 ] = index; - } - - - const CommentMemo::CommentInfo * - CommentMemo::findComment( ValueId id, Placement placement ) const - { - unsigned int key = placement | id * 8; - CommentsById::const_iterator it = commentsById_.find( key ); - if ( it == commentsById_.end() ) - return 0; - return &((*it).second); - } - - - } // namespace Json --- 699,701 ---- Index: json_writer.cpp =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/src/lib_json/json_writer.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** json_writer.cpp 30 Jul 2005 11:15:11 -0000 1.4 --- json_writer.cpp 30 Jul 2005 17:40:59 -0000 1.5 *************** *** 149,169 **** addChildValues_ = false; indentString_.clear(); - writeValue( root ); - document_ += "\n"; - return document_; - } - - - std::string - StyledWriter::write( const Value &root, - const CommentMemo &commentMemo ) - { - commentMemo_ = &commentMemo; - writeInitialComment( root ); writeCommentBeforeValue( root ); ! write( root ); writeCommentAfterValueOnSameLine( root ); ! writeFinalComment( root ); ! commentMemo_ = 0; return document_; } --- 149,156 ---- addChildValues_ = false; indentString_.clear(); writeCommentBeforeValue( root ); ! writeValue( root ); writeCommentAfterValueOnSameLine( root ); ! document_ += "\n"; return document_; } *************** *** 331,338 **** { char last = document_[document_.length()-1]; - assert( last != '\n' ); if ( last == ' ' ) // already indented return; ! document_ += '\n'; } document_ += indentString_; --- 318,325 ---- { char last = document_[document_.length()-1]; if ( last == ' ' ) // already indented return; ! if ( last != '\n' ) // Comments may add new-line ! document_ += '\n'; } document_ += indentString_; *************** *** 364,387 **** void ! StyledWriter::writeInitialComment( const Value &root ) { ! currentComment_ = 0; ! for ( ; hasMoreComments() ! && getCurrentComment().id_ == root.id() ! && getCurrentComment().placement_ == CommentMemo::atDocumentStart; ! ++currentComment_ ) ! writeComment( getCurrentComment() ); } void ! StyledWriter::writeFinalComment( const Value &root ) { ! for ( ; hasMoreComments() ! && getCurrentComment().id_ == root.id() ! && getCurrentComment().placement_ == CommentMemo::atDocumentEnd; ! ++currentComment_ ) { ! writeComment( commentMemo_->getComment( currentComment_++ ) ); } } --- 351,374 ---- void ! StyledWriter::writeCommentBeforeValue( const Value &root ) { ! if ( !root.hasComment( commentBefore ) ) ! return; ! document_ += normalizeEOL( root.getComment( commentBefore ) ); ! document_ += "\n"; } void ! StyledWriter::writeCommentAfterValueOnSameLine( const Value &root ) { ! if ( root.hasComment( commentAfterOnSameLine ) ) ! document_ += " " + normalizeEOL( root.getComment( commentAfterOnSameLine ) ); ! ! if ( root.hasComment( commentAfter ) ) { ! document_ += "\n"; ! document_ += normalizeEOL( root.getComment( commentAfter ) ); ! document_ += "\n"; } } *************** *** 389,416 **** bool ! StyledWriter::hasMoreComments() const ! { ! return commentMemo_ && currentComment_ < commentMemo_->getCommentCount(); ! } ! ! ! const CommentMemo::CommentInfo & ! StyledWriter::getCurrentComment() const ! { ! return commentMemo_->getComment( currentComment_ ); ! } ! ! ! void ! StyledWriter::writeComment( const CommentMemo::CommentInfo &comment ) { ! document_ += comment.comment_; ! document_ += "\n"; } ! bool ! StyledWriter::hasCommentForValue( const Value &value ) const { } --- 376,408 ---- bool ! StyledWriter::hasCommentForValue( const Value &value ) { ! return value.hasComment( commentBefore ) ! || value.hasComment( commentAfterOnSameLine ) ! || value.hasComment( commentAfter ); } ! std::string ! StyledWriter::normalizeEOL( const std::string &text ) { + std::string normalized; + normalized.reserve( text.length() ); + const char *begin = text.c_str(); + const char *end = begin + text.length(); + const char *current = begin; + while ( current != end ) + { + char c = *current++; + if ( c == '\r' ) // mac or dos EOL + { + if ( *current == '\n' ) // convert dos EOL + ++current; + normalized += '\n'; + } + else // handle unix EOL & other char + normalized += c; + } + return normalized; } |
From: Baptiste L. <bl...@us...> - 2005-07-30 17:41:14
|
Update of /cvsroot/jsoncpp/jsoncpp/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8466/test Modified Files: .cvsignore runtests.py Log Message: * added more doxygen documentation * added support for comment in StyledWriter Index: .cvsignore =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/test/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 27 Jul 2005 22:28:07 -0000 1.2 --- .cvsignore 30 Jul 2005 17:40:59 -0000 1.3 *************** *** 3,4 **** --- 3,6 ---- *.rewrite *.process-output + *.pyc + json.py Index: runtests.py =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/test/runtests.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** runtests.py 27 Jul 2005 22:28:07 -0000 1.2 --- runtests.py 30 Jul 2005 17:40:59 -0000 1.3 *************** *** 75,79 **** print 'Test results: %d passed, %d failed.' % (len(tests)-len(failed_tests), len(failed_tests) ) else: print 'All %d tests passed.' % len(tests) ! --- 75,80 ---- print 'Test results: %d passed, %d failed.' % (len(tests)-len(failed_tests), len(failed_tests) ) + sys.exit(1) else: print 'All %d tests passed.' % len(tests) ! sys.exit(0) |
From: Baptiste L. <bl...@us...> - 2005-07-30 17:41:13
|
Update of /cvsroot/jsoncpp/jsoncpp/makefiles/vs71 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8466/makefiles/vs71 Modified Files: jsoncpp.suo Log Message: * added more doxygen documentation * added support for comment in StyledWriter Index: jsoncpp.suo =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/makefiles/vs71/jsoncpp.suo,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 Binary files /tmp/cvsRmzJtk and /tmp/cvsXH1KTU differ |
From: Baptiste L. <bl...@us...> - 2005-07-30 17:41:11
|
Update of /cvsroot/jsoncpp/jsoncpp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8466 Modified Files: .cvsignore Log Message: * added more doxygen documentation * added support for comment in StyledWriter Index: .cvsignore =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/.cvsignore,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** .cvsignore 27 Jul 2005 07:09:23 -0000 1.1.1.1 --- .cvsignore 30 Jul 2005 17:40:58 -0000 1.2 *************** *** 1 **** --- 1,2 ---- build + web |
From: Baptiste L. <bl...@us...> - 2005-07-30 17:41:08
|
Update of /cvsroot/jsoncpp/jsoncpp/doc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8466/doc Modified Files: .cvsignore doxyfile Log Message: * added more doxygen documentation * added support for comment in StyledWriter Index: doxyfile =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/doc/doxyfile,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** doxyfile 30 Jul 2005 11:15:11 -0000 1.1 --- doxyfile 30 Jul 2005 17:40:58 -0000 1.2 *************** *** 4,9 **** # Project related configuration options #--------------------------------------------------------------------------- ! PROJECT_NAME = "Json Cpp" ! PROJECT_NUMBER = 1.0 OUTPUT_DIRECTORY = docbuild CREATE_SUBDIRS = NO --- 4,9 ---- # Project related configuration options #--------------------------------------------------------------------------- ! PROJECT_NAME = "JsonCpp" ! PROJECT_NUMBER = 0.0 OUTPUT_DIRECTORY = docbuild CREATE_SUBDIRS = NO *************** *** 78,86 **** WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" ! WARN_LOGFILE = #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- ! INPUT = ..\include\json ..\src\lib_json FILE_PATTERNS = *.h *.cpp *.dox RECURSIVE = NO --- 78,86 ---- WARN_NO_PARAMDOC = NO WARN_FORMAT = "$file:$line: $text" ! WARN_LOGFILE = jsoncpp-doxygen-warning.log #--------------------------------------------------------------------------- # configuration options related to the input files #--------------------------------------------------------------------------- ! INPUT = ..\include\json ..\src\lib_json . FILE_PATTERNS = *.h *.cpp *.dox RECURSIVE = NO *************** *** 117,122 **** HTML_OUTPUT = html HTML_FILE_EXTENSION = .html ! HTML_HEADER = ! HTML_FOOTER = HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES --- 117,122 ---- HTML_OUTPUT = html HTML_FILE_EXTENSION = .html ! HTML_HEADER = header.html ! HTML_FOOTER = footer.html HTML_STYLESHEET = HTML_ALIGN_MEMBERS = YES Index: .cvsignore =================================================================== RCS file: /cvsroot/jsoncpp/jsoncpp/doc/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 30 Jul 2005 11:15:11 -0000 1.1 --- .cvsignore 30 Jul 2005 17:40:58 -0000 1.2 *************** *** 3,5 **** jsoncpp.qbk *.xml ! generate_catalog.py \ No newline at end of file --- 3,6 ---- jsoncpp.qbk *.xml ! generate_catalog.py ! *.log \ No newline at end of file |