资源简介
jsoncpp v0.6 支持 UInt64(long),很好很强大!
代码片段和文件信息
“““Amalgate json-cpp library sources into a single source and header file.
Requires Python 2.6
Example of invocation (must be invoked from json-cpp top directory):
python amalgate.py
“““
import os
import os.path
import sys
class AmalgamationFile:
def __init__( self top_dir ):
self.top_dir = top_dir
self.blocks = []
def add_text( self text ):
if not text.endswith( ‘\n‘ ):
text += ‘\n‘
self.blocks.append( text )
def add_file( self relative_input_path wrap_in_comment=False ):
def add_marker( prefix ):
self.add_text( ‘‘ )
self.add_text( ‘// ‘ + ‘/‘*70 )
self.add_text( ‘// %s of content of file: %s‘ % (prefix relative_input_path.replace(‘\\‘‘/‘)) )
self.add_text( ‘// ‘ + ‘/‘*70 )
self.add_text( ‘‘ )
add_marker( ‘Beginning‘ )
f = open( os.path.join( self.top_dir relative_input_path ) ‘rt‘ )
content = f.read()
if wrap_in_comment:
content = ‘/*\n‘ + content + ‘\n*/‘
self.add_text( content )
f.close()
add_marker( ‘End‘ )
self.add_text( ‘\n\n\n\n‘ )
def get_value( self ):
return ‘‘.join( self.blocks ).replace(‘\r\n‘‘\n‘)
def write_to( self output_path ):
output_dir = os.path.dirname( output_path )
if output_dir and not os.path.isdir( output_dir ):
os.makedirs( output_dir )
f = open( output_path ‘wb‘ )
f.write( self.get_value() )
f.close()
def amalgamate_source( source_top_dir=None
target_source_path=None
header_include_path=None ):
“““Produces amalgated source.
Parameters:
source_top_dir: top-directory
target_source_path: output .cpp path
header_include_path: generated header path relative to target_source_path.
“““
print ‘Amalgating header...‘
header = AmalgamationFile( source_top_dir )
header.add_text( ‘/// Json-cpp amalgated header (http://jsoncpp.sourceforge.net/).‘ )
header.add_text( ‘/// It is intented to be used with #include <%s>‘ % header_include_path )
header.add_file( ‘LICENSE‘ wrap_in_comment=True )
header.add_text( ‘#ifndef JSON_AMALGATED_H_INCLUDED‘ )
header.add_text( ‘# define JSON_AMALGATED_H_INCLUDED‘ )
header.add_text( ‘/// If defined indicates that the source file is amalgated‘ )
header.add_text( ‘/// to prevent private header inclusion.‘ )
header.add_text( ‘#define JSON_IS_AMALGATED‘ )
header.add_file( ‘include/json/config.h‘ )
header.add_file( ‘include/json/forwards.h‘ )
header.add_file( ‘include/json/features.h‘ )
header.add_file( ‘include/json/value.h‘ )
header.add_file( ‘include/json/reader.h‘ )
header.add_file( ‘include/json/writer.h‘ )
header.add_text( ‘#endif //ifndef JSON_AMALGATED_H_INCLUDED‘ )
target_header_path = os.path.join( os.path.dirname(target_source_path) header_includ
相关资源
- PhotoMapper_v0.6.1
- jsoncpp-src-0.6.0-rc2
- 企业级AIOps实施建议白皮书V0.6-高效运
- 《企业级 AIOps 实施建议》白皮书-V0
- JsonCpp 编译库lib dll VS2015版
- jsoncppvs2015编译文件
- jsoncpp源码+VS2017编译32和64位静态库
- TBtools_windows-64-bits-v0.655
- jsoncpp-vs2017.zip
- jsoncpp一个含静态库
- Jsoncpp_0.6rc2修改版
- 兵河五四v0.6源码
- IntelHex S-Record 文件编辑转换器 V0.60
- jsoncpp 1.8.4
- jsoncpp 源码 1.8.4
- 鼹鼠双鼠标v0.6免费绿色版
- Axure浏览器插件chrome for mac Axure-RP-Ex
- Axure浏览器插件chrome for mac V0.6.3
- jsoncpp-1.9.3-win64-mingw.zip
- LS1C开发板用户手册_V0.60.pdf
评论
共有 条评论