Skip to content

Commit 8104d83

Browse files
authored
VER: Release 0.45.0
2 parents 3de8e70 + 93be1a2 commit 8104d83

23 files changed

+380
-85
lines changed

.clang-tidy

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Checks: >
44
bugprone-*,
55
-bugprone-easily-swappable-parameters,
66
clang-analyzer-*,
7+
-clang-analyzer-optin.cplusplus.VirtualCall,
78
clang-diagnostic-*,
89
cppcore-guidelines-*,
910
google-*,

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 0.45.0 - 2025-12-10
4+
5+
### Enhancements
6+
- Added download retry, resumption, and checksum verification to
7+
`Historical::BatchDownload`
8+
- Added new venue, dataset, and publisher for Cboe Futures Exchange (`XCBF.PITCH`)
9+
- Upgraded default `httplib` version to 0.28.0
10+
311
## 0.44.0 - 2025-11-18
412

513
### Enhancements

CMakeLists.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ cmake_minimum_required(VERSION 3.24..4.0)
66

77
project(
88
databento
9-
VERSION 0.44.0
9+
VERSION 0.45.0
1010
LANGUAGES CXX
1111
DESCRIPTION "Official Databento client library"
1212
)
@@ -128,6 +128,10 @@ endif()
128128

129129
find_package(OpenSSL REQUIRED)
130130
find_package(zstd REQUIRED)
131+
if (APPLE)
132+
find_library(CORE_FOUNDATION_LIB CoreFoundation REQUIRED)
133+
find_library(CFNETWORK_LIB CFNetwork REQUIRED)
134+
endif()
131135
if(NOT TARGET zstd::libzstd)
132136
if(TARGET zstd::libzstd_shared)
133137
add_library(zstd::libzstd ALIAS zstd::libzstd_shared)
@@ -178,7 +182,7 @@ if(${PROJECT_NAME_UPPERCASE}_USE_EXTERNAL_HTTPLIB)
178182
find_package(httplib REQUIRED)
179183
endif()
180184
else()
181-
set(httplib_version 0.20.0)
185+
set(httplib_version 0.28.0)
182186
FetchContent_Declare(
183187
httplib
184188
URL https://github.com/yhirose/cpp-httplib/archive/refs/tags/v${httplib_version}.tar.gz
@@ -223,6 +227,9 @@ target_link_libraries(
223227
OpenSSL::SSL
224228
Threads::Threads
225229
zstd::libzstd
230+
# macOS-specific libraries required by httplib
231+
$<$<PLATFORM_ID:Darwin>:${CFNETWORK_LIB}>
232+
$<$<PLATFORM_ID:Darwin>:${CORE_FRAMEWORK_LIB}>
226233
)
227234

228235
target_compile_definitions(

cmake/SourcesAndHeaders.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ set(headers
1313
include/databento/detail/json_helpers.hpp
1414
include/databento/detail/scoped_fd.hpp
1515
include/databento/detail/scoped_thread.hpp
16+
include/databento/detail/sha256_hasher.hpp
1617
include/databento/detail/tcp_client.hpp
1718
include/databento/detail/zstd_stream.hpp
1819
include/databento/enums.hpp
@@ -54,6 +55,7 @@ set(sources
5455
src/detail/http_client.cpp
5556
src/detail/json_helpers.cpp
5657
src/detail/scoped_fd.cpp
58+
src/detail/sha256_hasher.cpp
5759
src/detail/tcp_client.cpp
5860
src/detail/zstd_stream.cpp
5961
src/enums.cpp

cmake/StandardSettings.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Project settings
33
#
44

5+
option(${PROJECT_NAME_UPPERCASE}_USE_EXTERNAL_DATE "Use an external date library" OFF)
56
option(${PROJECT_NAME_UPPERCASE}_USE_EXTERNAL_JSON "Use an external JSON library" OFF)
67
option(${PROJECT_NAME_UPPERCASE}_USE_EXTERNAL_HTTPLIB "Use an external httplib library" OFF)
78
option(${PROJECT_NAME_UPPERCASE}_USE_EXTERNAL_GTEST "Use an external google test (gtest) library" ON)

include/databento/detail/http_client.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class HttpClient {
2323

2424
nlohmann::json GetJson(const std::string& path, const httplib::Params& params);
2525
nlohmann::json PostJson(const std::string& path, const httplib::Params& form_params);
26-
void GetRawStream(const std::string& path, const httplib::Params& params,
26+
void GetRawStream(const std::string& path, const httplib::Headers& headers,
2727
const httplib::ContentReceiver& callback);
2828
void PostRawStream(const std::string& path, const httplib::Params& form_params,
2929
const httplib::ContentReceiver& callback);
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#pragma once
2+
3+
#include <cstddef> // byte, size_t
4+
#include <memory> // unique_ptr
5+
#include <string>
6+
#include <string_view>
7+
8+
// Forward declaration
9+
struct evp_md_ctx_st;
10+
using EVP_MD_CTX = evp_md_ctx_st;
11+
12+
namespace databento::detail {
13+
// One-off hash
14+
std::string Sha256Hash(std::string_view data);
15+
16+
class Sha256Hasher {
17+
public:
18+
Sha256Hasher();
19+
20+
void Update(const std::byte* buffer, std::size_t length);
21+
std::string Finalize();
22+
23+
private:
24+
std::unique_ptr<::EVP_MD_CTX, void (*)(::EVP_MD_CTX*)> ctx_;
25+
};
26+
} // namespace databento::detail

include/databento/file_stream.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ class InFileStream : public IReadable {
2525
class OutFileStream : public IWritable {
2626
public:
2727
explicit OutFileStream(const std::filesystem::path& file_path);
28+
OutFileStream(const std::filesystem::path& file_path, std::ios_base::openmode mode);
2829

2930
void WriteAll(const std::byte* buffer, std::size_t length) override;
3031

include/databento/historical.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <filesystem>
55
#include <map> // multimap
66
#include <string>
7+
#include <string_view>
78
#include <vector>
89

910
#include "databento/batch.hpp" // BatchJob
@@ -225,7 +226,8 @@ class Historical {
225226
std::string user_agent_ext);
226227

227228
BatchJob BatchSubmitJob(const HttplibParams& params);
228-
void DownloadFile(const std::string& url, const std::filesystem::path& output_path);
229+
void DownloadFile(const std::string& url, const std::filesystem::path& output_path,
230+
std::string_view hash, std::uint64_t exp_size);
229231
std::vector<BatchJob> BatchListJobs(const HttplibParams& params);
230232
std::vector<DatasetConditionDetail> MetadataGetDatasetCondition(
231233
const HttplibParams& params);

include/databento/publishers.hpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,8 @@ enum class Venue : std::uint16_t {
109109
Xeur = 50,
110110
// European Energy Exchange
111111
Xeee = 51,
112+
// Cboe Futures Exchange
113+
Xcbf = 52,
112114
};
113115

114116
// A source of data.
@@ -191,6 +193,8 @@ enum class Dataset : std::uint16_t {
191193
XeurEobi = 38,
192194
// European Energy Exchange EOBI
193195
XeeeEobi = 39,
196+
// Cboe Futures Exchange PITCH
197+
XcbfPitch = 40,
194198
};
195199

196200
// A specific Venue from a specific data source.
@@ -403,6 +407,8 @@ enum class Publisher : std::uint16_t {
403407
XeurEobiXoff = 103,
404408
// European Energy Exchange EOBI - Off-Market Trades
405409
XeeeEobiXoff = 104,
410+
// Cboe Futures Exchange
411+
XcbfPitchXcbf = 105,
406412
};
407413

408414
// Get a Publisher's Venue.

0 commit comments

Comments
 (0)