Skip to content

Commit

Permalink
still broken
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugoberry committed Apr 12, 2024
1 parent 25b837f commit e298328
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ set(TARGET_NAME pbix)

set(EXTENSION_NAME ${TARGET_NAME}_extension)
set(LOADABLE_EXTENSION_NAME ${TARGET_NAME}_loadable_extension)
set(STRING_ENCODING_TYPE "ICONV" CACHE STRING "Set the way strings have to be encoded (ICONV|WIN32API|NONE|...)")
add_definitions(-DKS_STR_ENCODING_ICONV)

project(${TARGET_NAME})
include_directories(src/include)
include_directories(src/abf)
include_directories(third_party/kaitai)
include_directories(third_party/miniz)
include_directories(third_party/sqlite)
include_directories(third_party/tinyxml2)
Expand Down
2 changes: 1 addition & 1 deletion src/abf/AbfParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ std::pair<uint64_t, uint64_t> AbfParser::initialize_zip_and_locate_datamodel(con

std::pair<uint64_t, uint64_t> AbfParser::locate_datamodel(duckdb::ClientContext &context,const std::string &path) {
auto &fs = duckdb::FileSystem::GetFileSystem(context);
auto file_handle = fs.OpenFile(path, duckdb::FileFlags::FILE_FLAGS_READ);
auto file_handle = fs.OpenFile(path, FILE_READ);
duckdb::FileHandleStream file_stream(file_handle.get());

kaitai::kstream ks(&file_stream);
Expand Down
2 changes: 2 additions & 0 deletions src/abf/AbfParser.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include "Xpress9Wrapper.h"
#include "Crc32.h"
#include "duckdb.hpp"
#include "duckdb/common/file_open_flags.hpp"
#include "pbix.h"
#include "FileHandleStream.h"
#include <sstream>
Expand All @@ -30,6 +31,7 @@ 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;
static constexpr idx_t FILE_READ = idx_t(1 << 0);

class AbfParser {
public:
Expand Down
2 changes: 1 addition & 1 deletion src/abf/pbix.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ void pbix_t::central_dir_entry_t::_read() {
m_int_file_attr = m__io->read_u2le();
m_ext_file_attr = m__io->read_u4le();
m_ofs_local_header = m__io->read_s4le();
m_file_name = kaitai::kstream::bytes_to_str(m__io->read_bytes(len_file_name()), std::string("UTF-8"));
m_file_name = kaitai::kstream::bytes_to_str(m__io->read_bytes(len_file_name()), "UTF-8");
m_extra = m__io->read_bytes((len_extra() + len_comment()));
}

Expand Down

0 comments on commit e298328

Please sign in to comment.