Pigweed
C/C++ API Reference
|
Public Member Functions | |
AtomicFileTransferHandler (uint32_t resource_id, std::string_view file_path) | |
AtomicFileTransferHandler (const AtomicFileTransferHandler &rhs)=delete | |
AtomicFileTransferHandler & | operator= (const AtomicFileTransferHandler &)=delete |
Status | PrepareRead () override |
void | FinalizeRead (Status) override |
Status | PrepareWrite () override |
Status | FinalizeWrite (Status) override |
AtomicFileTransferHandler
is intended to be used as a transfer handler for files. It ensures that the target file of the transfer is always in a correct state. In particular, the transfer is first done to a temporary file and once complete, the original targeted file is updated.
|
inline |
[in] | resource_id | An ID for the resource that's being transferred. |
[in] | file_path | The target file to update. |
|
override |
Handler function that is called by the transfer thread after a read transfer completes.
[in] | Status | A pw::Status object provided by the transfer thread indicating whether the transfer succeeded. |
Indicates whether the write transfer was successful.
embed:rst:leading-asterisk * * .. pw-status-codes:: * * OK: The transfer data was successfully written. * *
|
override |
Prepares AtomicFileTransferHandler
for a read transfer.
embed:rst:leading-asterisk * * .. pw-status-codes:: * * OK: ``AtomicFileTransferHandler`` is ready for the transfer. * *
|
override |
Prepares AtomicFileTransferHandler
for a write transfer.
embed:rst:leading-asterisk * * .. pw-status-codes:: * * OK: ``AtomicFileTransferHandler`` is ready for the transfer. * *