BinaryNinja::Collaboration Namespace Reference

Classes

class  AnalysisMergeConflict
 
class  CollabChangeset
 
class  CollabGroup
 
class  CollabPermission
 
class  CollabSnapshot
 
class  CollabUndoEntry
 
class  CollabUser
 
struct  DatabaseConflictHandlerContext
 
struct  NameChangesetContext
 
class  Remote
 
struct  RemoteException
 
class  RemoteFile
 
class  RemoteFolder
 
class  RemoteProject
 
struct  SyncException
 
struct  TypeArchiveConflictHandlerContext
 
class  TypeArchiveMergeConflict
 

Typedefs

typedef std::function< bool(Ref< CollabChangeset >)> NameChangesetFunction
 
typedef std::function< bool(size_t, size_t)> ProgressFunction
 
typedef std::function< bool(const std::unordered_map< std::string, Ref< AnalysisMergeConflict > > &conflicts)> AnalysisConflictHandler
 
typedef std::function< bool(const std::vector< Ref< TypeArchiveMergeConflict > > &conflicts)> TypeArchiveConflictHandler
 

Functions

bool DatabaseConflictHandlerCallback (void *ctxt, const char **keys, BNAnalysisMergeConflict **conflicts, size_t count)
 
bool TypeArchiveConflictHandlerCallback (void *ctxt, BNTypeArchiveMergeConflict **conflicts, size_t count)
 
bool NameChangesetCallback (void *ctxt, BNCollaborationChangeset *changeset)
 
template<>
std::any AnalysisMergeConflict::GetPathItem< std::any > (const std::string &path)
 
template<>
std::string AnalysisMergeConflict::GetPathItem< std::string > (const std::string &path)
 
template<>
nlohmann::json AnalysisMergeConflict::GetPathItem< nlohmann::json > (const std::string &path)
 
Ref< RemoteGetActiveRemote ()
 
void SetActiveRemote (Ref< Remote > remote)
 
bool StoreDataInKeychain (const std::string &key, const std::map< std::string, std::string > &data)
 
bool HasDataInKeychain (const std::string &key)
 
std::optional< std::map< std::string, std::string > > GetDataFromKeychain (const std::string &key)
 
bool DeleteDataFromKeychain (const std::string &key)
 
void LoadRemotes ()
 
std::vector< Ref< Remote > > GetRemotes ()
 
Ref< RemoteGetRemoteById (const std::string &remoteId)
 
Ref< RemoteGetRemoteByAddress (const std::string &remoteAddress)
 
Ref< RemoteGetRemoteByName (const std::string &name)
 
Ref< RemoteCreateRemote (const std::string &name, const std::string &address)
 
void RemoveRemote (const Ref< Remote > &remote)
 
void SyncDatabase (Ref< Database > database, Ref< RemoteFile > file, AnalysisConflictHandler conflictHandler, std::function< bool(size_t, size_t)> progress={}, NameChangesetFunction nameChangeset=[](Ref< CollabChangeset >){ return true;})
 Completely sync a database, pushing/pulling/merging/applying changes. More...
 
void SyncTypeArchive (Ref< TypeArchive > archive, Ref< RemoteFile > file, TypeArchiveConflictHandler conflictHandler, ProgressFunction progress={})
 Completely sync a type archive, pushing/pulling/merging/applying changes. More...
 
Ref< SnapshotMergeSnapshots (Ref< Snapshot > first, Ref< Snapshot > second, AnalysisConflictHandler conflictHandler, ProgressFunction progress)
 Merge a pair of snapshots and create a new snapshot with the result. More...
 
std::string DefaultProjectPath (Ref< RemoteProject > project)
 Get the default directory path for a remote Project. More...
 
std::string DefaultFilePath (Ref< RemoteFile > file)
 Get the default filepath for a remote File. More...
 
Ref< FileMetadataDownloadFile (Ref< RemoteFile > file, const std::string &dbPath, ProgressFunction progress={})
 Download a file from its remote, saving all snapshots to a database in the specified location. More...
 
