LLDB mainline
Public Types | Public Member Functions | Protected Attributes | List of all members
lldb_private::SupportFile Class Reference

Wraps either a FileSpec that represents a local file or a source file whose contents is known (for example because it can be reconstructed from debug info), but that hasn't been written to a file yet. More...

#include <SupportFile.h>

Public Types

enum  SupportFileEquality : uint8_t {
  eEqualFileSpec = (1u << 1) , eEqualChecksum = (1u << 2) , eEqualChecksumIfSet = (1u << 3) , eEqualFileSpecAndChecksum = eEqualFileSpec | eEqualChecksum ,
  eEqualFileSpecAndChecksumIfSet = eEqualFileSpec | eEqualChecksumIfSet
}
 

Public Member Functions

 SupportFile ()
 
 SupportFile (const FileSpec &spec)
 
 SupportFile (const FileSpec &spec, const Checksum &checksum)
 
 SupportFile (const SupportFile &other)=delete
 
 SupportFile (SupportFile &&other)=default
 
virtual ~SupportFile ()=default
 
bool Equal (const SupportFile &other, SupportFileEquality equality=eEqualFileSpecAndChecksum) const
 
const FileSpecGetSpecOnly () const
 Return the file name only. Useful for resolving breakpoints by file name.
 
const ChecksumGetChecksum () const
 Return the checksum or all zeros if there is none.
 
virtual const FileSpecMaterialize ()
 Materialize the file to disk and return the path to that temporary file.
 

Protected Attributes

FileSpec m_file_spec
 
Checksum m_checksum
 

Detailed Description

Wraps either a FileSpec that represents a local file or a source file whose contents is known (for example because it can be reconstructed from debug info), but that hasn't been written to a file yet.

This also stores an optional checksum of the on-disk content.

Definition at line 21 of file SupportFile.h.

Member Enumeration Documentation

◆ SupportFileEquality

Enumerator
eEqualFileSpec 
eEqualChecksum 
eEqualChecksumIfSet 
eEqualFileSpecAndChecksum 
eEqualFileSpecAndChecksumIfSet 

Definition at line 33 of file SupportFile.h.

Constructor & Destructor Documentation

◆ SupportFile() [1/5]

lldb_private::SupportFile::SupportFile ( )
inline

Definition at line 23 of file SupportFile.h.

◆ SupportFile() [2/5]

lldb_private::SupportFile::SupportFile ( const FileSpec spec)
inline

Definition at line 24 of file SupportFile.h.

◆ SupportFile() [3/5]

lldb_private::SupportFile::SupportFile ( const FileSpec spec,
const Checksum checksum 
)
inline

Definition at line 25 of file SupportFile.h.

◆ SupportFile() [4/5]

lldb_private::SupportFile::SupportFile ( const SupportFile other)
delete

◆ SupportFile() [5/5]

lldb_private::SupportFile::SupportFile ( SupportFile &&  other)
default

◆ ~SupportFile()

virtual lldb_private::SupportFile::~SupportFile ( )
virtualdefault

Member Function Documentation

◆ Equal()

bool lldb_private::SupportFile::Equal ( const SupportFile other,
SupportFileEquality  equality = eEqualFileSpecAndChecksum 
) const
inline

Definition at line 41 of file SupportFile.h.

References eEqualChecksum, eEqualChecksumIfSet, eEqualFileSpec, m_checksum, and m_file_spec.

◆ GetChecksum()

const Checksum & lldb_private::SupportFile::GetChecksum ( ) const
inline

Return the checksum or all zeros if there is none.

Definition at line 69 of file SupportFile.h.

References m_checksum.

◆ GetSpecOnly()

const FileSpec & lldb_private::SupportFile::GetSpecOnly ( ) const
inline

Return the file name only. Useful for resolving breakpoints by file name.

Definition at line 66 of file SupportFile.h.

References m_file_spec.

◆ Materialize()

virtual const FileSpec & lldb_private::SupportFile::Materialize ( )
inlinevirtual

Materialize the file to disk and return the path to that temporary file.

Definition at line 72 of file SupportFile.h.

References m_file_spec.

Member Data Documentation

◆ m_checksum

Checksum lldb_private::SupportFile::m_checksum
protected

Definition at line 76 of file SupportFile.h.

Referenced by Equal(), and GetChecksum().

◆ m_file_spec

FileSpec lldb_private::SupportFile::m_file_spec
protected

Definition at line 75 of file SupportFile.h.

Referenced by Equal(), GetSpecOnly(), and Materialize().


The documentation for this class was generated from the following file: