parameters: (source_top_dir=None,
                         target_source_path=None,
                         header_include_path=None)
docstring: 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.
docstring_summary: 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.
docstring_tokens: 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 .
function: 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 intended 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_AMALGAMATION")
      header.add_file("include/json/version.h")
      #header.add_file("include/json/allocator.h") # Not available here.
      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_file("include/json/assertions.h")
      header.add_text("#endif //ifndef JSON_AMALGATED_H_INCLUDED")
  
      target_header_path = os.path.join(os.path.dirname(target_source_path), header_include_path)
      print("Writing amalgated header to %r" % target_header_path)
      header.write_to(target_header_path)
  
      base, ext = os.path.splitext(header_include_path)
      forward_header_include_path = base + "-forwards" + ext
      print("Amalgating forward header...")
      header = AmalgamationFile(source_top_dir)
      header.add_text("/// Json-cpp amalgated forward header (http://jsoncpp.sourceforge.net/).")
      header.add_text('/// It is intended to be used with #include "%s"' % forward_header_include_path)
      header.add_text("/// This header provides forward declaration for all JsonCpp types.")
      header.add_file("LICENSE", wrap_in_comment=True)
      header.add_text("#ifndef JSON_FORWARD_AMALGATED_H_INCLUDED")
      header.add_text("# define JSON_FORWARD_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_AMALGAMATION")
      header.add_file("include/json/config.h")
      header.add_file("include/json/forwards.h")
      header.add_text("#endif //ifndef JSON_FORWARD_AMALGATED_H_INCLUDED")
  
      target_forward_header_path = os.path.join(os.path.dirname(target_source_path),
                                                 forward_header_include_path)
      print("Writing amalgated forward header to %r" % target_forward_header_path)
      header.write_to(target_forward_header_path)
  
      print("Amalgating source...")
      source = AmalgamationFile(source_top_dir)
      source.add_text("/// Json-cpp amalgated source (http://jsoncpp.sourceforge.net/).")
      source.add_text('/// It is intended to be used with #include "%s"' % header_include_path)
      source.add_file("LICENSE", wrap_in_comment=True)
      source.add_text("")
      source.add_text('#include "%s"' % header_include_path)
      source.add_text("""
  #ifndef JSON_IS_AMALGAMATION
  #error "Compile with -I PATH_TO_JSON_DIRECTORY"
  #endif
  """)
      source.add_text("")
      lib_json = "src/lib_json"
      source.add_file(os.path.join(lib_json, "json_tool.h"))
      source.add_file(os.path.join(lib_json, "json_reader.cpp"))
      source.add_file(os.path.join(lib_json, "json_valueiterator.inl"))
      source.add_file(os.path.join(lib_json, "json_value.cpp"))
      source.add_file(os.path.join(lib_json, "json_writer.cpp"))
  
      print("Writing amalgated source to %r" % target_source_path)
      source.write_to(target_source_path)
function_tokens: def amalgamate_source ( source_top_dir = None , target_source_path = None , header_include_path = None ) : print ( "Amalgating header..." ) header = AmalgamationFile ( source_top_dir ) header . add_text ( "/// Json-cpp amalgated 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_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_AMALGAMATION" ) header . add_file ( "include/json/version.h" ) #header.add_file("include/json/allocator.h") # Not available here. 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_file ( "include/json/assertions.h" ) header . add_text ( "#endif //ifndef JSON_AMALGATED_H_INCLUDED" ) target_header_path = os . path . join ( os . path . dirname ( target_source_path ) , header_include_path ) print ( "Writing amalgated header to %r" % target_header_path ) header . write_to ( target_header_path ) base , ext = os . path . splitext ( header_include_path ) forward_header_include_path = base + "-forwards" + ext print ( "Amalgating forward header..." ) header = AmalgamationFile ( source_top_dir ) header . add_text ( "/// Json-cpp amalgated forward header (http://jsoncpp.sourceforge.net/)." ) header . add_text ( '/// It is intended to be used with #include "%s"' % forward_header_include_path ) header . add_text ( "/// This header provides forward declaration for all JsonCpp types." ) header . add_file ( "LICENSE" , wrap_in_comment = True ) header . add_text ( "#ifndef JSON_FORWARD_AMALGATED_H_INCLUDED" ) header . add_text ( "# define JSON_FORWARD_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_AMALGAMATION" ) header . add_file ( "include/json/config.h" ) header . add_file ( "include/json/forwards.h" ) header . add_text ( "#endif //ifndef JSON_FORWARD_AMALGATED_H_INCLUDED" ) target_forward_header_path = os . path . join ( os . path . dirname ( target_source_path ) , forward_header_include_path ) print ( "Writing amalgated forward header to %r" % target_forward_header_path ) header . write_to ( target_forward_header_path ) print ( "Amalgating source..." ) source = AmalgamationFile ( source_top_dir ) source . add_text ( "/// Json-cpp amalgated source (http://jsoncpp.sourceforge.net/)." ) source . add_text ( '/// It is intended to be used with #include "%s"' % header_include_path ) source . add_file ( "LICENSE" , wrap_in_comment = True ) source . add_text ( "" ) source . add_text ( '#include "%s"' % header_include_path ) source . add_text ( """
  #ifndef JSON_IS_AMALGAMATION
  #error "Compile with -I PATH_TO_JSON_DIRECTORY"
  #endif
  """ ) source . add_text ( "" ) lib_json = "src/lib_json" source . add_file ( os . path . join ( lib_json , "json_tool.h" ) ) source . add_file ( os . path . join ( lib_json , "json_reader.cpp" ) ) source . add_file ( os . path . join ( lib_json , "json_valueiterator.inl" ) ) source . add_file ( os . path . join ( lib_json , "json_value.cpp" ) ) source . add_file ( os . path . join ( lib_json , "json_writer.cpp" ) ) print ( "Writing amalgated source to %r" % target_source_path ) source . write_to ( target_source_path )