void AssignSnapshotMap (Ref< Snapshot > localSnapshot, Ref< CollabSnapshot > remoteSnapshot)
 Add a snapshot to the id map in a database. More...
 
Ref< RemoteFileUploadDatabase (Ref< FileMetadata > metadata, Ref< RemoteProject > project, Ref< RemoteFolder > folder, ProgressFunction progress, NameChangesetFunction nameChangeset={})
 Upload a file, with database, to the remote under the given project. More...
 
std::optional< std::string > GetSnapshotAuthor (Ref< Database > database, Ref< Snapshot > snapshot)
 Get the remote author of a local snapshot. More...
 
bool IsCollaborationDatabase (Ref< Database > database)
 Test if a database is valid for use in collaboration. More...
 
Ref< RemoteGetRemoteForLocalDatabase (Ref< Database > database)
 Get the Remote for a Database. More...
 
Ref< RemoteProjectGetRemoteProjectForLocalDatabase (Ref< Database > database)
 Get the Remote Project for a Database. More...
 
Ref< RemoteFileGetRemoteFileForLocalDatabase (Ref< Database > database)
 Get the Remote File for a Database. More...
 
size_t PullDatabase (Ref< Database > database, Ref< RemoteFile > file, AnalysisConflictHandler conflictHandler, ProgressFunction progress={}, NameChangesetFunction nameChangeset={})
 Pull updated snapshots from the remote. More...
 
void MergeDatabase (Ref< Database > database, AnalysisConflictHandler conflictHandler, ProgressFunction progress={})
 Merge all leaf snapshots in a database down to a single leaf snapshot. More...
 
size_t PushDatabase (Ref< Database > database, Ref< RemoteFile > file, ProgressFunction progress={})
 Push locally added snapshots to the remote. More...
 
void DumpDatabase (Ref< Database > database)
 Print debug information about a database to stdout. More...
 
void IgnoreSnapshot (Ref< Database > database, Ref< Snapshot > snapshot)
 Ignore a snapshot from database syncing operations TODO: This is in place of deleting differential snapshots (which is unimplemented) More...
 
bool IsSnapshotIgnored (Ref< Database > database, Ref< Snapshot > snapshot)
 Test if a snapshot is ignored from the database TODO: This is in place of deleting differential snapshots (which is unimplemented) More...
 
Ref< CollabSnapshotGetRemoteSnapshotFromLocal (Ref< Snapshot > snapshot)
 Get the remote snapshot associated with a local snapshot (if it exists) More...
 
Ref< SnapshotGetLocalSnapshotFromRemote (Ref< CollabSnapshot > snapshot, Ref< Database > database)
 Get the local snapshot associated with a remote snapshot (if it exists) More...
 
bool IsCollaborationTypeArchive (Ref< TypeArchive > archive)
 Test if a type archive is valid for use in collaboration. More...
 
Ref< RemoteGetRemoteForLocalTypeArchive (Ref< TypeArchive > archive)
 Get the Remote for a Type Archive. More...
 
Ref< RemoteProjectGetRemoteProjectForLocalTypeArchive (Ref< TypeArchive > archive)
 Get the Remote Project for a Type Archive. More...
 
Ref< RemoteFileGetRemoteFileForLocalTypeArchive (Ref< TypeArchive > archive)
 Get the Remote File for a Type Archive. More...
 
Ref< CollabSnapshotGetRemoteSnapshotFromLocalTypeArchive (Ref< TypeArchive > archive, const std::string &snapshotId)
 Get the remote snapshot associated with a local snapshot (if it exists) in a Type Archive. More...
 
std::optional< std::string > GetLocalSnapshotFromRemoteTypeArchive (Ref< CollabSnapshot > snapshot, Ref< TypeArchive > archive)
 Get the local snapshot associated with a remote snapshot (if it exists) in a Type Archive. More...
 
bool IsTypeArchiveSnapshotIgnored (Ref< TypeArchive > archive, const std::string &snapshot)
 Test if a snapshot is ignored from the archive. More...
 
