class ReportStoreMetadata
Defined at line 23 of file ../../src/developer/forensics/crash_reports/report_store_metadata.h
In-memory metadata about the report store in the filesystem at |report_store_root|.
Note: Clients must use Add and Delete to keep the metadata in sync with the report store in the
filesystem. Use with caution!
Public Methods
void ReportStoreMetadata (std::string report_store_root, StorageSize max_size)
Defined at line 20 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
bool IsDirectoryUsable ()
Returns true if the directory underlying the ReportStoreMetadata can safely be used.
Note: Add and Delete will check-fail if this is false as the underlying directory shouldn't be
manipulated.
Defined at line 78 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
bool RecreateFromFilesystem ()
Recreates the metadata from the report store at |report_store_root_|.
Returns false if the |metadata| does not accurately represent the filesystem and the underlying
directory can't safely be used.
Defined at line 28 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
bool Contains (ReportId report_id)
Defined at line 80 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
bool Contains (const std::string & program)
Defined at line 84 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
StorageSize CurrentSize ()
Defined at line 88 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
StorageSize RemainingSpace ()
Defined at line 90 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
const std::string & RootDir ()
Defined at line 92 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
void Add (ReportId report_id, std::string program, std::vector<std::string> attachments, StorageSize size)
Defined at line 94 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
void Delete (ReportId report_id)
Defined at line 109 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
std::vector<std::string> Programs ()
Defined at line 124 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
std::vector<ReportId> Reports ()
Defined at line 133 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
const std::string & ProgramDirectory (const std::string & program)
The directory that contains reports for |program|.
Defined at line 152 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
const std::deque<ReportId> & ProgramReports (const std::string & program)
The ReportIds of all reports filed for |program|.
Defined at line 142 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
const std::string & ReportProgram (ReportId report_id)
The program report |report_id| was filed under.
Defined at line 147 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
const std::string & ReportDirectory (ReportId report_id)
The directory that contains the attachments of report |report_id|.
Defined at line 157 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
StorageSize ReportSize (ReportId report_id)
The size of report |report_id|.
Defined at line 162 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
void IncreaseSize (ReportId report_id, StorageSize additional_size)
Increases the size of report |report_id| by |additional_size|.
Defined at line 167 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
std::vector<std::string> ReportAttachments (ReportId report_id, bool absolute_paths)
The attachments for report |report_id|. If |absolute_paths| is true, the absolute path of the
attachments in the filesystem will be returned otherwise the attachment file names will be
returned.
Defined at line 175 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc
std::optional<std::string> ReportAttachmentPath (ReportId report_id, const std::string & attachment_name)
Returns the absolute path to |attachment_name| for report |report_id|. Returns std::nullopt if
the attachment doesn't exist.
Defined at line 193 of file ../../src/developer/forensics/crash_reports/report_store_metadata.cc