mirror of
https://github.com/open-source-parsers/jsoncpp.git
synced 2024-12-12 10:03:51 +01:00
Added svn:eol-style native
This commit is contained in:
parent
f4b73938d2
commit
e0d7224804
348
SConstruct
348
SConstruct
@ -1,174 +1,174 @@
|
||||
import os
|
||||
import os.path
|
||||
import sys
|
||||
|
||||
JSONCPP_VERSION = '0.1'
|
||||
DIST_DIR = '#dist'
|
||||
|
||||
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
|
||||
|
||||
rootbuild_dir = Dir('#buildscons')
|
||||
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']},
|
||||
toolpath = ['scons-tools'],
|
||||
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 -EHsc /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'], CCFLAGS = "-Wall" )
|
||||
else:
|
||||
print "UNSUPPORTED PLATFORM."
|
||||
env.Exit(1)
|
||||
|
||||
env.Tool('doxygen')
|
||||
env.Tool('substinfile')
|
||||
env.Tool('targz')
|
||||
env.Tool('srcdist')
|
||||
|
||||
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['JSONCPP_VERSION'] = JSONCPP_VERSION
|
||||
env['BUILD_DIR'] = env.Dir(build_dir)
|
||||
env['ROOTBUILD_DIR'] = env.Dir(rootbuild_dir)
|
||||
env['DIST_DIR'] = DIST_DIR
|
||||
class SrcDistAdder:
|
||||
def __init__( self, env ):
|
||||
self.env = env
|
||||
def __call__( self, *args, **kw ):
|
||||
apply( self.env.SrcDist, (self.env['SRCDIST_TARGET'],) + args, kw )
|
||||
env['SRCDIST_ADD'] = SrcDistAdder( env )
|
||||
env['SRCDIST_TARGET'] = os.path.join( DIST_DIR, 'jsoncpp-src-%s.tar.gz' % env['JSONCPP_VERSION'] )
|
||||
env['SRCDIST_BUILDER'] = env.TarGz
|
||||
|
||||
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 )
|
||||
env['SRCDIST_ADD']( 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 buildLibrary( env, target_sources, target_name ):
|
||||
static_lib = env.StaticLibrary( target=target_name + '_${LIB_NAME_SUFFIX}',
|
||||
source=target_sources )
|
||||
shared_lib = env.SharedLibrary( target=target_name + '_${LIB_NAME_SUFFIX}',
|
||||
source=target_sources )
|
||||
global lib_dir
|
||||
env.Install( lib_dir, static_lib )
|
||||
env.Install( lib_dir, shared_lib )
|
||||
env['SRCDIST_ADD']( source=[target_sources] )
|
||||
|
||||
Export( 'env env_testing buildJSONExample buildLibrary 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 )
|
||||
env['SRCDIST_ADD']( source=[target] )
|
||||
|
||||
|
||||
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
|
||||
|
||||
##def buildDoc( doxyfile_path ):
|
||||
## doc_cmd = env.Doxygen( doxyfile_path )
|
||||
|
||||
import SCons.Action
|
||||
ActionFactory = SCons.Action.ActionFactory
|
||||
RunJSONTests = ActionFactory(runJSONTests_action, runJSONTests_string )
|
||||
|
||||
env.Alias( 'check' )
|
||||
|
||||
srcdist_cmd = env['SRCDIST_ADD']( source = """
|
||||
AUTHORS README.txt SConstruct
|
||||
""".split() )
|
||||
env.Alias( 'src-dist', srcdist_cmd )
|
||||
|
||||
buildProjectInDirectory( 'src/jsontestrunner' )
|
||||
buildProjectInDirectory( 'src/lib_json' )
|
||||
buildProjectInDirectory( 'doc' )
|
||||
import os
|
||||
import os.path
|
||||
import sys
|
||||
|
||||
JSONCPP_VERSION = '0.1'
|
||||
DIST_DIR = '#dist'
|
||||
|
||||
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
|
||||
|
||||
rootbuild_dir = Dir('#buildscons')
|
||||
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']},
|
||||
toolpath = ['scons-tools'],
|
||||
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 -EHsc /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'], CCFLAGS = "-Wall" )
|
||||
else:
|
||||
print "UNSUPPORTED PLATFORM."
|
||||
env.Exit(1)
|
||||
|
||||
env.Tool('doxygen')
|
||||
env.Tool('substinfile')
|
||||
env.Tool('targz')
|
||||
env.Tool('srcdist')
|
||||
|
||||
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['JSONCPP_VERSION'] = JSONCPP_VERSION
|
||||
env['BUILD_DIR'] = env.Dir(build_dir)
|
||||
env['ROOTBUILD_DIR'] = env.Dir(rootbuild_dir)
|
||||
env['DIST_DIR'] = DIST_DIR
|
||||
class SrcDistAdder:
|
||||
def __init__( self, env ):
|
||||
self.env = env
|
||||
def __call__( self, *args, **kw ):
|
||||
apply( self.env.SrcDist, (self.env['SRCDIST_TARGET'],) + args, kw )
|
||||
env['SRCDIST_ADD'] = SrcDistAdder( env )
|
||||
env['SRCDIST_TARGET'] = os.path.join( DIST_DIR, 'jsoncpp-src-%s.tar.gz' % env['JSONCPP_VERSION'] )
|
||||
env['SRCDIST_BUILDER'] = env.TarGz
|
||||
|
||||
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 )
|
||||
env['SRCDIST_ADD']( 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 buildLibrary( env, target_sources, target_name ):
|
||||
static_lib = env.StaticLibrary( target=target_name + '_${LIB_NAME_SUFFIX}',
|
||||
source=target_sources )
|
||||
shared_lib = env.SharedLibrary( target=target_name + '_${LIB_NAME_SUFFIX}',
|
||||
source=target_sources )
|
||||
global lib_dir
|
||||
env.Install( lib_dir, static_lib )
|
||||
env.Install( lib_dir, shared_lib )
|
||||
env['SRCDIST_ADD']( source=[target_sources] )
|
||||
|
||||
Export( 'env env_testing buildJSONExample buildLibrary 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 )
|
||||
env['SRCDIST_ADD']( source=[target] )
|
||||
|
||||
|
||||
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
|
||||
|
||||
##def buildDoc( doxyfile_path ):
|
||||
## doc_cmd = env.Doxygen( doxyfile_path )
|
||||
|
||||
import SCons.Action
|
||||
ActionFactory = SCons.Action.ActionFactory
|
||||
RunJSONTests = ActionFactory(runJSONTests_action, runJSONTests_string )
|
||||
|
||||
env.Alias( 'check' )
|
||||
|
||||
srcdist_cmd = env['SRCDIST_ADD']( source = """
|
||||
AUTHORS README.txt SConstruct
|
||||
""".split() )
|
||||
env.Alias( 'src-dist', srcdist_cmd )
|
||||
|
||||
buildProjectInDirectory( 'src/jsontestrunner' )
|
||||
buildProjectInDirectory( 'src/lib_json' )
|
||||
buildProjectInDirectory( 'doc' )
|
||||
|
464
doc/doxyfile.in
464
doc/doxyfile.in
@ -1,232 +1,232 @@
|
||||
# Doxyfile 1.4.3
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = "JsonCpp"
|
||||
PROJECT_NUMBER = %JSONCPP_VERSION%
|
||||
OUTPUT_DIRECTORY = %DOC_TOPDIR%
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
USE_WINDOWS_ENCODING = NO
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
"The $name widget" \
|
||||
"The $name file" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = %TOPDIR%
|
||||
STRIP_FROM_INC_PATH = %TOPDIR%/include
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = NO
|
||||
INHERIT_DOCS = YES
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 3
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = NO
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = YES
|
||||
CASE_SENSE_NAMES = NO
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_DIRECTORIES = YES
|
||||
FILE_VERSION_FILTER =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE = jsoncpp-doxygen-warning.log
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = ../include ../src/lib_json .
|
||||
FILE_PATTERNS = *.h *.cpp *.dox
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = YES
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = YES
|
||||
REFERENCES_RELATION = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = NO
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = json-html-doc-%JSONCPP_VERSION%
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER = header.html
|
||||
HTML_FOOTER = footer.html
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE = jsoncpp.chm
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH = ../include
|
||||
INCLUDE_FILE_PATTERNS = *.h
|
||||
PREDEFINED = JSONCPP_DOC_EXCLUDE_IMPLEMENTATION JSON_VALUE_USE_INTERNAL_MAP
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = NO
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = NO
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
CALL_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MAX_DOT_GRAPH_WIDTH = 1024
|
||||
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||
MAX_DOT_GRAPH_DEPTH = 1000
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
||||
# Doxyfile 1.4.3
|
||||
|
||||
#---------------------------------------------------------------------------
|
||||
# Project related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
PROJECT_NAME = "JsonCpp"
|
||||
PROJECT_NUMBER = %JSONCPP_VERSION%
|
||||
OUTPUT_DIRECTORY = %DOC_TOPDIR%
|
||||
CREATE_SUBDIRS = NO
|
||||
OUTPUT_LANGUAGE = English
|
||||
USE_WINDOWS_ENCODING = NO
|
||||
BRIEF_MEMBER_DESC = YES
|
||||
REPEAT_BRIEF = YES
|
||||
ABBREVIATE_BRIEF = "The $name class" \
|
||||
"The $name widget" \
|
||||
"The $name file" \
|
||||
is \
|
||||
provides \
|
||||
specifies \
|
||||
contains \
|
||||
represents \
|
||||
a \
|
||||
an \
|
||||
the
|
||||
ALWAYS_DETAILED_SEC = NO
|
||||
INLINE_INHERITED_MEMB = NO
|
||||
FULL_PATH_NAMES = YES
|
||||
STRIP_FROM_PATH = %TOPDIR%
|
||||
STRIP_FROM_INC_PATH = %TOPDIR%/include
|
||||
SHORT_NAMES = NO
|
||||
JAVADOC_AUTOBRIEF = NO
|
||||
MULTILINE_CPP_IS_BRIEF = NO
|
||||
DETAILS_AT_TOP = NO
|
||||
INHERIT_DOCS = YES
|
||||
DISTRIBUTE_GROUP_DOC = NO
|
||||
SEPARATE_MEMBER_PAGES = NO
|
||||
TAB_SIZE = 3
|
||||
ALIASES =
|
||||
OPTIMIZE_OUTPUT_FOR_C = NO
|
||||
OPTIMIZE_OUTPUT_JAVA = NO
|
||||
SUBGROUPING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Build related configuration options
|
||||
#---------------------------------------------------------------------------
|
||||
EXTRACT_ALL = YES
|
||||
EXTRACT_PRIVATE = NO
|
||||
EXTRACT_STATIC = YES
|
||||
EXTRACT_LOCAL_CLASSES = NO
|
||||
EXTRACT_LOCAL_METHODS = NO
|
||||
HIDE_UNDOC_MEMBERS = NO
|
||||
HIDE_UNDOC_CLASSES = NO
|
||||
HIDE_FRIEND_COMPOUNDS = NO
|
||||
HIDE_IN_BODY_DOCS = NO
|
||||
INTERNAL_DOCS = YES
|
||||
CASE_SENSE_NAMES = NO
|
||||
HIDE_SCOPE_NAMES = NO
|
||||
SHOW_INCLUDE_FILES = YES
|
||||
INLINE_INFO = YES
|
||||
SORT_MEMBER_DOCS = YES
|
||||
SORT_BRIEF_DOCS = NO
|
||||
SORT_BY_SCOPE_NAME = NO
|
||||
GENERATE_TODOLIST = YES
|
||||
GENERATE_TESTLIST = YES
|
||||
GENERATE_BUGLIST = YES
|
||||
GENERATE_DEPRECATEDLIST= YES
|
||||
ENABLED_SECTIONS =
|
||||
MAX_INITIALIZER_LINES = 30
|
||||
SHOW_USED_FILES = YES
|
||||
SHOW_DIRECTORIES = YES
|
||||
FILE_VERSION_FILTER =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to warning and progress messages
|
||||
#---------------------------------------------------------------------------
|
||||
QUIET = NO
|
||||
WARNINGS = YES
|
||||
WARN_IF_UNDOCUMENTED = YES
|
||||
WARN_IF_DOC_ERROR = YES
|
||||
WARN_NO_PARAMDOC = NO
|
||||
WARN_FORMAT = "$file:$line: $text"
|
||||
WARN_LOGFILE = jsoncpp-doxygen-warning.log
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the input files
|
||||
#---------------------------------------------------------------------------
|
||||
INPUT = ../include ../src/lib_json .
|
||||
FILE_PATTERNS = *.h *.cpp *.dox
|
||||
RECURSIVE = YES
|
||||
EXCLUDE =
|
||||
EXCLUDE_SYMLINKS = NO
|
||||
EXCLUDE_PATTERNS =
|
||||
EXAMPLE_PATH =
|
||||
EXAMPLE_PATTERNS = *
|
||||
EXAMPLE_RECURSIVE = NO
|
||||
IMAGE_PATH =
|
||||
INPUT_FILTER =
|
||||
FILTER_PATTERNS =
|
||||
FILTER_SOURCE_FILES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to source browsing
|
||||
#---------------------------------------------------------------------------
|
||||
SOURCE_BROWSER = YES
|
||||
INLINE_SOURCES = NO
|
||||
STRIP_CODE_COMMENTS = YES
|
||||
REFERENCED_BY_RELATION = YES
|
||||
REFERENCES_RELATION = YES
|
||||
USE_HTAGS = NO
|
||||
VERBATIM_HEADERS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the alphabetical class index
|
||||
#---------------------------------------------------------------------------
|
||||
ALPHABETICAL_INDEX = NO
|
||||
COLS_IN_ALPHA_INDEX = 5
|
||||
IGNORE_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the HTML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_HTML = YES
|
||||
HTML_OUTPUT = json-html-doc-%JSONCPP_VERSION%
|
||||
HTML_FILE_EXTENSION = .html
|
||||
HTML_HEADER = header.html
|
||||
HTML_FOOTER = footer.html
|
||||
HTML_STYLESHEET =
|
||||
HTML_ALIGN_MEMBERS = YES
|
||||
GENERATE_HTMLHELP = NO
|
||||
CHM_FILE = jsoncpp.chm
|
||||
HHC_LOCATION =
|
||||
GENERATE_CHI = NO
|
||||
BINARY_TOC = NO
|
||||
TOC_EXPAND = NO
|
||||
DISABLE_INDEX = NO
|
||||
ENUM_VALUES_PER_LINE = 4
|
||||
GENERATE_TREEVIEW = NO
|
||||
TREEVIEW_WIDTH = 250
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the LaTeX output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_LATEX = NO
|
||||
LATEX_OUTPUT = latex
|
||||
LATEX_CMD_NAME = latex
|
||||
MAKEINDEX_CMD_NAME = makeindex
|
||||
COMPACT_LATEX = NO
|
||||
PAPER_TYPE = a4wide
|
||||
EXTRA_PACKAGES =
|
||||
LATEX_HEADER =
|
||||
PDF_HYPERLINKS = NO
|
||||
USE_PDFLATEX = NO
|
||||
LATEX_BATCHMODE = NO
|
||||
LATEX_HIDE_INDICES = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the RTF output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_RTF = NO
|
||||
RTF_OUTPUT = rtf
|
||||
COMPACT_RTF = NO
|
||||
RTF_HYPERLINKS = NO
|
||||
RTF_STYLESHEET_FILE =
|
||||
RTF_EXTENSIONS_FILE =
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the man page output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_MAN = NO
|
||||
MAN_OUTPUT = man
|
||||
MAN_EXTENSION = .3
|
||||
MAN_LINKS = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the XML output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_XML = NO
|
||||
XML_OUTPUT = xml
|
||||
XML_SCHEMA =
|
||||
XML_DTD =
|
||||
XML_PROGRAMLISTING = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options for the AutoGen Definitions output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_AUTOGEN_DEF = NO
|
||||
#---------------------------------------------------------------------------
|
||||
# configuration options related to the Perl module output
|
||||
#---------------------------------------------------------------------------
|
||||
GENERATE_PERLMOD = NO
|
||||
PERLMOD_LATEX = NO
|
||||
PERLMOD_PRETTY = YES
|
||||
PERLMOD_MAKEVAR_PREFIX =
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the preprocessor
|
||||
#---------------------------------------------------------------------------
|
||||
ENABLE_PREPROCESSING = YES
|
||||
MACRO_EXPANSION = NO
|
||||
EXPAND_ONLY_PREDEF = NO
|
||||
SEARCH_INCLUDES = YES
|
||||
INCLUDE_PATH = ../include
|
||||
INCLUDE_FILE_PATTERNS = *.h
|
||||
PREDEFINED = JSONCPP_DOC_EXCLUDE_IMPLEMENTATION JSON_VALUE_USE_INTERNAL_MAP
|
||||
EXPAND_AS_DEFINED =
|
||||
SKIP_FUNCTION_MACROS = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to external references
|
||||
#---------------------------------------------------------------------------
|
||||
TAGFILES =
|
||||
GENERATE_TAGFILE =
|
||||
ALLEXTERNALS = NO
|
||||
EXTERNAL_GROUPS = YES
|
||||
PERL_PATH = /usr/bin/perl
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration options related to the dot tool
|
||||
#---------------------------------------------------------------------------
|
||||
CLASS_DIAGRAMS = NO
|
||||
HIDE_UNDOC_RELATIONS = YES
|
||||
HAVE_DOT = NO
|
||||
CLASS_GRAPH = YES
|
||||
COLLABORATION_GRAPH = YES
|
||||
GROUP_GRAPHS = YES
|
||||
UML_LOOK = NO
|
||||
TEMPLATE_RELATIONS = NO
|
||||
INCLUDE_GRAPH = YES
|
||||
INCLUDED_BY_GRAPH = YES
|
||||
CALL_GRAPH = NO
|
||||
GRAPHICAL_HIERARCHY = YES
|
||||
DIRECTORY_GRAPH = YES
|
||||
DOT_IMAGE_FORMAT = png
|
||||
DOT_PATH =
|
||||
DOTFILE_DIRS =
|
||||
MAX_DOT_GRAPH_WIDTH = 1024
|
||||
MAX_DOT_GRAPH_HEIGHT = 1024
|
||||
MAX_DOT_GRAPH_DEPTH = 1000
|
||||
DOT_TRANSPARENT = NO
|
||||
DOT_MULTI_TARGETS = NO
|
||||
GENERATE_LEGEND = YES
|
||||
DOT_CLEANUP = YES
|
||||
#---------------------------------------------------------------------------
|
||||
# Configuration::additions related to the search engine
|
||||
#---------------------------------------------------------------------------
|
||||
SEARCHENGINE = NO
|
||||
|
@ -1,23 +1,23 @@
|
||||
<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:jsoncpp-devel@lists.sourceforge.net">Json-cpp Developers</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</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:jsoncpp-devel@lists.sourceforge.net">Json-cpp Developers</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
@ -1,24 +1,24 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
JsonCpp - JSON data format manipulation library
|
||||
</title>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
||||
<link href="tabs.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>
|
||||
<html>
|
||||
<head>
|
||||
<title>
|
||||
JsonCpp - JSON data format manipulation library
|
||||
</title>
|
||||
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
||||
<link href="tabs.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>
|
||||
|
194
doc/jsoncpp.dox
194
doc/jsoncpp.dox
@ -1,97 +1,97 @@
|
||||
/**
|
||||
\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 : { length : 3, use_space = true }
|
||||
}
|
||||
\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() );
|
||||
|
||||
setIndentLength( root["indent"].get("length", 3).asInt() );
|
||||
setIndentUseSpace( root["indent"].get("use_space", true).asBool() );
|
||||
|
||||
// ...
|
||||
// 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"]["length"] = getCurrentIndentLength();
|
||||
root["indent"]["use_space"] = getCurrentIndentUseSpace();
|
||||
|
||||
Json::StyledWriter writer;
|
||||
// Make a new JSON document for the configuration. Preserve original comments.
|
||||
std::string outputConfig = writer.write( root );
|
||||
|
||||
// You can also use streams. This will put the contents of any JSON
|
||||
// stream at a particular sub-value, if you'd like.
|
||||
std::cin >> root["subtree"];
|
||||
|
||||
// And you can write to a stream, using the StyledWriter automatically.
|
||||
std::cout << root;
|
||||
\endcode
|
||||
|
||||
\section _plinks Build instructions
|
||||
The build instruction are located in the file
|
||||
<a HREF="README.txt">README.txt</a> in the top-directory of the project.
|
||||
|
||||
Permanent link to the lastest revision of the file in subversion:
|
||||
<a HREF="http://svn.sourceforge.net/viewcvs.cgi/jsoncpp/README.txt?view=markup">lastest README.txt</a>
|
||||
|
||||
\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 <blep@users.sourceforge.net>
|
||||
*/
|
||||
/**
|
||||
\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 : { length : 3, use_space = true }
|
||||
}
|
||||
\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() );
|
||||
|
||||
setIndentLength( root["indent"].get("length", 3).asInt() );
|
||||
setIndentUseSpace( root["indent"].get("use_space", true).asBool() );
|
||||
|
||||
// ...
|
||||
// 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"]["length"] = getCurrentIndentLength();
|
||||
root["indent"]["use_space"] = getCurrentIndentUseSpace();
|
||||
|
||||
Json::StyledWriter writer;
|
||||
// Make a new JSON document for the configuration. Preserve original comments.
|
||||
std::string outputConfig = writer.write( root );
|
||||
|
||||
// You can also use streams. This will put the contents of any JSON
|
||||
// stream at a particular sub-value, if you'd like.
|
||||
std::cin >> root["subtree"];
|
||||
|
||||
// And you can write to a stream, using the StyledWriter automatically.
|
||||
std::cout << root;
|
||||
\endcode
|
||||
|
||||
\section _plinks Build instructions
|
||||
The build instruction are located in the file
|
||||
<a HREF="README.txt">README.txt</a> in the top-directory of the project.
|
||||
|
||||
Permanent link to the lastest revision of the file in subversion:
|
||||
<a HREF="http://svn.sourceforge.net/viewcvs.cgi/jsoncpp/README.txt?view=markup">lastest README.txt</a>
|
||||
|
||||
\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 <blep@users.sourceforge.net>
|
||||
*/
|
||||
|
@ -1 +1 @@
|
||||
The documentation is generated using doxygen (http://www.doxygen.org).
|
||||
The documentation is generated using doxygen (http://www.doxygen.org).
|
||||
|
@ -1,22 +1,22 @@
|
||||
Import( 'env' )
|
||||
import os.path
|
||||
|
||||
if 'doxygen' in env['TOOLS']:
|
||||
doc_topdir = env['ROOTBUILD_DIR']
|
||||
doxyfile = env.SubstInFile( '#doc/doxyfile', 'doxyfile.in',
|
||||
SUBST_DICT = {
|
||||
'%JSONCPP_VERSION%' : env['JSONCPP_VERSION'],
|
||||
'%TOPDIR%' : env.Dir('#').abspath,
|
||||
'%DOC_TOPDIR%' : str(doc_topdir) } )
|
||||
doc_cmd = env.Doxygen( doxyfile )
|
||||
alias_doc_cmd = env.Alias('doc', doc_cmd )
|
||||
env.AlwaysBuild(alias_doc_cmd)
|
||||
|
||||
for dir in doc_cmd:
|
||||
env.Alias('doc', env.Install( '#' + dir.path, '#README.txt' ) )
|
||||
filename = os.path.split(dir.path)[1]
|
||||
targz_path = os.path.join( env['DIST_DIR'], '%s.tar.gz' % filename )
|
||||
zip_doc_cmd = env.TarGz( targz_path, [env.Dir(dir)],
|
||||
TARGZ_BASEDIR = doc_topdir )
|
||||
env.Depends( zip_doc_cmd, alias_doc_cmd )
|
||||
env.Alias( 'doc-dist', zip_doc_cmd )
|
||||
Import( 'env' )
|
||||
import os.path
|
||||
|
||||
if 'doxygen' in env['TOOLS']:
|
||||
doc_topdir = env['ROOTBUILD_DIR']
|
||||
doxyfile = env.SubstInFile( '#doc/doxyfile', 'doxyfile.in',
|
||||
SUBST_DICT = {
|
||||
'%JSONCPP_VERSION%' : env['JSONCPP_VERSION'],
|
||||
'%TOPDIR%' : env.Dir('#').abspath,
|
||||
'%DOC_TOPDIR%' : str(doc_topdir) } )
|
||||
doc_cmd = env.Doxygen( doxyfile )
|
||||
alias_doc_cmd = env.Alias('doc', doc_cmd )
|
||||
env.AlwaysBuild(alias_doc_cmd)
|
||||
|
||||
for dir in doc_cmd:
|
||||
env.Alias('doc', env.Install( '#' + dir.path, '#README.txt' ) )
|
||||
filename = os.path.split(dir.path)[1]
|
||||
targz_path = os.path.join( env['DIST_DIR'], '%s.tar.gz' % filename )
|
||||
zip_doc_cmd = env.TarGz( targz_path, [env.Dir(dir)],
|
||||
TARGZ_BASEDIR = doc_topdir )
|
||||
env.Depends( zip_doc_cmd, alias_doc_cmd )
|
||||
env.Alias( 'doc-dist', zip_doc_cmd )
|
||||
|
Loading…
Reference in New Issue
Block a user