Ref< TypeArchiveDownloadTypeArchive (Ref< RemoteFile > file, const std::string &dbPath, ProgressFunction progress={})
 Download a type archive from its remote, saving all snapshots to an archive in the specified location. More...
 
Ref< RemoteFileUploadTypeArchive (Ref< TypeArchive > archive, Ref< RemoteProject > project, Ref< RemoteFolder > folder=nullptr, ProgressFunction progress={}, Ref< ProjectFile > coreFile=nullptr)
 Upload a type archive. More...
 
size_t PushTypeArchive (Ref< TypeArchive > archive, Ref< RemoteFile > file, ProgressFunction progress={})
 Push locally added snapshots to the remote. More...
 
size_t PullTypeArchive (Ref< TypeArchive > archive, Ref< RemoteFile > file, std::function< bool(const std::vector< Ref< TypeArchiveMergeConflict > >)> conflictHandler, ProgressFunction progress={})
 Pull updated snapshots from the remote. More...
 
void DownloadDatabaseForFile (Ref< RemoteFile > file, const std::string &dbPath, bool force, ProgressFunction progress={})
 
void SetSnapshotAuthor (Ref< Database > database, Ref< Snapshot > snapshot, const std::string &author)
 Set the remote author of a local snapshot (does not upload) More...
 

Class Documentation

◆ BinaryNinja::Collaboration::DatabaseConflictHandlerContext

struct BinaryNinja::Collaboration::DatabaseConflictHandlerContext
Class Members
function< bool(const unordered_map< string, Ref< AnalysisMergeConflict > >)> callback

◆ BinaryNinja::Collaboration::NameChangesetContext

struct BinaryNinja::Collaboration::NameChangesetContext
Class Members
function< bool(Ref< CollabChangeset >)> callback

◆ BinaryNinja::Collaboration::TypeArchiveConflictHandlerContext

struct BinaryNinja::Collaboration::TypeArchiveConflictHandlerContext
Class Members
function< bool(const vector< Ref< TypeArchiveMergeConflict > >)> callback

Typedef Documentation

◆ NameChangesetFunction

◆ ProgressFunction

typedef std::function<bool(size_t, size_t)> BinaryNinja::Collaboration::ProgressFunction

◆ AnalysisConflictHandler

typedef std::function<bool(const std::unordered_map<std::string, Ref<AnalysisMergeConflict>>& conflicts)> BinaryNinja::Collaboration::AnalysisConflictHandler

◆ TypeArchiveConflictHandler

typedef std::function<bool(const std::vector<Ref<TypeArchiveMergeConflict>>& conflicts)> BinaryNinja::Collaboration::TypeArchiveConflictHandler

Function Documentation

◆ DatabaseConflictHandlerCallback()

bool BinaryNinja::Collaboration::DatabaseConflictHandlerCallback ( void *  ctxt,
const char **  keys,
BNAnalysisMergeConflict **  conflicts,
size_t  count 
)

◆ TypeArchiveConflictHandlerCallback()

bool BinaryNinja::Collaboration::TypeArchiveConflictHandlerCallback ( void *  ctxt,
BNTypeArchiveMergeConflict **  conflicts,
size_t  count 
)

◆ NameChangesetCallback()

bool BinaryNinja::Collaboration::NameChangesetCallback ( void *  ctxt,
BNCollaborationChangeset changeset 
)

◆ AnalysisMergeConflict::GetPathItem< std::any >()

template<>
std::any BinaryNinja::Collaboration::AnalysisMergeConflict::GetPathItem< std::any > ( const std::string &  path)

◆ AnalysisMergeConflict::GetPathItem< std::string >()

template<>
std::string BinaryNinja::Collaboration::AnalysisMergeConflict::GetPathItem< std::string > ( const std::string &  path)

◆ AnalysisMergeConflict::GetPathItem< nlohmann::json >()

template<>
nlohmann::json BinaryNinja::Collaboration::AnalysisMergeConflict::GetPathItem< nlohmann::json > ( const std::string &  path)

◆ GetActiveRemote()

Ref< Remote > BinaryNinja::Collaboration::GetActiveRemote ( )

