diff options
Diffstat (limited to 'collaboration.cpp')
| -rw-r--r-- | collaboration.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/collaboration.cpp b/collaboration.cpp index b07cd845..d7d5d6e2 100644 --- a/collaboration.cpp +++ b/collaboration.cpp @@ -977,6 +977,34 @@ std::vector<std::pair<std::string, std::string>> Remote::SearchUsers(const std:: } +std::vector<Remote::FileSearchMatch> Remote::FindFiles(const std::string& name) +{ + size_t count = 0; + BNRemoteFileSearchMatch* matches = BNRemoteFindFiles(m_object, name.c_str(), &count); + std::vector<FileSearchMatch> results; + if (!matches) + return results; + + results.reserve(count); + for (size_t i = 0; i < count; i++) + { + FileSearchMatch match; + if (matches[i].projectId) + match.projectId = matches[i].projectId; + if (matches[i].projectName) + match.projectName = matches[i].projectName; + if (matches[i].fileId) + match.fileId = matches[i].fileId; + if (matches[i].fileName) + match.fileName = matches[i].fileName; + results.push_back(std::move(match)); + } + + BNFreeRemoteFileSearchMatchList(matches, count); + return results; +} + + void Remote::PullUsers(ProgressFunction progress) { ProgressContext pctxt; @@ -2677,4 +2705,3 @@ CollabUndoEntry::CollabUndoEntry(BNCollaborationUndoEntry* entry) { m_object = entry; } - |
