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,才能使用這個函式。
檔案名稱
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 )
從 shared_ptr
建構 SnapshotMetadata
物件至 SnapshotMetadataImpl
。
適用於 API 的內部使用。
SnapshotMetadata
SnapshotMetadata( const SnapshotMetadata & copy_from )
建立現有 SnapshotMetadata
物件的副本。
有效
bool Valid() const
如果傳回的快照中繼資料已填入資料,並且附上成功的回應狀態,則會傳回 true;未填入使用者建立的快照,或是含有失敗回應狀態的填入快照為「false」。
這個函式必須針對這個快照的 getter 函式 (id
、Name
、Description
等) 傳回 true,才能使用。
operator=
SnapshotMetadata & operator=( const SnapshotMetadata & copy_from )
透過複製另一個物件來指派這個 SnapshotMetadata
物件。
operator=
SnapshotMetadata & operator=( SnapshotMetadata && move_from )
透過移動另一個物件來指派這個SnapshotMetadata
物件。
~SnapshotMetadata
~SnapshotMetadata()