◆ SetActiveRemote()

void BinaryNinja::Collaboration::SetActiveRemote ( Ref< Remote remote)

◆ StoreDataInKeychain()

bool BinaryNinja::Collaboration::StoreDataInKeychain ( const std::string &  key,
const std::map< std::string, std::string > &  data 
)

◆ HasDataInKeychain()

bool BinaryNinja::Collaboration::HasDataInKeychain ( const std::string &  key)

◆ GetDataFromKeychain()

std::optional< std::map< std::string, std::string > > BinaryNinja::Collaboration::GetDataFromKeychain ( const std::string &  key)

◆ DeleteDataFromKeychain()

bool BinaryNinja::Collaboration::DeleteDataFromKeychain ( const std::string &  key)

◆ LoadRemotes()

void BinaryNinja::Collaboration::LoadRemotes ( )

◆ GetRemotes()

std::vector< Ref< Remote > > BinaryNinja::Collaboration::GetRemotes ( )

◆ GetRemoteById()

Ref< Remote > BinaryNinja::Collaboration::GetRemoteById ( const std::string &  remoteId)

◆ GetRemoteByAddress()

Ref< Remote > BinaryNinja::Collaboration::GetRemoteByAddress ( const std::string &  remoteAddress)

◆ GetRemoteByName()

Ref< Remote > BinaryNinja::Collaboration::GetRemoteByName ( const std::string &  name)

◆ CreateRemote()

Ref< Remote > BinaryNinja::Collaboration::CreateRemote ( const std::string &  name,
const std::string &  address 
)

◆ RemoveRemote()

void BinaryNinja::Collaboration::RemoveRemote ( const Ref< Remote > &  remote)

◆ SyncDatabase()

void BinaryNinja::Collaboration::SyncDatabase ( Ref< Database database,
Ref< RemoteFile file,
AnalysisConflictHandler  conflictHandler,
std::function< bool(size_t, size_t)>  progress = {},
NameChangesetFunction  nameChangeset = [](RefCollabChangeset >){ return true;} 
)

Completely sync a database, pushing/pulling/merging/applying changes.

Parameters
databaseDatabase to sync
fileRemote File to sync with
conflictHandlerFunction to call to resolve snapshot conflicts
progressFunction to call for progress updates
nameChangesetFunction to call for naming a pushed changeset, if necessary
Exceptions
SyncExceptionIf there is an error syncing

◆ SyncTypeArchive()

void BinaryNinja::Collaboration::SyncTypeArchive ( Ref< TypeArchive archive,
Ref< RemoteFile file,
TypeArchiveConflictHandler  conflictHandler,
ProgressFunction  progress = {} 
)

Completely sync a type archive, pushing/pulling/merging/applying changes.

Parameters
archiveType archive
fileRemote file
progressFunction to call for progress updates

◆ MergeSnapshots()

Ref< Snapshot > BinaryNinja::Collaboration::MergeSnapshots ( Ref< Snapshot first,
Ref< Snapshot second,
AnalysisConflictHandler  conflictHandler,
ProgressFunction  progress 
)

Merge a pair of snapshots and create a new snapshot with the result.

Parameters
firstFirst snapshot to merge
secondSecond snapshot to merge
conflictHandlerFunction to call when merge conflicts are encountered
progressFunction to call for progress updates and cancelling
Exceptions
SyncExceptionIf the snapshots have no common ancestor
Returns
Result snapshot

◆ DefaultProjectPath()

std::string BinaryNinja::Collaboration::DefaultProjectPath ( Ref< RemoteProject project)

Get the default directory path for a remote Project.

This is based off the Setting for collaboration.directory, the project's id, and the project's remote's id.

Parameters
projectRemote Project
Returns
Default project path

◆ DefaultFilePath()

std::string BinaryNinja::Collaboration::DefaultFilePath ( Ref< RemoteFile file)

Get the default filepath for a remote File.

This is based off the Setting for collaboration.directory, the file's id, the file's project's id, and the file's remote's id.

Parameters
fileRemote File
Returns
Default file path

◆ DownloadFile()

