gpg:: SnapshotMetadata
#include <snapshot_metadata.h>
單一資料結構,可讓您存取特定快照中繼資料的狀態相關資料。
摘要
與其他值類型不同,SnapshotMetadata
並非嚴格不可變更。SnapshotManager
API 可以「關閉」快照,變更 IsOpen() 方法的結果;這類 API 普遍要求在 IsOpen() 中傳遞的 SnapshotMetadata
。
建構函式和解構函式 |
|
---|---|
SnapshotMetadata()
|
|
SnapshotMetadata(std::shared_ptr< SnapshotMetadataImpl > impl)
|
|
SnapshotMetadata(const SnapshotMetadata & copy_from)
建立現有
SnapshotMetadata 物件的副本。 |
|
SnapshotMetadata(SnapshotMetadata && move_from)
移動現有的
SnapshotMetadata 物件。 |
|
~SnapshotMetadata()
|
公用函式 |
|
---|---|
CoverImageURL() const
|
const std::string &
傳回封面圖片網址。
|
Description() const
|
const std::string &
傳回快照中繼資料的簡要說明。
|
FileName() const
|
const std::string &
傳回快照的檔案名稱和專屬 ID。
|
IsOpen() const
|
bool
如果傳回的快照中繼資料內含相符的檔案資料,則傳回 true。
|
LastModifiedTime() const
|
傳回項目的上次修改時間 (以毫秒為單位,自 Unix 紀元開始算起)。
|
PlayedTime() const
|
傳回與此快照中繼資料相關聯的播放時間。
|
ProgressValue() const
|
int64_t
傳回與此快照中繼資料相關聯的設定進度值。
|
Valid() const
|
bool
如果傳回的快照中繼資料已填入資料且附帶成功的回應狀態,則傳回 true;如果是未填入的使用者建立快照,或是已填入的快照包含失敗的回應狀態,則傳回 false。
|
operator=(const SnapshotMetadata & copy_from)
|
藉由複製其他物件來指派這個
SnapshotMetadata 物件。 |
operator=(SnapshotMetadata && move_from)
|
將其他物件移至該
SnapshotMetadata 物件,即可指派這個物件。 |
公用函式
CoverImageURL
const std::string & CoverImageURL() const
傳回封面圖片網址。
說明
const std::string & Description() const
傳回快照中繼資料的簡要說明。
SnapshotMetadata::Valid()
必須傳回 true,這個函式才能使用。
FileName
const std::string & FileName() const
傳回快照的檔案名稱和專屬 ID。
快照名稱必須介於 1 到 100 個非網址保留字元 (a 至 z、A 至 Z、0 至 9 或「-」、「.」、「_」或「~」符號) 之間。
IsOpen
bool IsOpen() const
如果傳回的快照中繼資料內含相符的檔案資料,則傳回 true。
只有在物件含有檔案資料時,Read
、Commit
和 Resolve
等資料相關作業才能運作。儘管保持不變,這個值會變更為反映快照中繼資料的基礎資料。舉例來說,對作業呼叫 Commit
會導致 IsOpen() 傳回 false;
ProgressValue
int64_t ProgressValue() const
傳回與此快照中繼資料相關聯的設定進度值。
進度值會使用進度值自動解決衝突。
SnapshotMetadata
SnapshotMetadata()
SnapshotMetadata
SnapshotMetadata( std::shared_ptr< SnapshotMetadataImpl > impl )
建構 SnapshotMetadata
物件從 shared_ptr
到 SnapshotMetadataImpl
。
主要供 API 內部使用。
SnapshotMetadata
SnapshotMetadata( const SnapshotMetadata & copy_from )
建立現有 SnapshotMetadata
物件的副本。
有效
bool Valid() const
如果傳回的快照中繼資料已填入資料且附帶成功的回應狀態,則傳回 true;如果是未填入的使用者建立快照,或是已填入的快照包含失敗的回應狀態,則傳回 false。
此函式必須傳回 true,才能使用此快照的 getter 函式 (id
、Name
、Description
等)。
運算子=
SnapshotMetadata & operator=( const SnapshotMetadata & copy_from )
藉由複製其他物件來指派這個 SnapshotMetadata
物件。
運算子=
SnapshotMetadata & operator=( SnapshotMetadata && move_from )
將其他物件移至該 SnapshotMetadata
物件,即可指派這個物件。
~SnapshotMetadata
~SnapshotMetadata()