├── .clang-format ├── docs ├── doc.png ├── bc_s.png ├── bc_sd.png ├── bdwn.png ├── closed.png ├── nav_f.png ├── nav_fd.png ├── nav_g.png ├── nav_h.png ├── nav_hd.png ├── open.png ├── tab_a.png ├── tab_ad.png ├── tab_b.png ├── tab_bd.png ├── tab_h.png ├── tab_hd.png ├── tab_s.png ├── tab_sd.png ├── splitbar.png ├── sync_off.png ├── sync_on.png ├── folderopen.png ├── splitbard.png ├── folderclosed.png ├── search │ ├── search_l.png │ ├── search_m.png │ ├── search_r.png │ ├── namespaces_0.js │ ├── classes_0.js │ ├── all_6.js │ ├── typedefs_0.js │ ├── classes_1.js │ ├── all_0.js │ ├── all_f.js │ ├── functions_5.js │ ├── functions_0.js │ ├── functions_e.js │ ├── pages_0.js │ ├── enums_0.js │ ├── enums_1.js │ ├── variables_0.js │ ├── variables_1.js │ ├── variables_2.js │ ├── enumvalues_2.js │ ├── enumvalues_1.js │ ├── classes_2.js │ ├── functions_3.js │ ├── functions_7.js │ ├── all_e.js │ ├── all_5.js │ ├── functions_d.js │ ├── all_1.js │ ├── functions_1.js │ ├── enumvalues_0.js │ ├── all_3.js │ ├── functions_a.js │ ├── all_8.js │ ├── all_10.js │ ├── functions_f.js │ ├── functions_6.js │ ├── functions_9.js │ ├── nomatches.html │ ├── all_b.js │ ├── functions_4.js │ ├── functions_c.js │ ├── searchdata.js │ ├── all_4.js │ ├── all_a.js │ ├── all_7.js │ ├── mag.svg │ ├── mag_d.svg │ ├── close.svg │ ├── all_c.js │ ├── functions_b.js │ ├── all_d.js │ ├── mag_sel.svg │ ├── mag_seld.svg │ ├── functions_2.js │ ├── all_2.js │ ├── all_0.html │ ├── all_1.html │ ├── all_2.html │ ├── all_3.html │ ├── all_4.html │ ├── all_5.html │ ├── all_6.html │ ├── all_7.html │ ├── all_8.html │ ├── all_9.html │ ├── all_a.html │ ├── all_b.html │ ├── all_c.html │ ├── all_d.html │ ├── all_e.html │ ├── all_f.html │ ├── all_10.html │ ├── enums_0.html │ ├── enums_1.html │ ├── pages_0.html │ ├── classes_0.html │ ├── classes_1.html │ ├── classes_2.html │ ├── typedefs_0.html │ ├── enumvalues_0.html │ ├── enumvalues_1.html │ ├── enumvalues_2.html │ ├── functions_0.html │ ├── functions_1.html │ ├── functions_2.html │ ├── functions_3.html │ ├── functions_4.html │ ├── functions_5.html │ ├── functions_6.html │ ├── functions_7.html │ ├── functions_8.html │ ├── functions_9.html │ ├── functions_a.html │ ├── functions_b.html │ ├── functions_c.html │ ├── functions_d.html │ ├── functions_e.html │ ├── functions_f.html │ ├── namespaces_0.html │ ├── variables_0.html │ ├── variables_1.html │ ├── variables_2.html │ ├── all_9.js │ └── functions_8.js ├── classipfs_1_1http_1_1Transport.png ├── classipfs_1_1http_1_1TransportCurl.png ├── doc.svg ├── docd.svg ├── folderclosed.svg ├── folderclosedd.svg ├── folderopend.svg ├── folderopen.svg ├── namespacemembers.html ├── namespacemembers_type.html ├── examples.html ├── dir_13e138d54eb8818da29c3992edef070a.html ├── functions_enum.html ├── dir_2d29d7dff7c7baf1180920f6796c23ae.html ├── menudata.js ├── functions_vars.html ├── dir_68267d1309a1af8e8297ef4c3efbcdba.html └── dir_d44c64559bbebec7f509842c48db8b23.html ├── scripts ├── ipfs_daemon_stop.sh ├── fix_format.sh ├── check_format.sh └── ipfs_daemon_start.sh ├── ChangeLog.md ├── .gitignore ├── cmake └── doxygen.cmake ├── LICENSE.MIT ├── test ├── CMakeLists.txt ├── test_transport_curl.cc ├── test_stats.cc ├── test_threading.cc ├── test_error.cc ├── test_name.cc ├── test_block.cc ├── test_config.cc ├── test_generic.cc ├── test_key.cc └── test_pin.cc ├── .vscode └── settings.json ├── .github └── workflows │ └── codeql-analysis.yml ├── doxygen_mainpage.md ├── examples └── threading_example.cc ├── CMakeLists.txt └── include └── ipfs └── test └── utils.h /.clang-format: -------------------------------------------------------------------------------- 1 | Language: Cpp 2 | BasedOnStyle: Google 3 | Standard: Cpp11 4 | -------------------------------------------------------------------------------- /docs/doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/doc.png -------------------------------------------------------------------------------- /scripts/ipfs_daemon_stop.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | 3 | killall -v ipfs 4 | 5 | # EOF 6 | -------------------------------------------------------------------------------- /docs/bc_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/bc_s.png -------------------------------------------------------------------------------- /docs/bc_sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/bc_sd.png -------------------------------------------------------------------------------- /docs/bdwn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/bdwn.png -------------------------------------------------------------------------------- /docs/closed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/closed.png -------------------------------------------------------------------------------- /docs/nav_f.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/nav_f.png -------------------------------------------------------------------------------- /docs/nav_fd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/nav_fd.png -------------------------------------------------------------------------------- /docs/nav_g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/nav_g.png -------------------------------------------------------------------------------- /docs/nav_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/nav_h.png -------------------------------------------------------------------------------- /docs/nav_hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/nav_hd.png -------------------------------------------------------------------------------- /docs/open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/open.png -------------------------------------------------------------------------------- /docs/tab_a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/tab_a.png -------------------------------------------------------------------------------- /docs/tab_ad.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/tab_ad.png -------------------------------------------------------------------------------- /docs/tab_b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/tab_b.png -------------------------------------------------------------------------------- /docs/tab_bd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/tab_bd.png -------------------------------------------------------------------------------- /docs/tab_h.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/tab_h.png -------------------------------------------------------------------------------- /docs/tab_hd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/tab_hd.png -------------------------------------------------------------------------------- /docs/tab_s.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/tab_s.png -------------------------------------------------------------------------------- /docs/tab_sd.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/tab_sd.png -------------------------------------------------------------------------------- /docs/splitbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/splitbar.png -------------------------------------------------------------------------------- /docs/sync_off.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/sync_off.png -------------------------------------------------------------------------------- /docs/sync_on.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/sync_on.png -------------------------------------------------------------------------------- /docs/folderopen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/folderopen.png -------------------------------------------------------------------------------- /docs/splitbard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/splitbard.png -------------------------------------------------------------------------------- /docs/folderclosed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/folderclosed.png -------------------------------------------------------------------------------- /docs/search/search_l.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/search/search_l.png -------------------------------------------------------------------------------- /docs/search/search_m.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/search/search_m.png -------------------------------------------------------------------------------- /docs/search/search_r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/search/search_r.png -------------------------------------------------------------------------------- /docs/search/namespaces_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['ipfs_0',['ipfs',['../namespaceipfs.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/classes_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['client_0',['Client',['../classipfs_1_1Client.html',1,'ipfs']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/classipfs_1_1http_1_1Transport.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/classipfs_1_1http_1_1Transport.png -------------------------------------------------------------------------------- /docs/search/all_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['json_0',['Json',['../namespaceipfs.html#a92ea49891c9d47378b920b41704a29ec',1,'ipfs']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/classipfs_1_1http_1_1TransportCurl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vasild/cpp-ipfs-http-client/HEAD/docs/classipfs_1_1http_1_1TransportCurl.png -------------------------------------------------------------------------------- /docs/search/typedefs_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['json_0',['Json',['../namespaceipfs.html#a92ea49891c9d47378b920b41704a29ec',1,'ipfs']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/classes_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['fileupload_0',['FileUpload',['../structipfs_1_1http_1_1FileUpload.html',1,'ipfs::http']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/all_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['abort_0',['Abort',['../classipfs_1_1Client.html#aaa862322e6ec703b91ed356d968fbc49',1,'ipfs::Client']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/all_f.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['version_0',['Version',['../classipfs_1_1Client.html#adaabe1a027399cbcabe291f3471e87f4',1,'ipfs::Client']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/functions_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['id_0',['Id',['../classipfs_1_1Client.html#ae2ab8a0186ec89f1644a3b1d1a0d20fb',1,'ipfs::Client']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/functions_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['abort_0',['Abort',['../classipfs_1_1Client.html#aaa862322e6ec703b91ed356d968fbc49',1,'ipfs::Client']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/functions_e.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['version_0',['Version',['../classipfs_1_1Client.html#adaabe1a027399cbcabe291f3471e87f4',1,'ipfs::Client']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/pages_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['ipfs_20c_2b_2b_20http_20api_20client_20library_0',['IPFS C++ HTTP API client library',['../index.html',1,'']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/enums_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['pinrmoptions_0',['PinRmOptions',['../classipfs_1_1Client.html#adc5716aa4272ff2bedcae954339c77d0',1,'ipfs::Client']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/enums_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['type_0',['Type',['../structipfs_1_1http_1_1FileUpload.html#a76d8546add495d01fd1dcd82ea8170ad',1,'ipfs::http::FileUpload']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /scripts/fix_format.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | find src/ include/ -iname *.h -o -iname *.cc | xargs clang-format -i -style=file -fallback-style=Google -assume-filename=../.clang-format 3 | -------------------------------------------------------------------------------- /docs/search/variables_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['data_0',['data',['../structipfs_1_1http_1_1FileUpload.html#a7920e334ad3eee5830e99c818b8f456b',1,'ipfs::http::FileUpload']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/variables_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['path_0',['path',['../structipfs_1_1http_1_1FileUpload.html#a778df02055fa7791c1c240dd6d27b3da',1,'ipfs::http::FileUpload']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/variables_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['type_0',['type',['../structipfs_1_1http_1_1FileUpload.html#ab2b53f7ba47384f2b11b59c216449283',1,'ipfs::http::FileUpload']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /scripts/check_format.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | find src/ include/ -iname *.h -o -iname *.cc | xargs clang-format --dry-run -Werror -style=file -fallback-style=Google -assume-filename=../.clang-format 3 | -------------------------------------------------------------------------------- /docs/search/enumvalues_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['recursive_0',['RECURSIVE',['../classipfs_1_1Client.html#adc5716aa4272ff2bedcae954339c77d0a1c1aa83dfe54dfc3528f9e40131cf638',1,'ipfs::Client']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/enumvalues_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['non_5frecursive_0',['NON_RECURSIVE',['../classipfs_1_1Client.html#adc5716aa4272ff2bedcae954339c77d0a254f9369d66a06a09f3ac854e72f6825',1,'ipfs::Client']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /ChangeLog.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | 3 | ## [v0.1.0](https://github.com/vasild/cpp-ipfs-api) (2016-11-05) 4 | 5 | - No releases yet. The current version is 0.1.0. See [Semantic Versioning item 4](http://semver.org/#spec-item-4). 6 | -------------------------------------------------------------------------------- /docs/search/classes_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['transport_0',['Transport',['../classipfs_1_1http_1_1Transport.html',1,'ipfs::http']]], 4 | ['transportcurl_1',['TransportCurl',['../classipfs_1_1http_1_1TransportCurl.html',1,'ipfs::http']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /scripts/ipfs_daemon_start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | 3 | "${GO_IPFS_CMD}" init 4 | "${GO_IPFS_CMD}" daemon > ipfs_daemon.out 2>&1 & 5 | while ! grep -i 'Daemon is ready' ipfs_daemon.out ; do 6 | echo "Waiting for ipfs daemon to start..." 7 | sleep 2 8 | done 9 | 10 | # EOF 11 | -------------------------------------------------------------------------------- /docs/search/functions_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['dhtfindpeer_0',['DhtFindPeer',['../classipfs_1_1Client.html#af34ac771242a66294ff60d820712a99d',1,'ipfs::Client']]], 4 | ['dhtfindprovs_1',['DhtFindProvs',['../classipfs_1_1Client.html#a9c93643d0567793925daea95ece432eb',1,'ipfs::Client']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/search/functions_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['namepublish_0',['NamePublish',['../classipfs_1_1Client.html#a93d0ec05a38a4094b3e0dc33c0cc7efe',1,'ipfs::Client']]], 4 | ['nameresolve_1',['NameResolve',['../classipfs_1_1Client.html#a61596ec86896753addebc2acac01d011',1,'ipfs::Client']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /build* 2 | 3 | # CMake related stuff 4 | Testing 5 | CMakeLists.txt.user 6 | CMakeCache.txt 7 | CMakeFiles 8 | CMakeScripts 9 | Makefile 10 | cmake_install.cmake 11 | install_manifest.txt 12 | compile_commands.json 13 | CTestTestfile.cmake 14 | _deps 15 | 16 | # Example target 17 | examples/threading_app -------------------------------------------------------------------------------- /docs/search/all_e.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['urlencode_0',['UrlEncode',['../classipfs_1_1http_1_1TransportCurl.html#ac53142bf9e4604695bd7414eda516bc6',1,'ipfs::http::TransportCurl::UrlEncode()'],['../classipfs_1_1http_1_1Transport.html#ab06599853f7f2b11ad323a3d67df4cad',1,'ipfs::http::Transport::UrlEncode()']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/all_5.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['id_0',['Id',['../classipfs_1_1Client.html#ae2ab8a0186ec89f1644a3b1d1a0d20fb',1,'ipfs::Client']]], 4 | ['ipfs_1',['ipfs',['../namespaceipfs.html',1,'']]], 5 | ['ipfs_20c_2b_2b_20http_20api_20client_20library_2',['IPFS C++ HTTP API client library',['../index.html',1,'']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/functions_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['urlencode_0',['UrlEncode',['../classipfs_1_1http_1_1TransportCurl.html#ac53142bf9e4604695bd7414eda516bc6',1,'ipfs::http::TransportCurl::UrlEncode()'],['../classipfs_1_1http_1_1Transport.html#ab06599853f7f2b11ad323a3d67df4cad',1,'ipfs::http::Transport::UrlEncode()']]] 4 | ]; 5 | -------------------------------------------------------------------------------- /docs/search/all_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['blockget_0',['BlockGet',['../classipfs_1_1Client.html#a4cd82e5d6223c2522c50e01047eb9d74',1,'ipfs::Client']]], 4 | ['blockput_1',['BlockPut',['../classipfs_1_1Client.html#a1613d0ec824f1967a66ff53153d914be',1,'ipfs::Client']]], 5 | ['blockstat_2',['BlockStat',['../classipfs_1_1Client.html#a08c8f4cc1091fd142e002a2861fada59',1,'ipfs::Client']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/functions_1.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['blockget_0',['BlockGet',['../classipfs_1_1Client.html#a4cd82e5d6223c2522c50e01047eb9d74',1,'ipfs::Client']]], 4 | ['blockput_1',['BlockPut',['../classipfs_1_1Client.html#a1613d0ec824f1967a66ff53153d914be',1,'ipfs::Client']]], 5 | ['blockstat_2',['BlockStat',['../classipfs_1_1Client.html#a08c8f4cc1091fd142e002a2861fada59',1,'ipfs::Client']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/enumvalues_0.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['kfilecontents_0',['kFileContents',['../structipfs_1_1http_1_1FileUpload.html#a76d8546add495d01fd1dcd82ea8170adafc941c889c1d94c918bfd225c22aed65',1,'ipfs::http::FileUpload']]], 4 | ['kfilename_1',['kFileName',['../structipfs_1_1http_1_1FileUpload.html#a76d8546add495d01fd1dcd82ea8170ada5bfe73daee1615146c6c4fa093c7d9ef',1,'ipfs::http::FileUpload']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/search/all_3.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['data_0',['data',['../structipfs_1_1http_1_1FileUpload.html#a7920e334ad3eee5830e99c818b8f456b',1,'ipfs::http::FileUpload']]], 4 | ['dhtfindpeer_1',['DhtFindPeer',['../classipfs_1_1Client.html#af34ac771242a66294ff60d820712a99d',1,'ipfs::Client']]], 5 | ['dhtfindprovs_2',['DhtFindProvs',['../classipfs_1_1Client.html#a9c93643d0567793925daea95ece432eb',1,'ipfs::Client']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/functions_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['reset_0',['Reset',['../classipfs_1_1Client.html#a60b2274e7ee70ed9392870cd2c5a8559',1,'ipfs::Client']]], 4 | ['resetfetch_1',['ResetFetch',['../classipfs_1_1http_1_1TransportCurl.html#a40a132f83bb069f463cab41249f4da74',1,'ipfs::http::TransportCurl::ResetFetch()'],['../classipfs_1_1http_1_1Transport.html#a31f96b6c63538c26c81ab5f8d806d1a5',1,'ipfs::http::Transport::ResetFetch()']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /cmake/doxygen.cmake: -------------------------------------------------------------------------------- 1 | find_package(Doxygen REQUIRED) 2 | 3 | # Prepare the doxyfile 4 | configure_file(${CMAKE_SOURCE_DIR}/doxyfile.in doxyfile @ONLY) 5 | 6 | # note the option ALL which allows to build the docs together with the application 7 | add_custom_target(doc ALL 8 | COMMAND ${DOXYGEN_EXECUTABLE} doxyfile 9 | WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} 10 | COMMENT "Generating API documentation with Doxygen" 11 | VERBATIM) 12 | -------------------------------------------------------------------------------- /docs/search/all_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['namepublish_0',['NamePublish',['../classipfs_1_1Client.html#a93d0ec05a38a4094b3e0dc33c0cc7efe',1,'ipfs::Client']]], 4 | ['nameresolve_1',['NameResolve',['../classipfs_1_1Client.html#a61596ec86896753addebc2acac01d011',1,'ipfs::Client']]], 5 | ['non_5frecursive_2',['NON_RECURSIVE',['../classipfs_1_1Client.html#adc5716aa4272ff2bedcae954339c77d0a254f9369d66a06a09f3ac854e72f6825',1,'ipfs::Client']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/all_10.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['_7eclient_0',['~Client',['../classipfs_1_1Client.html#a640274d537d4da7139c89c4dacac531c',1,'ipfs::Client']]], 4 | ['_7etransport_1',['~Transport',['../classipfs_1_1http_1_1Transport.html#a415e5830dfb8c2e26996e6619c15c8a6',1,'ipfs::http::Transport']]], 5 | ['_7etransportcurl_2',['~TransportCurl',['../classipfs_1_1http_1_1TransportCurl.html#a3315f1f9af3a7659ed1166dbc81913f4',1,'ipfs::http::TransportCurl']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/functions_f.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['_7eclient_0',['~Client',['../classipfs_1_1Client.html#a640274d537d4da7139c89c4dacac531c',1,'ipfs::Client']]], 4 | ['_7etransport_1',['~Transport',['../classipfs_1_1http_1_1Transport.html#a415e5830dfb8c2e26996e6619c15c8a6',1,'ipfs::http::Transport']]], 5 | ['_7etransportcurl_2',['~TransportCurl',['../classipfs_1_1http_1_1TransportCurl.html#a3315f1f9af3a7659ed1166dbc81913f4',1,'ipfs::http::TransportCurl']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/functions_6.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['keygen_0',['KeyGen',['../classipfs_1_1Client.html#ada01369adfda81c869a7095d98197961',1,'ipfs::Client']]], 4 | ['keylist_1',['KeyList',['../classipfs_1_1Client.html#a49d9bb4e44e66170c8e32134300ccfb1',1,'ipfs::Client']]], 5 | ['keyrename_2',['KeyRename',['../classipfs_1_1Client.html#a599d2585c57dd3abbc1b497454f3c541',1,'ipfs::Client']]], 6 | ['keyrm_3',['KeyRm',['../classipfs_1_1Client.html#a8c8c8703f4be0e4eb5053301b3577ed8',1,'ipfs::Client']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/search/functions_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['pinadd_0',['PinAdd',['../classipfs_1_1Client.html#a18e6d6a299748d3ba3a681bac7c5bd5d',1,'ipfs::Client']]], 4 | ['pinls_1',['PinLs',['../classipfs_1_1Client.html#a5c6f313e1d361f4d21a7a67915e6b19f',1,'ipfs::Client::PinLs(Json *pinned)'],['../classipfs_1_1Client.html#a1d775b25a4d80ba95c040694e9c9d877',1,'ipfs::Client::PinLs(const std::string &object_id, Json *pinned)']]], 5 | ['pinrm_2',['PinRm',['../classipfs_1_1Client.html#a1f5d4bfb19f0f739ce8f888c7cbbcc44',1,'ipfs::Client']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/nomatches.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 |
No Matches
11 |
12 | 13 | 14 | -------------------------------------------------------------------------------- /docs/search/all_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['recursive_0',['RECURSIVE',['../classipfs_1_1Client.html#adc5716aa4272ff2bedcae954339c77d0a1c1aa83dfe54dfc3528f9e40131cf638',1,'ipfs::Client']]], 4 | ['reset_1',['Reset',['../classipfs_1_1Client.html#a60b2274e7ee70ed9392870cd2c5a8559',1,'ipfs::Client']]], 5 | ['resetfetch_2',['ResetFetch',['../classipfs_1_1http_1_1TransportCurl.html#a40a132f83bb069f463cab41249f4da74',1,'ipfs::http::TransportCurl::ResetFetch()'],['../classipfs_1_1http_1_1Transport.html#a31f96b6c63538c26c81ab5f8d806d1a5',1,'ipfs::http::Transport::ResetFetch()']]] 6 | ]; 7 | -------------------------------------------------------------------------------- /docs/search/functions_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['fetch_0',['Fetch',['../classipfs_1_1http_1_1TransportCurl.html#a81bbb85b1a3feda8c5aa44b9c1769a6d',1,'ipfs::http::TransportCurl::Fetch()'],['../classipfs_1_1http_1_1Transport.html#a1b9139c6d768df23da1893ff54a8d75a',1,'ipfs::http::Transport::Fetch()']]], 4 | ['filesadd_1',['FilesAdd',['../classipfs_1_1Client.html#abe2e1d9f5479fa5007f93a0dee053d12',1,'ipfs::Client']]], 5 | ['filesget_2',['FilesGet',['../classipfs_1_1Client.html#a7598eaecec5293f29f84e2fc7ca7bc5b',1,'ipfs::Client']]], 6 | ['filesls_3',['FilesLs',['../classipfs_1_1Client.html#a0c0a73fa1a284cd4a12c1395a0eb356c',1,'ipfs::Client']]] 7 | ]; 8 | -------------------------------------------------------------------------------- /docs/search/functions_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['test_0',['Test',['../classipfs_1_1http_1_1TransportCurl.html#a7d2cdcea0358186ed520efce18dcf4ef',1,'ipfs::http::TransportCurl']]], 4 | ['transportcurl_1',['TransportCurl',['../classipfs_1_1http_1_1TransportCurl.html#a23c103c9d7cbf40fa867b1db602a4361',1,'ipfs::http::TransportCurl::TransportCurl(bool curlVerbose)'],['../classipfs_1_1http_1_1TransportCurl.html#a4825184e3f6cbcb1bc488e8eb8af5b27',1,'ipfs::http::TransportCurl::TransportCurl(const TransportCurl &other)'],['../classipfs_1_1http_1_1TransportCurl.html#af24d38bafd745f2c1b7f1ed4b1040963',1,'ipfs::http::TransportCurl::TransportCurl(TransportCurl &&other) noexcept']]] 5 | ]; 6 | -------------------------------------------------------------------------------- /docs/search/searchdata.js: -------------------------------------------------------------------------------- 1 | var indexSectionsWithContent = 2 | { 3 | 0: "abcdfijknoprstuv~", 4 | 1: "cft", 5 | 2: "i", 6 | 3: "abcdfiknoprstuv~", 7 | 4: "dpt", 8 | 5: "j", 9 | 6: "pt", 10 | 7: "knr", 11 | 8: "i" 12 | }; 13 | 14 | var indexSectionNames = 15 | { 16 | 0: "all", 17 | 1: "classes", 18 | 2: "namespaces", 19 | 3: "functions", 20 | 4: "variables", 21 | 5: "typedefs", 22 | 6: "enums", 23 | 7: "enumvalues", 24 | 8: "pages" 25 | }; 26 | 27 | var indexSectionLabels = 28 | { 29 | 0: "All", 30 | 1: "Classes", 31 | 2: "Namespaces", 32 | 3: "Functions", 33 | 4: "Variables", 34 | 5: "Typedefs", 35 | 6: "Enumerations", 36 | 7: "Enumerator", 37 | 8: "Pages" 38 | }; 39 | 40 | -------------------------------------------------------------------------------- /docs/search/all_4.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['fetch_0',['Fetch',['../classipfs_1_1http_1_1TransportCurl.html#a81bbb85b1a3feda8c5aa44b9c1769a6d',1,'ipfs::http::TransportCurl::Fetch()'],['../classipfs_1_1http_1_1Transport.html#a1b9139c6d768df23da1893ff54a8d75a',1,'ipfs::http::Transport::Fetch()']]], 4 | ['filesadd_1',['FilesAdd',['../classipfs_1_1Client.html#abe2e1d9f5479fa5007f93a0dee053d12',1,'ipfs::Client']]], 5 | ['filesget_2',['FilesGet',['../classipfs_1_1Client.html#a7598eaecec5293f29f84e2fc7ca7bc5b',1,'ipfs::Client']]], 6 | ['filesls_3',['FilesLs',['../classipfs_1_1Client.html#a0c0a73fa1a284cd4a12c1395a0eb356c',1,'ipfs::Client']]], 7 | ['fileupload_4',['FileUpload',['../structipfs_1_1http_1_1FileUpload.html',1,'ipfs::http']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /docs/search/all_a.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['path_0',['path',['../structipfs_1_1http_1_1FileUpload.html#a778df02055fa7791c1c240dd6d27b3da',1,'ipfs::http::FileUpload']]], 4 | ['pinadd_1',['PinAdd',['../classipfs_1_1Client.html#a18e6d6a299748d3ba3a681bac7c5bd5d',1,'ipfs::Client']]], 5 | ['pinls_2',['PinLs',['../classipfs_1_1Client.html#a5c6f313e1d361f4d21a7a67915e6b19f',1,'ipfs::Client::PinLs(Json *pinned)'],['../classipfs_1_1Client.html#a1d775b25a4d80ba95c040694e9c9d877',1,'ipfs::Client::PinLs(const std::string &object_id, Json *pinned)']]], 6 | ['pinrm_3',['PinRm',['../classipfs_1_1Client.html#a1f5d4bfb19f0f739ce8f888c7cbbcc44',1,'ipfs::Client']]], 7 | ['pinrmoptions_4',['PinRmOptions',['../classipfs_1_1Client.html#adc5716aa4272ff2bedcae954339c77d0',1,'ipfs::Client']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /docs/search/all_7.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['keygen_0',['KeyGen',['../classipfs_1_1Client.html#ada01369adfda81c869a7095d98197961',1,'ipfs::Client']]], 4 | ['keylist_1',['KeyList',['../classipfs_1_1Client.html#a49d9bb4e44e66170c8e32134300ccfb1',1,'ipfs::Client']]], 5 | ['keyrename_2',['KeyRename',['../classipfs_1_1Client.html#a599d2585c57dd3abbc1b497454f3c541',1,'ipfs::Client']]], 6 | ['keyrm_3',['KeyRm',['../classipfs_1_1Client.html#a8c8c8703f4be0e4eb5053301b3577ed8',1,'ipfs::Client']]], 7 | ['kfilecontents_4',['kFileContents',['../structipfs_1_1http_1_1FileUpload.html#a76d8546add495d01fd1dcd82ea8170adafc941c889c1d94c918bfd225c22aed65',1,'ipfs::http::FileUpload']]], 8 | ['kfilename_5',['kFileName',['../structipfs_1_1http_1_1FileUpload.html#a76d8546add495d01fd1dcd82ea8170ada5bfe73daee1615146c6c4fa093c7d9ef',1,'ipfs::http::FileUpload']]] 9 | ]; 10 | -------------------------------------------------------------------------------- /docs/search/mag.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 14 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /docs/search/mag_d.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 14 | 20 | 24 | 25 | -------------------------------------------------------------------------------- /docs/search/close.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 12 | 14 | 18 | 19 | -------------------------------------------------------------------------------- /docs/search/all_c.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['statsbw_0',['StatsBw',['../classipfs_1_1Client.html#ad944a5a304c799b314b3b9ab7765d314',1,'ipfs::Client']]], 4 | ['statsrepo_1',['StatsRepo',['../classipfs_1_1Client.html#aec756626c42caf55728dad5b6cb7d0f3',1,'ipfs::Client']]], 5 | ['stopfetch_2',['StopFetch',['../classipfs_1_1http_1_1TransportCurl.html#a527370641262a53f2c54bf2b75451454',1,'ipfs::http::TransportCurl::StopFetch()'],['../classipfs_1_1http_1_1Transport.html#a4da291ea9be5e9bcf4faccd7cbfe87fc',1,'ipfs::http::Transport::StopFetch()']]], 6 | ['swarmaddrs_3',['SwarmAddrs',['../classipfs_1_1Client.html#aa45a95118ec539863c12da953ab1988c',1,'ipfs::Client']]], 7 | ['swarmconnect_4',['SwarmConnect',['../classipfs_1_1Client.html#a2dc1372e2c7505e541115c97c7b497a7',1,'ipfs::Client']]], 8 | ['swarmdisconnect_5',['SwarmDisconnect',['../classipfs_1_1Client.html#afd550da40c4517c59750327784707923',1,'ipfs::Client']]], 9 | ['swarmpeers_6',['SwarmPeers',['../classipfs_1_1Client.html#a3c1f5392892d51152e45221ce1a026da',1,'ipfs::Client']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /docs/search/functions_b.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['statsbw_0',['StatsBw',['../classipfs_1_1Client.html#ad944a5a304c799b314b3b9ab7765d314',1,'ipfs::Client']]], 4 | ['statsrepo_1',['StatsRepo',['../classipfs_1_1Client.html#aec756626c42caf55728dad5b6cb7d0f3',1,'ipfs::Client']]], 5 | ['stopfetch_2',['StopFetch',['../classipfs_1_1http_1_1TransportCurl.html#a527370641262a53f2c54bf2b75451454',1,'ipfs::http::TransportCurl::StopFetch()'],['../classipfs_1_1http_1_1Transport.html#a4da291ea9be5e9bcf4faccd7cbfe87fc',1,'ipfs::http::Transport::StopFetch()']]], 6 | ['swarmaddrs_3',['SwarmAddrs',['../classipfs_1_1Client.html#aa45a95118ec539863c12da953ab1988c',1,'ipfs::Client']]], 7 | ['swarmconnect_4',['SwarmConnect',['../classipfs_1_1Client.html#a2dc1372e2c7505e541115c97c7b497a7',1,'ipfs::Client']]], 8 | ['swarmdisconnect_5',['SwarmDisconnect',['../classipfs_1_1Client.html#afd550da40c4517c59750327784707923',1,'ipfs::Client']]], 9 | ['swarmpeers_6',['SwarmPeers',['../classipfs_1_1Client.html#a3c1f5392892d51152e45221ce1a026da',1,'ipfs::Client']]] 10 | ]; 11 | -------------------------------------------------------------------------------- /docs/search/all_d.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['test_0',['Test',['../classipfs_1_1http_1_1TransportCurl.html#a7d2cdcea0358186ed520efce18dcf4ef',1,'ipfs::http::TransportCurl']]], 4 | ['transport_1',['Transport',['../classipfs_1_1http_1_1Transport.html',1,'ipfs::http']]], 5 | ['transportcurl_2',['TransportCurl',['../classipfs_1_1http_1_1TransportCurl.html',1,'ipfs::http::TransportCurl'],['../classipfs_1_1http_1_1TransportCurl.html#a23c103c9d7cbf40fa867b1db602a4361',1,'ipfs::http::TransportCurl::TransportCurl(bool curlVerbose)'],['../classipfs_1_1http_1_1TransportCurl.html#a4825184e3f6cbcb1bc488e8eb8af5b27',1,'ipfs::http::TransportCurl::TransportCurl(const TransportCurl &other)'],['../classipfs_1_1http_1_1TransportCurl.html#af24d38bafd745f2c1b7f1ed4b1040963',1,'ipfs::http::TransportCurl::TransportCurl(TransportCurl &&other) noexcept']]], 6 | ['type_3',['Type',['../structipfs_1_1http_1_1FileUpload.html#a76d8546add495d01fd1dcd82ea8170ad',1,'ipfs::http::FileUpload']]], 7 | ['type_4',['type',['../structipfs_1_1http_1_1FileUpload.html#ab2b53f7ba47384f2b11b59c216449283',1,'ipfs::http::FileUpload']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /LICENSE.MIT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2016-2021, The C++ IPFS client library developers 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 19 | -------------------------------------------------------------------------------- /docs/search/mag_sel.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 13 | 15 | 21 | 26 | 31 | 32 | -------------------------------------------------------------------------------- /docs/search/mag_seld.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 13 | 15 | 21 | 26 | 31 | 32 | -------------------------------------------------------------------------------- /docs/search/functions_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['client_0',['Client',['../classipfs_1_1Client.html#a54113a339b48d9d86baeb3ef83b3f01e',1,'ipfs::Client::Client(const std::string &host, long port, const std::string &timeout="", const std::string &protocol="http://", const std::string &apiPath="/api/v0", bool verbose=false)'],['../classipfs_1_1Client.html#ac3d5dd61849bd39acb5641dd169a870d',1,'ipfs::Client::Client(const Client &)'],['../classipfs_1_1Client.html#a6c3280837a5620ce4209ac31ceaa84ce',1,'ipfs::Client::Client(Client &&) noexcept']]], 4 | ['clone_1',['Clone',['../classipfs_1_1http_1_1TransportCurl.html#afc09c69db3a0023675472fc3985a116d',1,'ipfs::http::TransportCurl::Clone()'],['../classipfs_1_1http_1_1Transport.html#a4e3fd7f011e46562ac7d2f9005061601',1,'ipfs::http::Transport::Clone()']]], 5 | ['configget_2',['ConfigGet',['../classipfs_1_1Client.html#a4fc42dccf9392a96d51099bc252a6092',1,'ipfs::Client']]], 6 | ['configreplace_3',['ConfigReplace',['../classipfs_1_1Client.html#aa6e2c0b4a19bacb58932e777be08d232',1,'ipfs::Client']]], 7 | ['configset_4',['ConfigSet',['../classipfs_1_1Client.html#ab50f9855e7c812542e153475e86645b9',1,'ipfs::Client']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /docs/search/all_2.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['client_0',['Client',['../classipfs_1_1Client.html#a54113a339b48d9d86baeb3ef83b3f01e',1,'ipfs::Client::Client(const std::string &host, long port, const std::string &timeout="", const std::string &protocol="http://", const std::string &apiPath="/api/v0", bool verbose=false)'],['../classipfs_1_1Client.html#ac3d5dd61849bd39acb5641dd169a870d',1,'ipfs::Client::Client(const Client &)'],['../classipfs_1_1Client.html#a6c3280837a5620ce4209ac31ceaa84ce',1,'ipfs::Client::Client(Client &&) noexcept'],['../classipfs_1_1Client.html',1,'ipfs::Client']]], 4 | ['clone_1',['Clone',['../classipfs_1_1http_1_1TransportCurl.html#afc09c69db3a0023675472fc3985a116d',1,'ipfs::http::TransportCurl::Clone()'],['../classipfs_1_1http_1_1Transport.html#a4e3fd7f011e46562ac7d2f9005061601',1,'ipfs::http::Transport::Clone()']]], 5 | ['configget_2',['ConfigGet',['../classipfs_1_1Client.html#a4fc42dccf9392a96d51099bc252a6092',1,'ipfs::Client']]], 6 | ['configreplace_3',['ConfigReplace',['../classipfs_1_1Client.html#aa6e2c0b4a19bacb58932e777be08d232',1,'ipfs::Client']]], 7 | ['configset_4',['ConfigSet',['../classipfs_1_1Client.html#ab50f9855e7c812542e153475e86645b9',1,'ipfs::Client']]] 8 | ]; 9 | -------------------------------------------------------------------------------- /docs/doc.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/docd.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/search/all_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/all_10.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/enums_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/enums_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/pages_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/classes_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/classes_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/classes_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/typedefs_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/enumvalues_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/enumvalues_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/enumvalues_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_3.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_4.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_5.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_6.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_7.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_8.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_9.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_b.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_c.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_d.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_e.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/functions_f.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/namespaces_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/variables_0.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/variables_1.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /docs/search/variables_2.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 |
Loading...
13 |
14 | 19 |
Searching...
20 |
No Matches
21 | 35 |
36 | 37 | 38 | -------------------------------------------------------------------------------- /test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | set(THREADS_PREFER_PTHREAD_FLAG ON) 3 | 4 | find_package(Threads REQUIRED) 5 | 6 | set(TESTS 7 | test_block 8 | test_config 9 | test_dht 10 | test_files 11 | test_generic 12 | test_key 13 | test_name 14 | test_object 15 | test_pin 16 | test_stats 17 | test_swarm 18 | test_threading 19 | test_transport_curl 20 | ) 21 | 22 | string(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER) 23 | if(CMAKE_BUILD_TYPE_LOWER MATCHES "debug") 24 | set(TESTS 25 | ${TESTS} 26 | test_error 27 | ) 28 | endif() 29 | 30 | foreach (T ${TESTS}) 31 | add_executable(${T} ${T}.cc) 32 | target_link_libraries(${T} ${IPFS_API_LIBNAME} Threads::Threads) 33 | 34 | add_test(NAME ${T} COMMAND ./${T}) 35 | endforeach() 36 | 37 | # Instead of running 'make test', this will only run our testcases. Used the ctest_coverage_* targets as well. 38 | add_custom_target(our_tests 39 | COMMAND ctest -R '^test_' 40 | ) 41 | 42 | # Additional targets 43 | if(COVERAGE) 44 | include(CodeCoverage) 45 | 46 | # Create a new target 'ctest_coverage_xml' that generates an XML coverage file 47 | setup_target_for_coverage_gcovr_xml( 48 | NAME ctest_coverage_xml 49 | EXECUTABLE make our_tests 50 | DEPENDENCIES ${TESTS} 51 | EXCLUDE "test/*" "build/_deps" "include/*" "build/CMakeFiles/*" 52 | ) 53 | 54 | # Create a new target 'ctest_coverage_html' that generates a HTML page 55 | setup_target_for_coverage_gcovr_html( 56 | NAME ctest_coverage_html 57 | EXECUTABLE make our_tests 58 | DEPENDENCIES ${TESTS} 59 | EXCLUDE "test/*" "build/_deps" "include/*" "build/CMakeFiles/*" 60 | ) 61 | endif() -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.associations": { 3 | "array": "cpp", 4 | "atomic": "cpp", 5 | "*.tcc": "cpp", 6 | "bitset": "cpp", 7 | "cctype": "cpp", 8 | "chrono": "cpp", 9 | "clocale": "cpp", 10 | "cmath": "cpp", 11 | "condition_variable": "cpp", 12 | "csignal": "cpp", 13 | "cstdarg": "cpp", 14 | "cstddef": "cpp", 15 | "cstdint": "cpp", 16 | "cstdio": "cpp", 17 | "cstdlib": "cpp", 18 | "cstring": "cpp", 19 | "ctime": "cpp", 20 | "cwchar": "cpp", 21 | "cwctype": "cpp", 22 | "deque": "cpp", 23 | "forward_list": "cpp", 24 | "list": "cpp", 25 | "unordered_map": "cpp", 26 | "unordered_set": "cpp", 27 | "vector": "cpp", 28 | "exception": "cpp", 29 | "algorithm": "cpp", 30 | "functional": "cpp", 31 | "iterator": "cpp", 32 | "map": "cpp", 33 | "memory": "cpp", 34 | "memory_resource": "cpp", 35 | "numeric": "cpp", 36 | "optional": "cpp", 37 | "random": "cpp", 38 | "ratio": "cpp", 39 | "regex": "cpp", 40 | "set": "cpp", 41 | "string": "cpp", 42 | "string_view": "cpp", 43 | "system_error": "cpp", 44 | "tuple": "cpp", 45 | "type_traits": "cpp", 46 | "utility": "cpp", 47 | "fstream": "cpp", 48 | "initializer_list": "cpp", 49 | "iomanip": "cpp", 50 | "iosfwd": "cpp", 51 | "iostream": "cpp", 52 | "istream": "cpp", 53 | "limits": "cpp", 54 | "mutex": "cpp", 55 | "new": "cpp", 56 | "ostream": "cpp", 57 | "shared_mutex": "cpp", 58 | "sstream": "cpp", 59 | "stdexcept": "cpp", 60 | "streambuf": "cpp", 61 | "thread": "cpp", 62 | "cinttypes": "cpp", 63 | "typeinfo": "cpp", 64 | "valarray": "cpp", 65 | "variant": "cpp", 66 | "bit": "cpp", 67 | "codecvt": "cpp" 68 | }, 69 | "C_Cpp.default.configurationProvider": "ms-vscode.cmake-tools" 70 | } -------------------------------------------------------------------------------- /docs/search/all_9.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['objectdata_0',['ObjectData',['../classipfs_1_1Client.html#aa8d6e75330c6a3d82130f0be4b66b13e',1,'ipfs::Client']]], 4 | ['objectget_1',['ObjectGet',['../classipfs_1_1Client.html#abc9556daecb92afeea9b2adfde034a7f',1,'ipfs::Client']]], 5 | ['objectlinks_2',['ObjectLinks',['../classipfs_1_1Client.html#a90b1ecd4897794ea6ad5742a41f21525',1,'ipfs::Client']]], 6 | ['objectnew_3',['ObjectNew',['../classipfs_1_1Client.html#a65d8e5b1ac53f2f54bc9860dea015c6d',1,'ipfs::Client']]], 7 | ['objectpatchaddlink_4',['ObjectPatchAddLink',['../classipfs_1_1Client.html#a5d239a25cd20cbc15c13c96c790abf46',1,'ipfs::Client']]], 8 | ['objectpatchappenddata_5',['ObjectPatchAppendData',['../classipfs_1_1Client.html#af414390a18a656fd2568cf70481e51b4',1,'ipfs::Client']]], 9 | ['objectpatchrmlink_6',['ObjectPatchRmLink',['../classipfs_1_1Client.html#a149b21207f70215ad0097764e6ae2e65',1,'ipfs::Client']]], 10 | ['objectpatchsetdata_7',['ObjectPatchSetData',['../classipfs_1_1Client.html#a949a35293f16868980ab013606264b24',1,'ipfs::Client']]], 11 | ['objectput_8',['ObjectPut',['../classipfs_1_1Client.html#a783ddccb9559315599b07343b153ffc2',1,'ipfs::Client']]], 12 | ['objectstat_9',['ObjectStat',['../classipfs_1_1Client.html#a2fcb017f9de04c221b78e47cf062039d',1,'ipfs::Client']]], 13 | ['operator_3d_10',['operator=',['../classipfs_1_1Client.html#ab3ff2cc70ec6a65761d2d088a9ba9323',1,'ipfs::Client::operator=(const Client &)'],['../classipfs_1_1Client.html#a0fdc4ced9fc352a468dac2ec2ae70dcd',1,'ipfs::Client::operator=(Client &&) noexcept'],['../classipfs_1_1http_1_1TransportCurl.html#aae4f2177edac94e2eee400a3e21bdb20',1,'ipfs::http::TransportCurl::operator=(const TransportCurl &)'],['../classipfs_1_1http_1_1TransportCurl.html#a687fd5a5416f6a2d015d1824efa77dc7',1,'ipfs::http::TransportCurl::operator=(TransportCurl &&) noexcept']]] 14 | ]; 15 | -------------------------------------------------------------------------------- /docs/search/functions_8.js: -------------------------------------------------------------------------------- 1 | var searchData= 2 | [ 3 | ['objectdata_0',['ObjectData',['../classipfs_1_1Client.html#aa8d6e75330c6a3d82130f0be4b66b13e',1,'ipfs::Client']]], 4 | ['objectget_1',['ObjectGet',['../classipfs_1_1Client.html#abc9556daecb92afeea9b2adfde034a7f',1,'ipfs::Client']]], 5 | ['objectlinks_2',['ObjectLinks',['../classipfs_1_1Client.html#a90b1ecd4897794ea6ad5742a41f21525',1,'ipfs::Client']]], 6 | ['objectnew_3',['ObjectNew',['../classipfs_1_1Client.html#a65d8e5b1ac53f2f54bc9860dea015c6d',1,'ipfs::Client']]], 7 | ['objectpatchaddlink_4',['ObjectPatchAddLink',['../classipfs_1_1Client.html#a5d239a25cd20cbc15c13c96c790abf46',1,'ipfs::Client']]], 8 | ['objectpatchappenddata_5',['ObjectPatchAppendData',['../classipfs_1_1Client.html#af414390a18a656fd2568cf70481e51b4',1,'ipfs::Client']]], 9 | ['objectpatchrmlink_6',['ObjectPatchRmLink',['../classipfs_1_1Client.html#a149b21207f70215ad0097764e6ae2e65',1,'ipfs::Client']]], 10 | ['objectpatchsetdata_7',['ObjectPatchSetData',['../classipfs_1_1Client.html#a949a35293f16868980ab013606264b24',1,'ipfs::Client']]], 11 | ['objectput_8',['ObjectPut',['../classipfs_1_1Client.html#a783ddccb9559315599b07343b153ffc2',1,'ipfs::Client']]], 12 | ['objectstat_9',['ObjectStat',['../classipfs_1_1Client.html#a2fcb017f9de04c221b78e47cf062039d',1,'ipfs::Client']]], 13 | ['operator_3d_10',['operator=',['../classipfs_1_1Client.html#ab3ff2cc70ec6a65761d2d088a9ba9323',1,'ipfs::Client::operator=(const Client &)'],['../classipfs_1_1Client.html#a0fdc4ced9fc352a468dac2ec2ae70dcd',1,'ipfs::Client::operator=(Client &&) noexcept'],['../classipfs_1_1http_1_1TransportCurl.html#aae4f2177edac94e2eee400a3e21bdb20',1,'ipfs::http::TransportCurl::operator=(const TransportCurl &)'],['../classipfs_1_1http_1_1TransportCurl.html#a687fd5a5416f6a2d015d1824efa77dc7',1,'ipfs::http::TransportCurl::operator=(TransportCurl &&) noexcept']]] 14 | ]; 15 | -------------------------------------------------------------------------------- /docs/folderclosed.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /docs/folderclosedd.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /.github/workflows/codeql-analysis.yml: -------------------------------------------------------------------------------- 1 | # For most projects, this workflow file will not need changing; you simply need 2 | # to commit it to your repository. 3 | # 4 | # You may wish to alter this file to override the set of languages analyzed, 5 | # or to provide custom queries or build logic. 6 | # 7 | # ******** NOTE ******** 8 | # We have attempted to detect the languages in your repository. Please check 9 | # the `language` matrix defined below to confirm you have the correct set of 10 | # supported CodeQL languages. 11 | # 12 | name: "CodeQL" 13 | 14 | on: 15 | push: 16 | branches: [master] 17 | pull_request: 18 | schedule: 19 | - cron: "24 18 * * 2" 20 | 21 | jobs: 22 | analyze: 23 | name: Analyze 24 | runs-on: ubuntu-latest 25 | 26 | strategy: 27 | fail-fast: false 28 | matrix: 29 | language: ["cpp"] 30 | 31 | steps: 32 | - name: Checkout repository 33 | uses: actions/checkout@v3 34 | 35 | # Initializes the CodeQL tools for scanning. 36 | - name: Initialize CodeQL 37 | uses: github/codeql-action/init@v2 38 | with: 39 | languages: ${{ matrix.language }} 40 | # If you wish to specify custom queries, you can do so here or in a config file. 41 | # By default, queries listed here will override any specified in a config file. 42 | # Prefix the list here with "+" to use these queries and those in the config file. 43 | # queries: ./path/to/local/query, your-org/your-repo/queries@main 44 | 45 | - name: Install packages 46 | run: | 47 | sudo apt update 48 | sudo apt install -y --no-install-recommends ninja-build libcurl4-openssl-dev 49 | 50 | - name: Configure 51 | run: > 52 | cmake 53 | -B build 54 | -G Ninja 55 | -DCMAKE_BUILD_TYPE=Release 56 | -DBUILD_SHARED_LIBS=ON 57 | - name: Build 58 | run: cmake --build build 59 | 60 | - name: Perform CodeQL Analysis 61 | uses: github/codeql-action/analyze@v2 62 | -------------------------------------------------------------------------------- /test/test_transport_curl.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016-2023, The C++ IPFS client library developers 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | 25 | int main(int, char**) { 26 | { 27 | /* test normal fetch */ 28 | ipfs::http::TransportCurl transportCurl(false); 29 | { 30 | std::stringstream response; 31 | transportCurl.Fetch("https://example.com/", {}, &response); 32 | assert(!response.str().empty()); 33 | } 34 | /* test move constructor */ 35 | { 36 | ipfs::http::TransportCurl transportCurl2(std::move(transportCurl)); 37 | std::stringstream response; 38 | transportCurl2.Fetch("https://example.com/", {}, &response); 39 | assert(!response.str().empty()); 40 | } 41 | } 42 | /* test move assignment to other object */ 43 | { 44 | ipfs::http::TransportCurl transportCurl(false); 45 | ipfs::http::TransportCurl transportCurl2(false); 46 | transportCurl2 = std::move(transportCurl); 47 | std::stringstream response; 48 | transportCurl2.Fetch("https://example.com/", {}, &response); 49 | assert(!response.str().empty()); 50 | } 51 | } -------------------------------------------------------------------------------- /test/test_stats.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2021, The C++ IPFS client library developers 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | int main(int, char**) { 27 | try { 28 | ipfs::Client client("localhost", 5001); 29 | 30 | /** [ipfs::Client::StatsBw] */ 31 | ipfs::Json bandwidth_info; 32 | 33 | client.StatsBw(&bandwidth_info); 34 | 35 | std::cout << "Bandwidth:" << std::endl << bandwidth_info.dump(2) << std::endl; 36 | /* An example output: 37 | Bandwidth: 38 | { 39 | "RateIn": 4541.421091935148, 40 | "RateOut": 677.3253862633403, 41 | "TotalIn": 15994960, 42 | "TotalOut": 6696092 43 | } 44 | */ 45 | /** [ipfs::Client::StatsBw] */ 46 | 47 | /** [ipfs::Client::StatsRepo] */ 48 | ipfs::Json repo_stats; 49 | 50 | client.StatsRepo(&repo_stats); 51 | 52 | std::cout << "Repo:" << std::endl << repo_stats.dump(2) << std::endl; 53 | /* An example output: 54 | Repo: 55 | { 56 | "RepoSize":256893470, 57 | "StorageMax":20000000000, 58 | "NumObjects":24935, 59 | "RepoPath":"/home/melroy/.ipfs", 60 | "Version":"fs-repo@11" 61 | } 62 | */ 63 | /** [ipfs::Client::StatsRepo] */ 64 | 65 | } catch (const std::exception& e) { 66 | std::cerr << e.what() << std::endl; 67 | return 1; 68 | } 69 | 70 | 71 | 72 | return 0; 73 | } 74 | -------------------------------------------------------------------------------- /test/test_threading.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016-2022, The C++ IPFS client library developers 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | #include 26 | 27 | int main(int, char**) { 28 | try { 29 | // Create client with high time-out of 2 minutes 30 | ipfs::Client client("localhost", 5001, "2m"); 31 | 32 | std::cout << "INFO: Starting thread..." << std::endl; 33 | 34 | // Only start a single thread 35 | std::thread thread([&client]() { 36 | std::stringstream contents; 37 | try { 38 | // File should not exists, takes forever (until time-out) 39 | client.FilesGet("QmZp1rrtGTictR2rpNcx4673R7qU9Jdr9DQ6Z7F6Wgo2bQ", 40 | &contents); 41 | } catch (const std::runtime_error& e) { 42 | std::cerr << "Expected error: " << e.what() << std::endl; 43 | } 44 | }); 45 | 46 | // Abort request directly / stopping thread 47 | if (thread.joinable()) { 48 | std::cout << "INFO: Abort thread directly" << std::endl; 49 | /** [ipfs::Client::Abort] */ 50 | client.Abort(); 51 | thread.join(); 52 | client.Reset(); 53 | /** [ipfs::Client::Abort] */ 54 | } 55 | 56 | std::cout << "INFO: Done!" << std::endl; 57 | } catch (const std::exception& e) { 58 | std::cerr << e.what() << std::endl; 59 | return 1; 60 | } 61 | 62 | return 0; 63 | } 64 | -------------------------------------------------------------------------------- /test/test_error.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016-2021, The C++ IPFS client library developers 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 19 | 20 | #include 21 | #include 22 | #include 23 | 24 | #include 25 | #include 26 | #include 27 | 28 | #ifdef NDEBUG 29 | #error This file only makes sense in debug mode, dont try to compile it in non-debug. 30 | #endif /* NDEBUG */ 31 | 32 | namespace ipfs { 33 | namespace http { 34 | extern std::string replace_body; 35 | } 36 | } // namespace ipfs 37 | 38 | int main(int, char**) { 39 | try { 40 | ipfs::Client client_cant_connect("localhost", 57); 41 | 42 | ipfs::test::must_fail("client.Version()", [&client_cant_connect]() { 43 | ipfs::Json version; 44 | client_cant_connect.Version(&version); 45 | }); 46 | 47 | ipfs::Client client("localhost", 5001); 48 | 49 | std::string object_id; 50 | client.ObjectNew(&object_id); 51 | 52 | ipfs::test::must_fail("client.PinAdd()", [&client, &object_id]() { 53 | ipfs::http::replace_body = R"({"Pins": []})"; 54 | client.PinAdd(object_id); 55 | }); 56 | 57 | ipfs::test::must_fail("client.PinAdd()", [&client, &object_id]() { 58 | ipfs::http::replace_body = R"({"no Pins property here": []})"; 59 | client.PinAdd(object_id); 60 | }); 61 | 62 | ipfs::test::must_fail("client.Id()", [&client]() { 63 | ipfs::http::replace_body = R"(not a JSON ~!*(@&(~{] indeed)"; 64 | ipfs::Json id; 65 | client.Id(&id); 66 | }); 67 | 68 | ipfs::http::TransportCurl transport_curl(false); 69 | transport_curl.Test(); 70 | 71 | } catch (const std::exception& e) { 72 | std::cerr << e.what() << std::endl; 73 | return 1; 74 | } 75 | 76 | return 0; 77 | } 78 | -------------------------------------------------------------------------------- /doxygen_mainpage.md: -------------------------------------------------------------------------------- 1 | # IPFS C++ HTTP API client library 2 | 3 | The main class the library exports is @link ipfs::Client @endlink. The rest is only interesting to developers of this library. 4 | 5 | ## Build & Install 6 | 7 | ```sh 8 | # Fetch the source code from GitHub. 9 | git clone git@github.com:vasild/cpp-ipfs-http-client.git 10 | cd cpp-ipfs-http-client 11 | 12 | # Build the library inside a seperate build directory. 13 | # Note: This is a shared build, you can Omit BUILD_SHARED_LIBS for static builds. 14 | # 15 | # These extra options may be of interest in case the dependencies have 16 | # been installed in non-standard locations: 17 | # CURL_INCLUDE_DIR 18 | # CURL_LIBRARY 19 | mkdir build 20 | cd build 21 | cmake \ 22 | -DCMAKE_INSTALL_PREFIX:PATH=/home/joe.smith/cpp-ipfs-http-client-install \ 23 | -DCURL_INCLUDE_DIR:PATH=/home/joe.smith/include 24 | -DCURL_LIBRARY:PATH=/home/joe.smith/lib/libcurl.so 25 | -DCMAKE_BUILD_TYPE=Debug \ 26 | -DBUILD_SHARED_LIBS:BOOL=ON \ 27 | -DBUILD_TESTING:BOOL=OFF \ 28 | .. 29 | make -j 8 30 | 31 | # Optionally install it. 32 | make install 33 | ``` 34 | 35 | _Hint:_ Use `cmake -LAH` to list all available options. 36 | 37 | _Note:_ Omitting `DBUILD_SHARED_LIBS` above is fine as well, if you want to statically link this library into your project. 38 | 39 | ## Build via C++ compiler 40 | 41 | ```sh 42 | g++ -std=c++11 -I/path/to/header -L/path/to/lib -lipfs-http-client myprog.cc -o myprog 43 | ``` 44 | 45 | ## Install & Build using existing CMake project 46 | 47 | Use the C++ IPFS Client inside an existing CMake project. We add the IPFS client inside the `lib` folder. 48 | For example via `git submodule` (but `git clone` should also work): 49 | 50 | ```sh 51 | cd your-cmake-project 52 | git submodule add https://github.com/vasild/cpp-ipfs-http-client.git lib/ipfs-http-client 53 | ``` 54 | 55 | Edit your `CMakeLists.txt` file to include the C++ IPFS HTTP Client in your build: 56 | 57 | ```cmake 58 | add_subdirectory (lib/ipfs-http-client) 59 | ``` 60 | 61 | Finally, add the C++ IPFS HTTP static library to your target using `target_link_libraries()` 62 | (in this example `${PROJECT_TARGET}` variable is used as target name): 63 | 64 | ```cmake 65 | set(PROJECT_TARGET my-app) 66 | 67 | target_link_libraries(${PROJECT_TARGET} PRIVATE ipfs-http-client) 68 | ``` 69 | 70 | ## Dependencies 71 | 72 | - [C++11 compiler](https://github.com/nlohmann/json#supported-compilers) (nlohmann json project is fetched automatically by CMake) 73 | - [CMake](http://cmake.org), version 3.11.0 or higher 74 | - [libcurl](https://curl.haxx.se/libcurl), version 7.25.0 or higher 75 | 76 | Optionally (for generation this documentation you're reading): 77 | 78 | - [Doxygen](https://www.doxygen.nl), version 1.9.0 or higher 79 | 80 | # License 81 | 82 | The code is distributed under the [MIT License](http://opensource.org/licenses/MIT). 83 | -------------------------------------------------------------------------------- /examples/threading_example.cc: -------------------------------------------------------------------------------- 1 | /** 2 | * Example use-case of using IPFS HTTP Client with threading. 3 | * By: Melroy van den Berg 4 | * 5 | * Important note: Never create multiple threads! That should NOT be needed 6 | * in order to have parallel requests, since cURL multi API supports multiple 7 | * simultaneous requests out-of-the-box (it's called multi API for a reason). 8 | * However, the IPFS Client does not yet implement multiple requests in 9 | * parallel. 10 | * 11 | * This single thread example is useful in application with a GUI as its main 12 | * thread. For example with apps that are using Qt or GTK GUI toolkits. 13 | * 14 | * First be sure you install the IPFS client locally (as a static lib), using: 15 | * 16 | * mkdir build && cd build && cmake .. && make -j10 && sudo make install 17 | * 18 | * Then go to the example folder: 19 | * 20 | * cd examples 21 | * 22 | * Finally, build the example as follows: 23 | * 24 | * g++ -std=c++17 threading_example.cc -o threading_app \ 25 | /usr/local/lib/libipfs-http-client.a \ 26 | /usr/lib/x86_64-linux-gnu/libcurl.so -pthread 27 | * 28 | */ 29 | #include 30 | // Or when you use IPFS locally: 31 | //#include "ipfs/client.h" 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | void startThread() { 38 | try { 39 | // Create IPFS Client object, with 2 minutes time-out. 40 | ipfs::Client client("localhost", 5001, "2m"); 41 | 42 | // Only start a single thread 43 | std::thread thread([&client]() { 44 | std::stringstream contents; 45 | try { 46 | // File should not exists, takes forever (until time-out) 47 | client.FilesGet("QmZp1rrtGTictR2rpNcx4673R7qU9Jdr9DQ6Z7F6Wgo2bQ", 48 | &contents); 49 | 50 | // Code below will never be reached, since we abort the request 51 | std::cout << "Output: " << contents.str() << std::endl; 52 | } catch (const std::runtime_error& e) { 53 | // Run-time error will be thrown because of the aborting request. 54 | std::cerr << "Error: " << e.what() << std::endl; 55 | } 56 | }); 57 | 58 | if (thread.joinable()) { 59 | std::cout << "Directly try to abort the request and stop the thread." 60 | << std::endl; 61 | // Try to remove the Abort() and Reset() calls, 62 | // and see the difference yourself :) 63 | client.Abort(); 64 | thread.join(); // Should not be blocking now 65 | client.Reset(); 66 | } 67 | 68 | } catch (const std::exception& e) { 69 | std::cerr << "General error: " << e.what() << std::endl; 70 | } 71 | } 72 | 73 | int main() { 74 | std::cout << "Starting thread.." << std::endl; 75 | 76 | // Start a request inside a thread 77 | startThread(); 78 | 79 | std::cout << "Done!" << std::endl; 80 | return 0; 81 | } -------------------------------------------------------------------------------- /test/test_name.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016-2021, The C++ IPFS client library developers 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | int main(int, char**) { 28 | try { 29 | ipfs::Client client("localhost", 5001); 30 | 31 | // We need a key here, so as not to clobber the "self" key. 32 | std::string key_id; 33 | client.KeyGen("foobar-key", "rsa", 2048, &key_id); 34 | std::cout << "Generated key: " << key_id << std::endl; 35 | 36 | /** [ipfs::Client::NamePublish] */ 37 | // The object here is well-known. 38 | std::string object_id = "QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG"; 39 | std::string name; 40 | ipfs::Json options = {{"lifetime", "4h"}, {"ttl", "60s"}}; 41 | client.NamePublish(object_id, "foobar-key", options, &name); 42 | /* An example output: "QmbJ5UzreC86qtHrWC2SwWKLsTiLqTuG4cqHHJVdYPK6s9" */ 43 | std::cout << "Published name: " << name << std::endl; 44 | /** [ipfs::Client::NamePublish] */ 45 | 46 | /* Remove the key so that it doesn't pollute the key-space. */ 47 | client.KeyRm("foobar-key"); 48 | 49 | /** [ipfs::Client::NameResolve] */ 50 | // std::string name = "QmTN15ibVzXhNBUZvv4rjHtrsM1xvHe19iy8feGFbUxb3P"; 51 | std::string resolved_object_path; 52 | client.NameResolve(name, &resolved_object_path); 53 | /* The expected output: 54 | * "/ipfs/QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG"; */ 55 | std::cout << "Resolved name: " << resolved_object_path << std::endl; 56 | /** [ipfs::Client::NameResolve] */ 57 | 58 | std::string expected = "/ipfs/" + object_id; 59 | ipfs::test::check_if_string_contains("client.NameResolve()", 60 | resolved_object_path, expected); 61 | 62 | } catch (const std::exception& e) { 63 | std::cerr << e.what() << std::endl; 64 | return 1; 65 | } 66 | 67 | return 0; 68 | } 69 | -------------------------------------------------------------------------------- /test/test_block.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016-2021, The C++ IPFS client library developers 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | int main(int, char**) { 28 | try { 29 | ipfs::Client client("localhost", 5001); 30 | 31 | /** [ipfs::Client::BlockPut] */ 32 | ipfs::Json block; 33 | client.BlockPut( 34 | {"" /* no file name */, ipfs::http::FileUpload::Type::kFileContents, 35 | "Block put test."}, 36 | &block); 37 | std::cout << "Stored block key: " << block["Key"] << std::endl; 38 | /* An example output: 39 | Stored block key: "QmQpWo5TL9nivqvL18Bq8bS34eewAA6jcgdVsUu4tGeVHo" 40 | */ 41 | /** [ipfs::Client::BlockPut] */ 42 | ipfs::test::check_if_properties_exist("client.BlockPut()", block, 43 | {"Key", "Size"}); 44 | 45 | /** [ipfs::Client::BlockGet] */ 46 | std::stringstream block_contents; 47 | /* E.g. block["Key"] is "QmQpWo5TL9nivqvL18Bq8bS34eewAA6jcgdVsUu4tGeVHo". */ 48 | client.BlockGet(block["Key"], &block_contents); 49 | std::cout << "Block (hex): " 50 | << ipfs::test::string_to_hex(block_contents.str()) << std::endl; 51 | /* An example output: 52 | Block (hex): 426c6f636b2070757420746573742e 53 | */ 54 | /** [ipfs::Client::BlockGet] */ 55 | 56 | /** [ipfs::Client::BlockStat] */ 57 | ipfs::Json stat_result; 58 | client.BlockStat(block["Key"], &stat_result); 59 | std::cout << "Stat: " << stat_result << std::endl; 60 | /* An example output: 61 | Stat: {"Key":"QmQpWo5TL9nivqvL18Bq8bS34eewAA6jcgdVsUu4tGeVHo","Size":15} 62 | */ 63 | /** [ipfs::Client::BlockStat] */ 64 | ipfs::test::check_if_properties_exist("client.BlockStat()", stat_result, 65 | {"Key", "Size"}); 66 | } catch (const std::exception& e) { 67 | std::cerr << e.what() << std::endl; 68 | return 1; 69 | } 70 | 71 | return 0; 72 | } 73 | -------------------------------------------------------------------------------- /test/test_config.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016-2021, The C++ IPFS client library developers 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | 26 | int main(int, char**) { 27 | try { 28 | ipfs::Client client("localhost", 5001); 29 | 30 | /** [ipfs::Client::ConfigSet] */ 31 | client.ConfigSet("Datastore.StorageMax", "20GB"); 32 | 33 | client.ConfigSet("Datastore.StorageGCWatermark", 80); 34 | 35 | client.ConfigSet("Mounts", 36 | R"({ 37 | "FuseAllowOther": false, 38 | "IPFS": "/ipfs", 39 | "IPNS": "/ipns" 40 | })"_json); 41 | /** [ipfs::Client::ConfigSet] */ 42 | 43 | /** [ipfs::Client::ConfigGet] */ 44 | ipfs::Json config; 45 | client.ConfigGet("Datastore", &config); 46 | std::cout << R"(Config "Datastore":)" << std::endl 47 | << config.dump(2) << std::endl; 48 | /* An example output: 49 | Config "Datastore": 50 | { 51 | "BloomFilterSize": 0, 52 | "GCPeriod": "1h", 53 | "HashOnRead": false, 54 | "NoSync": false, 55 | "Params": null, 56 | "Path": "/home/vd/.ipfs/datastore", 57 | "StorageGCWatermark": 90, 58 | "StorageMax": "10GB", 59 | "Type": "leveldb" 60 | } 61 | */ 62 | 63 | client.ConfigGet("" /* fetch the entire config */, &config); 64 | std::cout << "Config max storage: " << config["Datastore"]["StorageMax"] 65 | << std::endl; 66 | /* An example output: 67 | Config max storage: "10GB" 68 | */ 69 | /** [ipfs::Client::ConfigGet] */ 70 | 71 | /** [ipfs::Client::ConfigReplace] */ 72 | ipfs::Json entire_config; 73 | client.ConfigGet("" /* fetch the entire config */, &entire_config); 74 | 75 | client.ConfigReplace(entire_config); 76 | /** [ipfs::Client::ConfigReplace] */ 77 | } catch (const std::exception& e) { 78 | std::cerr << e.what() << std::endl; 79 | return 1; 80 | } 81 | 82 | return 0; 83 | } 84 | -------------------------------------------------------------------------------- /docs/folderopend.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /docs/folderopen.svg: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 9 | 10 | 11 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12.0) 2 | 3 | list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") 4 | 5 | # Adhere the version number to http://semver.org/ 6 | project(cpp-ipfs-http-client 7 | VERSION 0.7.0 8 | LANGUAGES CXX) 9 | 10 | # Avoid warning about DOWNLOAD_EXTRACT_TIMESTAMP in CMake 3.24: 11 | if (CMAKE_VERSION VERSION_GREATER_EQUAL "3.24.0") 12 | cmake_policy(SET CMP0135 NEW) 13 | endif() 14 | 15 | # Compile in C++20 mode 16 | set(CMAKE_CXX_STANDARD 20) 17 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 18 | 19 | # Add compiler warnings 20 | if ("${CMAKE_CXX_COMPILER_ID}" MATCHES "^(AppleClang|Clang|GNU)$") 21 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror -pedantic -Werror=incompatible-pointer-types") 22 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wpedantic -Wextra -Werror") 23 | endif() 24 | 25 | # Generate compile_commands.json, to be used by YouCompleteMe. 26 | set(CMAKE_EXPORT_COMPILE_COMMANDS ON) 27 | 28 | 29 | # Set the available options 30 | option(DOC "Build Doxygen" OFF) 31 | option(COVERAGE "Enable generation of coverage info" OFF) 32 | option(BUILD_TESTING "Enable building test cases" ON) 33 | 34 | # Find curl 35 | # Look for static import symbols for Windows builds 36 | if(WIN32) 37 | add_definitions("-DCURL_STATICLIB") 38 | endif() 39 | find_package(CURL REQUIRED) 40 | 41 | # When build with coverage, set the correct compiler flags before the targets are defined 42 | if(COVERAGE) 43 | set(CMAKE_BUILD_TYPE Debug) 44 | 45 | include(CodeCoverage) 46 | append_coverage_compiler_flags() 47 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0") 48 | endif() 49 | 50 | # Targets 51 | set(IPFS_API_LIBNAME ipfs-http-client) 52 | 53 | # To build and install a shared library: "cmake -DBUILD_SHARED_LIBS:BOOL=ON ..." 54 | add_library(${IPFS_API_LIBNAME} 55 | src/client.cc 56 | src/http/transport-curl.cc 57 | ) 58 | 59 | # Add include directories 60 | target_include_directories(${IPFS_API_LIBNAME} 61 | PUBLIC 62 | ${CMAKE_CURRENT_SOURCE_DIR}/include 63 | ${CURL_INCLUDE_DIRS} 64 | ) 65 | 66 | # Fetch "JSON for Modern C++" 67 | include(FetchContent) 68 | # Retrieve Nlohmann JSON 69 | FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz) 70 | FetchContent_MakeAvailable(json) 71 | 72 | # libcurl requires additional libs only for static Windows builds 73 | if(WIN32) 74 | set(WINDOWS_CURL_LIBS idn2 unistring iconv charset ssh2 gcrypt gpg-error ws2_32 advapi32 crypt32 wldap32) 75 | endif() 76 | 77 | set_target_properties(${IPFS_API_LIBNAME} PROPERTIES 78 | SOVERSION ${PROJECT_VERSION_MAJOR} 79 | VERSION ${PROJECT_VERSION} 80 | ) 81 | target_link_libraries(${IPFS_API_LIBNAME} ${CURL_LIBRARIES} ${WINDOWS_CURL_LIBS} nlohmann_json::nlohmann_json) 82 | if(NOT DISABLE_INSTALL) 83 | install(TARGETS ${IPFS_API_LIBNAME} DESTINATION lib) 84 | install(FILES include/ipfs/client.h DESTINATION include/ipfs) 85 | install(FILES include/ipfs/http/transport.h DESTINATION include/ipfs/http) 86 | install(FILES ${json_SOURCE_DIR}/include/nlohmann/json.hpp DESTINATION include/nlohmann) 87 | endif() 88 | # Tests, use "CTEST_OUTPUT_ON_FAILURE=1 make test" to see output from failed tests 89 | 90 | # https://cmake.org/cmake/help/v3.0/module/CTest.html 91 | include(CTest) 92 | if(BUILD_TESTING) 93 | add_subdirectory(test) 94 | endif() 95 | 96 | if(DOC) 97 | include(doxygen) 98 | endif() 99 | -------------------------------------------------------------------------------- /test/test_generic.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016-2022, The C++ IPFS client library developers 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | int main(int, char**) { 28 | try { 29 | // Test client constructor 30 | /** [ipfs::Client::Client] */ 31 | ipfs::Client client("localhost", 5001); 32 | 33 | // Client constructor with additional parameters 34 | ipfs::Client client2("localhost", 5001, "6s", "http://", "/api/v0"); 35 | 36 | // Client constructor with cURL debug mode enabled 37 | ipfs::Client client3("localhost", 5001, "6s", "http://", "/api/v0", true); 38 | /** [ipfs::Client::Client] */ 39 | 40 | // Test copy/move of client objects 41 | ipfs::Client clientA(client); 42 | clientA = client; 43 | ipfs::Client clientB(std::move(clientA)); 44 | ipfs::Client clientC("localhost", 5001); 45 | clientC = std::move(clientB); 46 | 47 | #pragma GCC diagnostic push 48 | #pragma GCC diagnostic ignored "-Wall" 49 | clientA = clientA; 50 | #pragma GCC diagnostic pop 51 | 52 | #pragma GCC diagnostic push 53 | #pragma GCC diagnostic ignored "-Wall" 54 | clientA = std::move(clientA); 55 | #pragma GCC diagnostic pop 56 | 57 | /** [ipfs::Client::Id] */ 58 | ipfs::Json id; 59 | client.Id(&id); 60 | std::cout << "Peer's public key: " << id["PublicKey"] << std::endl; 61 | /* An example output: 62 | Peer's public key: "CAASpgIwggEiMA0GCSqGSIb3DQN/ImJDE/CN1eHE....gMBAAE=" 63 | */ 64 | /** [ipfs::Client::Id] */ 65 | ipfs::test::check_if_properties_exist("client.Id()", id, 66 | {"Addresses", "ID", "PublicKey"}); 67 | 68 | /** [ipfs::Client::Version] */ 69 | ipfs::Json version; 70 | client.Version(&version); 71 | std::cout << "Peer's version: " << version << std::endl; 72 | /* An example output: 73 | Peer's version: {"Commit":"ee6dd5e","Golang":"go1.7.3","Repo":"4", 74 | "System":"amd64/freebsd","Version":"0.4.3"} 75 | */ 76 | /** [ipfs::Client::Version] */ 77 | ipfs::test::check_if_properties_exist("client.Version()", version, 78 | {"Repo", "System", "Version"}); 79 | } catch (const std::exception& e) { 80 | std::cerr << e.what() << std::endl; 81 | return 1; 82 | } 83 | 84 | return 0; 85 | } 86 | -------------------------------------------------------------------------------- /docs/namespacemembers.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | cpp-ipfs-http-client: Namespace Members 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 28 | 29 | 30 |
24 |
cpp-ipfs-http-client 25 |
26 |
IPFS C++ client library
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 |
51 | 52 |
56 |
57 | 58 | 59 |
60 |
61 |
62 |
63 |
64 |
Loading...
65 |
Searching...
66 |
No Matches
67 |
68 |
69 |
70 |
71 | 72 |
73 |
Here is a list of all documented namespace members with links to the namespaces they belong to:
    74 |
  • Json : ipfs
  • 75 |
76 |
77 | 78 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /docs/namespacemembers_type.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | cpp-ipfs-http-client: Namespace Members 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 28 | 29 | 30 |
24 |
cpp-ipfs-http-client 25 |
26 |
IPFS C++ client library
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 |
51 | 52 |
56 |
57 | 58 | 59 |
60 |
61 |
62 |
63 |
64 |
Loading...
65 |
Searching...
66 |
No Matches
67 |
68 |
69 |
70 |
71 | 72 |
73 |
Here is a list of all documented namespace typedefs with links to the namespaces they belong to:
    74 |
  • Json : ipfs
  • 75 |
76 |
77 | 78 | 81 | 82 | 83 | -------------------------------------------------------------------------------- /test/test_key.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016-2022, The C++ IPFS client library developers 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 19 | 20 | #include 21 | #include 22 | 23 | #include 24 | #include 25 | #include 26 | 27 | using Json = nlohmann::json; 28 | 29 | int main(int, char**) { 30 | /* Clean-up keys, just in case */ 31 | try { 32 | ipfs::Client client("localhost", 5001); 33 | client.KeyRm("foobar-key"); 34 | client.KeyRm("foobar-key2"); 35 | client.KeyRm("foobar-new-key2"); 36 | } catch (const std::exception& e) { 37 | // Ignore errors 38 | } 39 | 40 | try { 41 | ipfs::Client client("localhost", 5001); 42 | 43 | /** [ipfs::Client::KeyGen] */ 44 | std::string key_id; 45 | client.KeyGen("foobar-key", "rsa", 2048, &key_id); 46 | std::cout << "Generated key: " << key_id << std::endl; 47 | client.KeyGen("foobar-key2", "rsa", 2048, &key_id); 48 | std::cout << "Generated key2: " << key_id << std::endl; 49 | /* An example output: 50 | Generated key: "QmQeVW8BKqpHbUV5GcecC3wDLF3iqV6ZJhtFN8q8mUYFUs" 51 | */ 52 | /** [ipfs::Client::KeyGen] */ 53 | 54 | /** [ipfs::Client::KeyList] */ 55 | Json key_list; 56 | client.KeyList(&key_list); 57 | std::cout << "A list of all local keys: " << key_list.dump(2) << std::endl; 58 | /* An example output: 59 | A list of all local keys: [ 60 | { 61 | "Id": "QmQ9KnoHP3iRwXLSrdDb8wdJCbEdjk7hVFYGUGDUsdC41k", 62 | "Name": "self" 63 | }, 64 | { 65 | "Id": "QmNjm428tzU5P2ik1yDJNZP2F5zG2jb8fHXZ5D2mzvJGLg", 66 | "Name": "foobar-key" 67 | } 68 | ] 69 | */ 70 | /** [ipfs::Client::KeyList] */ 71 | 72 | /** [ipfs::Client::KeyRm] */ 73 | /* Successful, if no error is thrown. */ 74 | client.KeyRm("foobar-key"); 75 | /** [ipfs::Client::KeyRm] */ 76 | 77 | /** [ipfs::Client::KeyRename] */ 78 | Json key_list_rename; 79 | /* Renaming foobar-key2 to foobar-new-key2 */ 80 | client.KeyRename("foobar-key2", "foobar-new-key2"); 81 | client.KeyList(&key_list_rename); 82 | std::cout << "A list of new local keys: " << key_list_rename.dump(2) 83 | << std::endl; 84 | /** [ipfs::Client::KeyRename] */ 85 | 86 | /* Clean-up key */ 87 | client.KeyRm("foobar-new-key2"); 88 | } catch (const std::exception& e) { 89 | std::cerr << e.what() << std::endl; 90 | return 1; 91 | } 92 | 93 | return 0; 94 | } 95 | -------------------------------------------------------------------------------- /docs/examples.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | cpp-ipfs-http-client: Examples 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 28 | 29 | 30 |
24 |
cpp-ipfs-http-client 25 |
26 |
IPFS C++ client library
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 |
51 | 52 |
56 |
57 | 58 | 59 |
60 |
61 |
62 |
63 |
64 |
Loading...
65 |
Searching...
66 |
No Matches
67 |
68 |
69 |
70 |
71 | 72 |
73 |
Examples
74 |
75 |
76 |
Here is a list of all examples:
79 |
80 | 81 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /docs/dir_13e138d54eb8818da29c3992edef070a.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | cpp-ipfs-http-client: /media/melroy/Data/Projects/cpp-ipfs-http-client/test Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 28 | 29 | 30 |
24 |
cpp-ipfs-http-client 25 |
26 |
IPFS C++ client library
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 |
60 |
61 |
62 |
63 |
Loading...
64 |
Searching...
65 |
No Matches
66 |
67 |
68 |
69 |
70 | 71 | 75 |
76 |
77 |
test Directory Reference
78 |
79 |
80 |
81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /docs/functions_enum.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | cpp-ipfs-http-client: Class Members - Enumerations 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 28 | 29 | 30 |
24 |
cpp-ipfs-http-client 25 |
26 |
IPFS C++ client library
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 |
51 | 52 |
56 |
57 | 58 | 59 |
60 |
61 |
62 |
63 |
64 |
Loading...
65 |
Searching...
66 |
No Matches
67 |
68 |
69 |
70 |
71 | 72 |
73 |
Here is a list of all documented enums with links to the class documentation for each member:
77 |
78 | 79 | 82 | 83 | 84 | -------------------------------------------------------------------------------- /docs/dir_2d29d7dff7c7baf1180920f6796c23ae.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | cpp-ipfs-http-client: /media/melroy/Data/Projects/cpp-ipfs-http-client/src/http Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 28 | 29 | 30 |
24 |
cpp-ipfs-http-client 25 |
26 |
IPFS C++ client library
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 |
60 |
61 |
62 |
63 |
Loading...
64 |
Searching...
65 |
No Matches
66 |
67 |
68 |
69 |
70 | 71 | 75 |
76 |
77 |
http Directory Reference
78 |
79 |
80 |
81 | 82 | 85 | 86 | 87 | -------------------------------------------------------------------------------- /docs/menudata.js: -------------------------------------------------------------------------------- 1 | /* 2 | @licstart The following is the entire license notice for the JavaScript code in this file. 3 | 4 | The MIT License (MIT) 5 | 6 | Copyright (C) 1997-2020 by Dimitri van Heesch 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software 9 | and associated documentation files (the "Software"), to deal in the Software without restriction, 10 | including without limitation the rights to use, copy, modify, merge, publish, distribute, 11 | sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all copies or 15 | substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING 18 | BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 19 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 20 | DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 22 | 23 | @licend The above is the entire license notice for the JavaScript code in this file 24 | */ 25 | var menudata={children:[ 26 | {text:"Main Page",url:"index.html"}, 27 | {text:"Namespaces",url:"namespaces.html",children:[ 28 | {text:"Namespace List",url:"namespaces.html"}, 29 | {text:"Namespace Members",url:"namespacemembers.html",children:[ 30 | {text:"All",url:"namespacemembers.html"}, 31 | {text:"Typedefs",url:"namespacemembers_type.html"}]}]}, 32 | {text:"Classes",url:"annotated.html",children:[ 33 | {text:"Class List",url:"annotated.html"}, 34 | {text:"Class Index",url:"classes.html"}, 35 | {text:"Class Hierarchy",url:"hierarchy.html"}, 36 | {text:"Class Members",url:"functions.html",children:[ 37 | {text:"All",url:"functions.html",children:[ 38 | {text:"a",url:"functions.html#index_a"}, 39 | {text:"b",url:"functions.html#index_b"}, 40 | {text:"c",url:"functions.html#index_c"}, 41 | {text:"d",url:"functions.html#index_d"}, 42 | {text:"f",url:"functions.html#index_f"}, 43 | {text:"i",url:"functions.html#index_i"}, 44 | {text:"k",url:"functions.html#index_k"}, 45 | {text:"n",url:"functions.html#index_n"}, 46 | {text:"o",url:"functions.html#index_o"}, 47 | {text:"p",url:"functions.html#index_p"}, 48 | {text:"r",url:"functions.html#index_r"}, 49 | {text:"s",url:"functions.html#index_s"}, 50 | {text:"t",url:"functions.html#index_t"}, 51 | {text:"u",url:"functions.html#index_u"}, 52 | {text:"v",url:"functions.html#index_v"}, 53 | {text:"~",url:"functions.html#index__7E"}]}, 54 | {text:"Functions",url:"functions_func.html",children:[ 55 | {text:"a",url:"functions_func.html#index_a"}, 56 | {text:"b",url:"functions_func.html#index_b"}, 57 | {text:"c",url:"functions_func.html#index_c"}, 58 | {text:"d",url:"functions_func.html#index_d"}, 59 | {text:"f",url:"functions_func.html#index_f"}, 60 | {text:"i",url:"functions_func.html#index_i"}, 61 | {text:"k",url:"functions_func.html#index_k"}, 62 | {text:"n",url:"functions_func.html#index_n"}, 63 | {text:"o",url:"functions_func.html#index_o"}, 64 | {text:"p",url:"functions_func.html#index_p"}, 65 | {text:"r",url:"functions_func.html#index_r"}, 66 | {text:"s",url:"functions_func.html#index_s"}, 67 | {text:"t",url:"functions_func.html#index_t"}, 68 | {text:"u",url:"functions_func.html#index_u"}, 69 | {text:"v",url:"functions_func.html#index_v"}, 70 | {text:"~",url:"functions_func.html#index__7E"}]}, 71 | {text:"Variables",url:"functions_vars.html"}, 72 | {text:"Enumerations",url:"functions_enum.html"}]}]}, 73 | {text:"Files",url:"files.html",children:[ 74 | {text:"File List",url:"files.html"}]}, 75 | {text:"Examples",url:"examples.html"}]} 76 | -------------------------------------------------------------------------------- /docs/functions_vars.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | cpp-ipfs-http-client: Class Members - Variables 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 28 | 29 | 30 |
24 |
cpp-ipfs-http-client 25 |
26 |
IPFS C++ client library
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 |
51 | 52 |
56 |
57 | 58 | 59 |
60 |
61 |
62 |
63 |
64 |
Loading...
65 |
Searching...
66 |
No Matches
67 |
68 |
69 |
70 |
71 | 72 |
73 |
Here is a list of all documented variables with links to the class documentation for each member:
78 |
79 | 80 | 83 | 84 | 85 | -------------------------------------------------------------------------------- /include/ipfs/test/utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016-2019, The C++ IPFS client library developers 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 19 | 20 | #ifndef IPFS_TEST_UTILS_H 21 | #define IPFS_TEST_UTILS_H 22 | 23 | #include 24 | 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | 32 | namespace ipfs { 33 | 34 | namespace test { 35 | 36 | /** Check if a given set of properties exist in a JSON. */ 37 | inline void check_if_properties_exist( 38 | /** [in] Label to use when throwing an exception if a failure occurs. */ 39 | const std::string& label, 40 | /** [in] JSON to check for the properties. */ 41 | const ipfs::Json& j, 42 | /** [in] List of properties. */ 43 | const std::vector& properties) { 44 | for (const char* property : properties) { 45 | if (j.find(property) == j.end()) { 46 | throw std::runtime_error(label + ": the property \"" + property + 47 | "\" was not found in the response:\n" + 48 | j.dump(2)); 49 | } 50 | } 51 | } 52 | 53 | /** Check if a string contains another string and throw an exception if it does 54 | * not. */ 55 | inline void check_if_string_contains( 56 | /** [in] Label to use when throwing an exception if a failure occurs. */ 57 | const std::string& label, 58 | /** [in] String to search into. */ 59 | const std::string& big, 60 | /** [in] String to search for. */ 61 | const std::string& needle) { 62 | if (big.find(needle) == big.npos) { 63 | throw std::runtime_error(label + ": \"" + needle + 64 | "\" was not found in the response:\n" + big); 65 | } 66 | } 67 | 68 | /** Convert a string to hex. For example: "abcd" -> "61626364". */ 69 | inline std::string string_to_hex( 70 | /** [in] String to convert. */ 71 | const std::string& input) { 72 | std::stringstream ss; 73 | ss << std::hex; 74 | for (size_t i = 0; i < input.length(); ++i) { 75 | ss << std::setw(2) << std::setfill('0') << static_cast(input[i]); 76 | } 77 | return ss.str(); 78 | } 79 | 80 | /** Execute a function and expect it to throw an exception. */ 81 | inline void must_fail( 82 | /** [in] Label to prefix in diagnostics. */ 83 | const std::string& label, 84 | /** [in,out] Function to execute, must throw an exception. */ 85 | std::function f) { 86 | bool succeeded; 87 | 88 | try { 89 | f(); 90 | succeeded = true; 91 | } catch (const std::exception& e) { 92 | std::cout << label + " failed as expected with error message: " << e.what() 93 | << std::endl; 94 | succeeded = false; 95 | } 96 | 97 | if (succeeded) { 98 | throw std::runtime_error(label + " succeeded but should have failed."); 99 | } 100 | } 101 | 102 | } /* namespace test */ 103 | } /* namespace ipfs */ 104 | #endif /* IPFS_TEST_UTILS_H */ 105 | -------------------------------------------------------------------------------- /test/test_pin.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2016-2021, The C++ IPFS client library developers 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of 4 | this software and associated documentation files (the "Software"), to deal in 5 | the Software without restriction, including without limitation the rights to 6 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 7 | the Software, and to permit persons to whom the Software is furnished to do so, 8 | subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 15 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 16 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 17 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 18 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ 19 | 20 | #include 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | int main(int, char**) { 27 | try { 28 | ipfs::Client client("localhost", 5001); 29 | 30 | std::string object_id; 31 | 32 | client.ObjectNew(&object_id); 33 | 34 | /** [ipfs::Client::PinAdd] */ 35 | /* std::string object_id = "QmdfTbBqBPQ7VNxZEYEj14V...1zR1n" for example. */ 36 | client.PinAdd(object_id); 37 | 38 | std::cout << "Pinned object: " << object_id << std::endl; 39 | /* An example output: 40 | Pinned object: QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n 41 | */ 42 | /** [ipfs::Client::PinAdd] */ 43 | 44 | /** [ipfs::Client::PinLs__a] */ 45 | ipfs::Json pinned; 46 | 47 | client.PinLs(&pinned); 48 | 49 | std::cout << "List of all pinned objects:" << std::endl 50 | << pinned.dump(2) << std::endl; 51 | /* An example output: 52 | List of all pinned objects: 53 | { 54 | "Keys": { 55 | "QmNYaS23te5Rja36U94JoSTuMxJZmBEnHN8KEcjR6rGRGn": { 56 | "Type": "indirect" 57 | }, 58 | "QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn": { 59 | "Type": "recursive" 60 | }, 61 | "Qmf5t6BgYbiT2usHRToVzLu5DNHfH39S4dq6JTxf69Npzt": { 62 | "Type": "indirect" 63 | } 64 | } 65 | } 66 | */ 67 | /** [ipfs::Client::PinLs__a] */ 68 | 69 | /** [ipfs::Client::PinLs__b] */ 70 | /* std::string object_id = "QmdfTbBqBPQ7VNxZEYEj14V...1zR1n" for example. */ 71 | client.PinLs(object_id, &pinned); 72 | 73 | std::cout << "List pinned objects under " << object_id << ":" << std::endl 74 | << pinned.dump(2) << std::endl; 75 | /* An example output: 76 | List pinned objects under QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n: 77 | { 78 | "Keys": { 79 | "QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n": { 80 | "Type": "recursive" 81 | } 82 | } 83 | } 84 | */ 85 | /** [ipfs::Client::PinLs__b] */ 86 | 87 | /** [ipfs::Client::PinRm] */ 88 | /* std::string object_id = "QmdfTbBqBPQ7VNxZEYEj14V...1zR1n" for example. */ 89 | 90 | bool unpinned; 91 | try { 92 | client.PinRm(object_id, ipfs::Client::PinRmOptions::NON_RECURSIVE); 93 | unpinned = true; 94 | } catch (const std::exception&) { 95 | unpinned = false; 96 | } 97 | 98 | if (unpinned) { 99 | throw std::runtime_error( 100 | "Unpinning " + object_id + 101 | " non-recursively succeeded but should have failed."); 102 | } 103 | 104 | client.PinRm(object_id, ipfs::Client::PinRmOptions::RECURSIVE); 105 | /** [ipfs::Client::PinRm] */ 106 | } catch (const std::exception& e) { 107 | std::cerr << e.what() << std::endl; 108 | return 1; 109 | } 110 | 111 | return 0; 112 | } 113 | -------------------------------------------------------------------------------- /docs/dir_68267d1309a1af8e8297ef4c3efbcdba.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | cpp-ipfs-http-client: /media/melroy/Data/Projects/cpp-ipfs-http-client/src Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 28 | 29 | 30 |
24 |
cpp-ipfs-http-client 25 |
26 |
IPFS C++ client library
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 |
60 |
61 |
62 |
63 |
Loading...
64 |
Searching...
65 |
No Matches
66 |
67 |
68 |
69 |
70 | 71 | 75 |
76 |
77 |
src Directory Reference
78 |
79 |
80 | 81 | 83 | 84 | 85 |

82 | Directories

 http
 
86 |
87 | 88 | 91 | 92 | 93 | -------------------------------------------------------------------------------- /docs/dir_d44c64559bbebec7f509842c48db8b23.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | cpp-ipfs-http-client: /media/melroy/Data/Projects/cpp-ipfs-http-client/include Directory Reference 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 |
20 | 21 | 22 | 23 | 28 | 29 | 30 |
24 |
cpp-ipfs-http-client 25 |
26 |
IPFS C++ client library
27 |
31 |
32 | 33 | 34 | 39 | 40 | 41 | 49 | 50 | 51 |
55 |
56 | 57 | 58 |
59 |
60 |
61 |
62 |
63 |
Loading...
64 |
Searching...
65 |
No Matches
66 |
67 |
68 |
69 |
70 | 71 | 75 |
76 |
77 |
include Directory Reference
78 |
79 |
80 | 81 | 83 | 84 | 85 |

82 | Directories

 ipfs
 
86 |
87 | 88 | 91 | 92 | 93 | --------------------------------------------------------------------------------