Ref< FileMetadata > BinaryNinja::Collaboration::DownloadFile ( Ref< RemoteFile file,
const std::string &  dbPath,
ProgressFunction  progress = {} 
)

Download a file from its remote, saving all snapshots to a database in the specified location.

Returns a FileContext for opening the file later.

Parameters
fileRemote File to download and open
dbPathFile path for saved database
progressFunction to call for progress updates
Returns
FileContext for opening
Exceptions
SyncExceptionIf there was an error downloading

◆ AssignSnapshotMap()

void BinaryNinja::Collaboration::AssignSnapshotMap ( Ref< Snapshot localSnapshot,
Ref< CollabSnapshot remoteSnapshot 
)

Add a snapshot to the id map in a database.

Parameters
localSnapshotLocal snapshot, will use this snapshot's database
remoteSnapshotRemote snapshot

◆ UploadDatabase()

Ref< RemoteFile > BinaryNinja::Collaboration::UploadDatabase ( Ref< FileMetadata metadata,
Ref< RemoteProject project,
Ref< RemoteFolder folder,
ProgressFunction  progress,
NameChangesetFunction  nameChangeset = {} 
)

Upload a file, with database, to the remote under the given project.

Parameters
metadataLocal file with database
projectRemote project under which to place the new file
progressFunction to call for progress updates
nameChangesetFunction to call for naming a pushed changeset, if necessary
folderIdId of folder that will contain the resulting file
Returns
Remote File created
Exceptions
SyncExceptionIf there was an error uploading

◆ GetSnapshotAuthor()

std::optional< std::string > BinaryNinja::Collaboration::GetSnapshotAuthor ( Ref< Database database,
Ref< Snapshot snapshot 
)

Get the remote author of a local snapshot.

Parameters
databaseParent database
snapshotSnapshot to query

◆ IsCollaborationDatabase()

bool BinaryNinja::Collaboration::IsCollaborationDatabase ( Ref< Database database)

Test if a database is valid for use in collaboration.

Parameters
databaseDatabase
Returns
True if database is valid

◆ GetRemoteForLocalDatabase()

Ref< Remote > BinaryNinja::Collaboration::GetRemoteForLocalDatabase ( Ref< Database database)

Get the Remote for a Database.

Parameters
databaseBN database, potentially with collaboration metadata
Returns
Remote from one of the connected remotes, or nullptr if not found

◆ GetRemoteProjectForLocalDatabase()

Ref< RemoteProject > BinaryNinja::Collaboration::GetRemoteProjectForLocalDatabase ( Ref< Database database)

Get the Remote Project for a Database.

Parameters
databaseBN database, potentially with collaboration metadata
Returns
Remote project from one of the connected remotes, or nullptr if not found or if projects are not pulled

◆ GetRemoteFileForLocalDatabase()

Ref< RemoteFile > BinaryNinja::Collaboration::GetRemoteFileForLocalDatabase ( Ref< Database database)

Get the Remote File for a Database.

Parameters
databaseBN database, potentially with collaboration metadata
Returns
Remote file from one of the connected remotes, or nullptr if not found or if files are not pulled

◆ PullDatabase()

size_t BinaryNinja::Collaboration::PullDatabase ( Ref< Database database,
Ref< RemoteFile file,
AnalysisConflictHandler  conflictHandler,
ProgressFunction  progress = {},
NameChangesetFunction  nameChangeset = {} 
)

Pull updated snapshots from the remote.

Merge local changes with remote changes and potentially create a new snapshot for unsaved changes, named via nameChangeset.

Parameters
databaseDatabase to pull
fileRemote File to pull to
conflictHandlerFunction to call to resolve snapshot conflicts
progressFunction to call for progress updates
nameChangesetFunction to call for naming a pushed changeset, if necessary
Returns
Number of snapshots pulled
Exceptions
SyncExceptionIf there is an error pulling

◆ MergeDatabase()

void BinaryNinja::Collaboration::MergeDatabase ( Ref< Database database,
AnalysisConflictHandler  conflictHandler,
ProgressFunction  progress = {} 
)

