Skip to content

Refactor: filevector comparison #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions Sources/PrivMXEndpointSwiftNative/include/PrivMXUtils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ using EntryHandle = int64_t;
using InboxFileHandle = int64_t;
using InboxFileHandleVector = std::vector<InboxFileHandle>;
using StringVector = std::vector<std::string>;
using FileVector = std::vector<endpoint::store::File>;
using OptionalString = std::optional<std::string>;
using UserWithPubKeyVector = std::vector<endpoint::core::UserWithPubKey>;
using UserInfoVector = std::vector<endpoint::core::UserInfo>;
Expand Down Expand Up @@ -135,6 +136,11 @@ static bool compareVectors(const StringVector& lhs, const StringVector& rhs){
return lhs == rhs;
}

/// Exposes vector comaprison in Swift
static bool compareVectors(const FileVector& lhs, const FileVector& rhs){
return lhs == rhs;
}

/// Returns a copy of the underlying `std::string` from the provided Buffer
static std::string stringFromBuffer(const endpoint::core::Buffer& buf){
return std::string(buf.stdString());
Expand Down