Skip to content

Commit

Permalink
u_short and tinyxml2 reference
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugoberry committed Apr 1, 2024
1 parent 615c8e2 commit 8c60056
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
7 changes: 1 addition & 6 deletions src/abf/AbfParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,8 @@ std::vector<uint8_t> AbfParser::trim_buffer(const std::vector<uint8_t> &buffer)

std::tuple<uint64_t,int> AbfParser::process_backup_log_header(const std::vector<uint8_t> &buffer)
{
constexpr int backup_log_header_offset = 72;
constexpr int backup_log_header_size = 0x1000 - backup_log_header_offset;

std::vector<uint8_t> backup_log_header_buffer = read_buffer_bytes(buffer, backup_log_header_offset, backup_log_header_size);
std::vector<uint8_t> backup_log_header_buffer = read_buffer_bytes(buffer, ABF_BACKUP_LOG_HEADER_OFFSET, ABF_BACKUP_LOG_HEADER_SIZE);
backup_log_header_buffer = trim_buffer(backup_log_header_buffer);
BackupLogHeader backup_log_header = BackupLogHeader::from_xml(backup_log_header_buffer, "UTF-16");
return {backup_log_header.m_cbOffsetHeader, backup_log_header.DataSize};
Expand Down Expand Up @@ -112,8 +110,6 @@ std::pair<uint64_t, uint64_t> AbfParser::initialize_zip_and_locate_datamodel(con
}

void AbfParser::read_compressed_datamodel_header(std::ifstream &entryStream, uint64_t &datamodel_ofs) {
constexpr u_short ZIP_LOCAL_FILE_HEADER_FIXED = 26;
constexpr u_short ZIP_LOCAL_FILE_HEADER = 30;
// Read compressed DataModel header to adjust offset
entryStream.seekg(datamodel_ofs+ZIP_LOCAL_FILE_HEADER_FIXED);
uint16_t filename_len = 0;
Expand All @@ -125,7 +121,6 @@ void AbfParser::read_compressed_datamodel_header(std::ifstream &entryStream, uin
}

std::vector<uint8_t> AbfParser::decompress_initial_block(std::ifstream &entryStream, uint64_t datamodel_ofs, XPress9Wrapper &xpress9_wrapper) {
constexpr u_short ABF_XPRESS9_SIGNATRUE = 102;
// Seek to the start of the DataModel compressed data
entryStream.seekg(datamodel_ofs + ABF_XPRESS9_SIGNATRUE, std::ios::beg);

Expand Down
7 changes: 7 additions & 0 deletions src/abf/AbfParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@

#include "Xpress9Wrapper.h"

// Constants related to ZIP file parsing
constexpr unsigned char ZIP_LOCAL_FILE_HEADER_FIXED = 26;
constexpr unsigned char ZIP_LOCAL_FILE_HEADER = 30;
constexpr unsigned char ABF_XPRESS9_SIGNATRUE = 102;
constexpr unsigned char ABF_BACKUP_LOG_HEADER_OFFSET = 72;
constexpr unsigned short ABF_BACKUP_LOG_HEADER_SIZE = 0x1000 - ABF_BACKUP_LOG_HEADER_OFFSET;

class AbfParser {
public:
static std::vector<uint8_t> get_sqlite(const std::string &path, const int trailing_chunks);
Expand Down
2 changes: 1 addition & 1 deletion src/include/pbix_extension.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define DUCKDB_BUILD_LOADABLE_EXTENSION
#endif
#include "duckdb.hpp"
#include "tinyxml2.h"
#include <tinyxml2.h>

Check failure on line 5 in src/include/pbix_extension.hpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_amd64, x86_64, x64-osx)

'tinyxml2.h' file not found

Check failure on line 5 in src/include/pbix_extension.hpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / Linux (linux_amd64_gcc4, quay.io/pypa/manylinux2014_x86_64, x64-linux)

tinyxml2.h: No such file or directory

Check failure on line 5 in src/include/pbix_extension.hpp

View workflow job for this annotation

GitHub Actions / Build extension binaries / MacOS (osx_arm64, arm64, arm64-osx)

'tinyxml2.h' file not found

#include "duckdb/catalog/catalog.hpp"
#include "duckdb/parser/parsed_data/create_table_function_info.hpp"
Expand Down

0 comments on commit 8c60056

Please sign in to comment.