Merge all leaf snapshots in a database down to a single leaf snapshot.

Parameters
databaseDatabase to merge
progressFunction to call for progress updates
conflictHandlerFunction to call to resolve snapshot conflicts
Exceptions
SyncExceptionIf there was an error merging

◆ PushDatabase()

size_t BinaryNinja::Collaboration::PushDatabase ( Ref< Database database,
Ref< RemoteFile file,
ProgressFunction  progress = {} 
)

Push locally added snapshots to the remote.

Parameters
databaseDatabase to push
fileRemote File to push to
progressFunction to call for progress updates
Returns
Number of snapshots pushed
Exceptions
SyncExceptionIf there is an error pushing

◆ DumpDatabase()

void BinaryNinja::Collaboration::DumpDatabase ( Ref< Database database)

Print debug information about a database to stdout.

Parameters
databaseDatabase to dump

◆ IgnoreSnapshot()

void BinaryNinja::Collaboration::IgnoreSnapshot ( Ref< Database database,
Ref< Snapshot snapshot 
)

Ignore a snapshot from database syncing operations TODO: This is in place of deleting differential snapshots (which is unimplemented)

Parameters
databaseParent database
snapshotSnapshot to ignore

◆ IsSnapshotIgnored()

bool BinaryNinja::Collaboration::IsSnapshotIgnored ( Ref< Database database,
Ref< Snapshot snapshot 
)

Test if a snapshot is ignored from the database TODO: This is in place of deleting differential snapshots (which is unimplemented)

Parameters
databaseParent database
snapshotSnapshot to test
Returns
True if snapshot should be ignored

◆ GetRemoteSnapshotFromLocal()

Ref< CollabSnapshot > BinaryNinja::Collaboration::GetRemoteSnapshotFromLocal ( Ref< Snapshot snapshot)

Get the remote snapshot associated with a local snapshot (if it exists)

Parameters
snapshotLocal snapshot
Returns
Remote snapshot if it exists, or nullptr if not

◆ GetLocalSnapshotFromRemote()

Ref< Snapshot > BinaryNinja::Collaboration::GetLocalSnapshotFromRemote ( Ref< CollabSnapshot snapshot,
Ref< Database database 
)

Get the local snapshot associated with a remote snapshot (if it exists)

Parameters
snapshotRemote snapshot
databaseLocal database to search
Returns
Snapshot reference if it exists, or nullptr reference if not

◆ IsCollaborationTypeArchive()

bool BinaryNinja::Collaboration::IsCollaborationTypeArchive ( Ref< TypeArchive archive)

Test if a type archive is valid for use in collaboration.

Parameters
archiveType archive
Returns
True if archive is valid

◆ GetRemoteForLocalTypeArchive()

Ref< Remote > BinaryNinja::Collaboration::GetRemoteForLocalTypeArchive ( Ref< TypeArchive archive)

Get the Remote for a Type Archive.

Parameters
archiveLocal Type Archive, potentially with collaboration metadata
Returns
Remote from one of the connected remotes, or nullptr if not found

◆ GetRemoteProjectForLocalTypeArchive()

Ref< RemoteProject > BinaryNinja::Collaboration::GetRemoteProjectForLocalTypeArchive ( Ref< TypeArchive archive)

Get the Remote Project for a Type Archive.

Parameters
archiveLocal Type Archive, potentially with collaboration metadata
Returns
Remote project from one of the connected remotes, or nullptr if not found or if projects are not pulled

◆ GetRemoteFileForLocalTypeArchive()

Ref< RemoteFile > BinaryNinja::Collaboration::GetRemoteFileForLocalTypeArchive ( Ref< TypeArchive archive)

Get the Remote File for a Type Archive.

Parameters
archiveLocal Type Archive, potentially with collaboration metadata
Returns
Remote file from one of the connected remotes, or nullptr if not found or if files are not pulled

◆ GetRemoteSnapshotFromLocalTypeArchive()

Ref< CollabSnapshot > BinaryNinja::Collaboration::GetRemoteSnapshotFromLocalTypeArchive ( Ref< TypeArchive archive,
const std::string &  snapshotId 
)

