資源簡(jiǎn)介
jsoncpp源碼,并提供了使用VS2017編譯好的32位和64位的靜態(tài)庫(kù),直接調(diào)用即可。也可以使用其它vs版本,編譯其中的源碼,使用很方便。
代碼片段和文件信息
“““Amalgamate?json-cpp?library?sources?into?a?single?source?and?header?file.
Works?with?python2.6+?and?python3.4+.
Example?of?invocation?(must?be?invoked?from?json-cpp?top?directory):
python?amalgamate.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(str.encode(self.get_value()?‘UTF-8‘))
????????f.close()
def?amalgamate_source(source_top_dir=None
???????????????????????target_source_path=None
???????????????????????header_include_path=None):
????“““Produces?amalgamated?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(“Amalgamating?header...“)
????header?=?AmalgamationFile(source_top_dir)
????header.add_text(“///?Json-cpp?amalgamated?header?(http://jsoncpp.sourceforge.net/).“)
????header.add_text(‘///?It?is?intended?to?be?used?with?#include?“%s“‘?%?header_include_path)
????header.add_file(“LICENSE“?wrap_in_comment=True)
????header.add_text(“#ifndef?JSON_AMALGAMATED_H_INCLUDED“)
????header.add_text(“#?define?JSON_AMALGAMATED_H_INCLUDED“)
????header.add_text(“///?If?defined?indicates?that?the?source?file?is?amalgamated“)
????header.add_text(“///?to?prevent?private?header?inclusion.“)
????header.add_text(“#define?JSON_IS_AMALGAMATION“)
????header.add_file(“include/json/version.h“)
????header.add_file(“include/json/allocator.h“)
????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
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????2588??2019-04-04?16:11??jsoncpp\include\json\allocator.h
?????文件???????2702??2019-04-04?16:11??jsoncpp\include\json\assertions.h
?????文件????????711??2019-04-04?16:11??jsoncpp\include\json\autoli
?????文件???????6141??2019-04-04?16:11??jsoncpp\include\json\config.h
?????文件???????1872??2019-04-04?16:11??jsoncpp\include\json\features.h
?????文件????????819??2019-04-04?16:11??jsoncpp\include\json\forwards.h
?????文件????????459??2019-04-04?16:11??jsoncpp\include\json\json.h
?????文件??????14223??2019-04-04?16:11??jsoncpp\include\json\reader.h
?????文件??????29816??2019-04-04?16:11??jsoncpp\include\json\value.h
?????文件????????808??2019-04-04?16:11??jsoncpp\include\json\version.h
?????文件??????12510??2019-04-04?16:11??jsoncpp\include\json\writer.h
?????文件???????1442??2019-04-04?16:11??jsoncpp\src\.clang-format
?????文件????????232??2019-04-04?16:11??jsoncpp\src\.gitattributes
?????文件????????763??2019-04-04?16:11??jsoncpp\src\.gitignore
?????文件???????2342??2019-04-04?16:11??jsoncpp\src\.travis.yml
?????文件???????4106??2019-04-04?16:11??jsoncpp\src\.travis_sc
?????文件???????2425??2019-04-04?16:11??jsoncpp\src\.travis_sc
?????文件????????215??2019-04-04?16:11??jsoncpp\src\.travis_sc
?????文件?????????67??2019-04-04?16:11??jsoncpp\src\.travis_sc
?????文件????????251??2019-04-04?16:11??jsoncpp\src\.travis_sc
?????文件?????????81??2019-04-04?16:11??jsoncpp\src\.travis_sc
?????文件???????6987??2019-04-04?16:11??jsoncpp\src\amalgamate.py
?????文件???????1153??2019-04-04?16:11??jsoncpp\src\appveyor.yml
?????文件???????4143??2019-04-04?16:11??jsoncpp\src\AUTHORS
????..A..H.?????34816??2019-04-01?19:45??jsoncpp\src\build\.vs\JSONCPP\v15\.suo
?????文件???38760448??2019-04-01?19:45??jsoncpp\src\build\.vs\JSONCPP\v15\Browse.VC.db
?????文件?????741376??2019-04-01?19:42??jsoncpp\src\build\.vs\JSONCPP\v15\Solution.VC.db
?????文件??????32768??2019-04-01?19:42??jsoncpp\src\build\.vs\JSONCPP\v15\Solution.VC.db-shm
?????文件????4136512??2019-04-01?19:45??jsoncpp\src\build\.vs\JSONCPP\v15\Solution.VC.db-wal
?????文件??????18656??2019-04-01?19:42??jsoncpp\src\build\ALL_BUILD.vcxproj
............此處省略541個(gè)文件信息
評(píng)論
共有 條評(píng)論