Skip to content
This repository has been archived by the owner on Jan 22, 2025. It is now read-only.

Commit

Permalink
[uncia] update to 2.0.4 simplify code and improve cli
Browse files Browse the repository at this point in the history
  • Loading branch information
fcharlie committed Apr 17, 2022
1 parent 2660a8f commit 3ee8688
Show file tree
Hide file tree
Showing 26 changed files with 3,322 additions and 1,554 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ endif()

set(UNCIA_VERSION_MAJOR 2)
set(UNCIA_VERSION_MINOR 0)
set(UNCIA_VERSION_PATCH 3)
set(UNCIA_VERSION_PATCH 4)
set(PACKAGE_VERSION "${UNCIA_VERSION_MAJOR}.${UNCIA_VERSION_MINOR}.${UNCIA_VERSION_PATCH}")

string(TOLOWER "${CMAKE_C_COMPILER_ARCHITECTURE_ID}" UNCIA_ARCH_NAME)
Expand Down
43 changes: 34 additions & 9 deletions include/archive.hpp
Original file line number Diff line number Diff line change
@@ -1,15 +1,40 @@
#include <bela/base.hpp>
#include <bela/str_cat.hpp>
#include <filesystem>

namespace uncia::archive {
std::optional<std::string> JoinSanitizePath(std::wstring_view root, std::string_view filename, bool always_utf8 = true);
bool MakeFlattened(std::wstring_view dir, std::wstring_view dest, bela::error_code &ec);
bool MakeDir(std::wstring_view path, bela::error_code &ec);
std::wstring_view PathRemoveExtension(std::wstring_view p);
inline std::wstring FileDestination(std::wstring_view arfile) {
if (auto d = PathRemoveExtension(arfile); d.size() != arfile.size()) {
return std::wstring(d);
}
return bela::StringCat(arfile, L".out");
// Flattened: find flatten child directories
std::optional<std::filesystem::path> Flattened(const std::filesystem::path &d);
// MakeFlattened: Flatten directories
bool MakeFlattened(const std::filesystem::path &d, bela::error_code &ec);

inline bool MakeDirectories(const std::filesystem::path &path, bela::error_code &ec) {
std::error_code e;
if (std::filesystem::exists(path, e)) {
return true;
}
if (std::filesystem::create_directories(path, e); e) {
ec = bela::make_error_code_from_std(e);
return false;
}
return true;
}

inline bool MakeParentDirectories(const std::filesystem::path &path, bela::error_code &ec) {
std::error_code e;
auto parent = path.parent_path();
if (std::filesystem::exists(parent, e)) {
return true;
}
if (std::filesystem::create_directories(parent, e); e) {
ec = bela::make_error_code_from_std(e);
return false;
}
return true;
}
std::wstring_view PathStripExtension(std::wstring_view p);
std::optional<std::filesystem::path> MakeUnqiueExtractedDestination(const std::filesystem::path &archive_file,
std::filesystem::path &strict_folder);
std::optional<std::filesystem::path> JoinSanitizeFsPath(const std::filesystem::path &root, std::string_view child_path,
bool always_utf8, std::wstring &encoded_path);
} // namespace uncia::archive
2 changes: 1 addition & 1 deletion include/fmt.lock
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.0.1
8.1.1
2 changes: 2 additions & 0 deletions include/fmt/args.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ class dynamic_format_arg_store
}

public:
constexpr dynamic_format_arg_store() = default;

/**
\rst
Adds an argument into the dynamic store for later passing to a formatting
Expand Down
Loading

0 comments on commit 3ee8688

Please sign in to comment.