Get the remote snapshot associated with a local snapshot (if it exists) in a Type Archive.

Parameters
archiveLocal Type Archive
snapshotIdLocal snapshot id
Returns
Remote snapshot if it exists, or nullptr if not

◆ GetLocalSnapshotFromRemoteTypeArchive()

std::optional< std::string > BinaryNinja::Collaboration::GetLocalSnapshotFromRemoteTypeArchive ( Ref< CollabSnapshot snapshot,
Ref< TypeArchive archive 
)

Get the local snapshot associated with a remote snapshot (if it exists) in a Type Archive.

Parameters
snapshotRemote snapshot
archiveLocal type archive to search
Returns
Snapshot id if it exists, or nullopt if not

◆ IsTypeArchiveSnapshotIgnored()

bool BinaryNinja::Collaboration::IsTypeArchiveSnapshotIgnored ( Ref< TypeArchive archive,
const std::string &  snapshot 
)

Test if a snapshot is ignored from the archive.

Parameters
archiveType archive
snapshotSnapshot to test
Returns
True if snapshot should be ignored

◆ DownloadTypeArchive()

Ref< TypeArchive > BinaryNinja::Collaboration::DownloadTypeArchive ( Ref< RemoteFile file,
const std::string &  dbPath,
ProgressFunction  progress = {} 
)

Download a type archive from its remote, saving all snapshots to an archive in the specified location.

Returns a Ref<TypeArchive> for using later.

Parameters
fileRemote Type Archive file to download and open
dbPathFile path for saved archive
progressFunction to call for progress updates
Returns
TypeArchive for using
Exceptions
SyncExceptionIf there was an error downloading

◆ UploadTypeArchive()

Ref< RemoteFile > BinaryNinja::Collaboration::UploadTypeArchive ( Ref< TypeArchive archive,
Ref< RemoteProject project,
Ref< RemoteFolder folder = nullptr,
ProgressFunction  progress = {},
Ref< ProjectFile coreFile = nullptr 
)

Upload a type archive.

Parameters
archiveType archive
projectContaining project
folderContaining folder
progressFunction to call for progress updates
coreFileCore ProjectFile structure, if archive is in a project
Returns
Created file

◆ PushTypeArchive()

size_t BinaryNinja::Collaboration::PushTypeArchive ( Ref< TypeArchive archive,
Ref< RemoteFile file,
ProgressFunction  progress = {} 
)

Push locally added snapshots to the remote.

Parameters
archiveType Archive to push
fileRemote File to push to
progressFunction to call for progress updates
Returns
Number of snapshots pushed
Exceptions
SyncExceptionIf there is an error pushing

◆ PullTypeArchive()

size_t BinaryNinja::Collaboration::PullTypeArchive ( Ref< TypeArchive archive,
Ref< RemoteFile file,
std::function< bool(const std::vector< Ref< TypeArchiveMergeConflict > >)>  conflictHandler,
ProgressFunction  progress = {} 
)

Pull updated snapshots from the remote.

Merge local changes with remote changes and potentially create a new snapshot for unsaved changes, named via nameChangeset.

Parameters
archiveType Archive to pull
fileRemote File to pull to
conflictHandlerFunction to call to resolve snapshot conflicts
progressFunction to call for progress updates
nameChangesetFunction to call for naming a pushed changeset, if necessary
Returns
Number of snapshots pulled
Exceptions
SyncExceptionIf there is an error pulling

◆ DownloadDatabaseForFile()

void BinaryNinja::Collaboration::DownloadDatabaseForFile ( Ref< RemoteFile file,
const std::string &  dbPath,
bool  force,
ProgressFunction  progress = {} 
)

◆ SetSnapshotAuthor()

void BinaryNinja::Collaboration::SetSnapshotAuthor ( Ref< Database database,
Ref< Snapshot snapshot,
const std::string &  author 
)

Set the remote author of a local snapshot (does not upload)

Parameters
databaseParent database
snapshotSnapshot to edit
authorTarget author