Public Member Functions | |
RemoteFile (BNRemoteFile *remoteFile) | |
Ref< ProjectFile > | GetCoreFile () |
Ref< RemoteProject > | GetProject () |
Ref< RemoteFolder > | GetFolder () |
Ref< Remote > | GetRemote () |
std::string | GetUrl () |
std::string | GetChatLogUrl () |
std::string | GetUserPositionsUrl () |
std::string | GetId () |
BNRemoteFileType | GetType () |
int64_t | GetCreated () |
std::string | GetCreatedBy () |
int64_t | GetLastModified () |
int64_t | GetLastSnapshot () |
std::string | GetLastSnapshotBy () |
std::string | GetLastSnapshotName () |
std::string | GetHash () |
std::string | GetName () |
std::string | GetDescription () |
std::string | GetMetadata () |
uint64_t | GetSize () |
bool | HasPulledSnapshots () |
void | SetName (const std::string &name) |
void | SetDescription (const std::string &description) |
void | SetFolder (const Ref< RemoteFolder > &folder) |
void | SetMetadata (const std::string &metadata) |
std::vector< Ref< CollabSnapshot > > | GetSnapshots () |
Get all snapshots in the file. | |
Ref< CollabSnapshot > | GetSnapshotById (const std::string &id) |
Get a snapshot in the file by its id. | |
void | PullSnapshots (std::function< bool(size_t, size_t)> progress={}) |
Pull list of snapshots from the remote. | |
Ref< CollabSnapshot > | CreateSnapshot (std::string name, std::vector< uint8_t > contents, std::vector< uint8_t > analysisCacheContents, std::optional< std::vector< uint8_t > > fileContents, std::vector< std::string > parentIds, std::function< bool(size_t, size_t)> progress={}) |
Create a new snapshot on the remote (and pull it) | |
void | DeleteSnapshot (const Ref< CollabSnapshot > snapshot) |
Delete a snapshot from the remote. | |
std::vector< uint8_t > | Download (std::function< bool(size_t, size_t)> progress={}) |
Download the contents of a remote file. | |
Json::Value | RequestUserPositions () |
Get the current user positions for this file. | |
Json::Value | RequestChatLog () |
Get the current chat log for this file. | |
Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNRemoteFile, BNNewRemoteFileReference, BNFreeRemoteFile > | |
CoreRefCountObject () | |
virtual | ~CoreRefCountObject () |
BNRemoteFile * | GetObject () const |
void | AddRef () |
void | Release () |
void | AddRefForRegistration () |
void | ReleaseForRegistration () |
void | AddRefForCallback () |
void | ReleaseForCallback () |
Additional Inherited Members | |
Static Public Member Functions inherited from BinaryNinja::CoreRefCountObject< BNRemoteFile, BNNewRemoteFileReference, BNFreeRemoteFile > | |
static BNRemoteFile * | GetObject (CoreRefCountObject *obj) |
static BNRemoteFile * | GetObject (const CoreRefCountObject *obj) |
Public Attributes inherited from BinaryNinja::CoreRefCountObject< BNRemoteFile, BNNewRemoteFileReference, BNFreeRemoteFile > | |
std::atomic< int > | m_refs |
bool | m_registeredRef |
BNRemoteFile * | m_object |
RemoteFile::RemoteFile | ( | BNRemoteFile * | remoteFile | ) |
Ref< ProjectFile > RemoteFile::GetCoreFile | ( | ) |
Ref< RemoteProject > RemoteFile::GetProject | ( | ) |
Ref< RemoteFolder > RemoteFile::GetFolder | ( | ) |
std::string RemoteFile::GetUrl | ( | ) |
std::string RemoteFile::GetChatLogUrl | ( | ) |
std::string RemoteFile::GetUserPositionsUrl | ( | ) |
std::string RemoteFile::GetId | ( | ) |
BNRemoteFileType RemoteFile::GetType | ( | ) |
int64_t RemoteFile::GetCreated | ( | ) |
std::string RemoteFile::GetCreatedBy | ( | ) |
int64_t RemoteFile::GetLastModified | ( | ) |
int64_t RemoteFile::GetLastSnapshot | ( | ) |
std::string RemoteFile::GetLastSnapshotBy | ( | ) |
std::string RemoteFile::GetLastSnapshotName | ( | ) |
std::string RemoteFile::GetHash | ( | ) |
std::string RemoteFile::GetName | ( | ) |
std::string RemoteFile::GetDescription | ( | ) |
std::string RemoteFile::GetMetadata | ( | ) |
uint64_t RemoteFile::GetSize | ( | ) |
bool RemoteFile::HasPulledSnapshots | ( | ) |
void RemoteFile::SetName | ( | const std::string & | name | ) |
void RemoteFile::SetDescription | ( | const std::string & | description | ) |
void RemoteFile::SetFolder | ( | const Ref< RemoteFolder > & | folder | ) |
void RemoteFile::SetMetadata | ( | const std::string & | metadata | ) |
std::vector< Ref< CollabSnapshot > > RemoteFile::GetSnapshots | ( | ) |
Get all snapshots in the file.
RemoteException | if snapshots have not been pulled or if the remote is not connected |
Ref< CollabSnapshot > RemoteFile::GetSnapshotById | ( | const std::string & | id | ) |
Get a snapshot in the file by its id.
id | CollabSnapshot's id |
RemoteException | If snapshots have not been pulled or if the remote is not connected |
void RemoteFile::PullSnapshots | ( | std::function< bool(size_t, size_t)> | progress = {} | ) |
Pull list of snapshots from the remote.
Necessary before calling GetSnapshots()
progress | Function to call on progress updates |
RemoteException | If there is an error in any request or if the remote is not connected |
Ref< CollabSnapshot > RemoteFile::CreateSnapshot | ( | std::string | name, |
std::vector< uint8_t > | contents, | ||
std::vector< uint8_t > | analysisCacheContents, | ||
std::optional< std::vector< uint8_t > > | fileContents, | ||
std::vector< std::string > | parentIds, | ||
std::function< bool(size_t, size_t)> | progress = {} ) |
Create a new snapshot on the remote (and pull it)
name | CollabSnapshot name |
parentIds | List of ids of parent snapshots (or empty if this is a root snapshot) |
contents | CollabSnapshot contents |
analysisCacheContents | Analysis cache contents |
fileContents | New file contents (if contents changed) |
progress | Function to call on progress updates |
RemoteException | If there is an error in any request or if the remote is not connected |
void RemoteFile::DeleteSnapshot | ( | const Ref< CollabSnapshot > | snapshot | ) |
Delete a snapshot from the remote.
snapshot | Pointer to snapshot to delete (will invalidate pointer) |
RemoteException | If there is an error in any request or if the remote is not connected |
std::vector< uint8_t > RemoteFile::Download | ( | std::function< bool(size_t, size_t)> | progress = {} | ) |
Download the contents of a remote file.
progress | Function to call on progress updates |
RemoteException | If there is an error in any request or if the remote is not connected |
Json::Value RemoteFile::RequestUserPositions | ( | ) |
Get the current user positions for this file.
RemoteException | If there is an error in any request or if the remote is not connected |
Json::Value RemoteFile::RequestChatLog | ( | ) |
Get the current chat log for this file.
RemoteException | If there is an error in any request or if the remote is not connected |