Android-cuttlefish cvd tool
Public Types | Public Member Functions | Static Public Attributes | Private Attributes | List of all members
cuttlefish::StackTraceEntry Class Reference

#include <result.h>

Collaboration diagram for cuttlefish::StackTraceEntry:
Collaboration graph
[legend]

Public Types

enum class  FormatSpecifier : char {
  kArrow = 'a' , kColor = 'c' , kFunction = 'f' , kLongExpression = 'E' ,
  kLongLocation = 'L' , kMessage = 'm' , kNumbers = 'n' , kPrettyFunction = 'F' ,
  kShort = 's' , kShortExpression = 'e' , kShortLocation = 'l'
}
 

Public Member Functions

 StackTraceEntry (std::string file, size_t line, std::string pretty_function, std::string function)
 
 StackTraceEntry (std::string file, size_t line, std::string pretty_function, std::string function, std::string expression)
 
 StackTraceEntry (const StackTraceEntry &other)
 
 StackTraceEntry (StackTraceEntry &&)=default
 
StackTraceEntryoperator= (const StackTraceEntry &other)
 
StackTraceEntryoperator= (StackTraceEntry &&)=default
 
template<typename T >
StackTraceEntryoperator<< (T &&message_ext) &
 
template<typename T >
StackTraceEntry operator<< (T &&message_ext) &&
 
 operator StackTraceError () &&
 
template<typename T >
 operator android::base::expected< T, StackTraceError > () &&
 
bool HasMessage () const
 
fmt::format_context::iterator format (fmt::format_context &ctx, const std::vector< FormatSpecifier > &specifiers, std::optional< int > index) const
 
template<typename T >
 operator android::base::expected< T, StackTraceError > () &&
 

Static Public Attributes

static constexpr auto kVerbose
 
static constexpr auto kVeryVerbose
 

Private Attributes

std::string file_
 
size_t line_
 
std::string pretty_function_
 
std::string function_
 
std::string expression_
 
std::stringstream message_
 

Member Enumeration Documentation

◆ FormatSpecifier

Enumerator
kArrow 

Prefix multi-line output with an arrow.

kColor 

Use colors in all other output specifiers.

kFunction 

The function name without namespace or arguments.

kLongExpression 

The CF_EXPECT(exp) expression.

kLongLocation 

The source file path relative to ANDROID_BUILD_TOP and line number.

kMessage 

The user-friendly string provided to CF_EXPECT.

kNumbers 

Prefix output with the stack frame index.

kPrettyFunction 

The function signature with fully-qualified types.

kShort 

The short location and short filename.

kShortExpression 

The exp inside CF_EXPECT(exp)

kShortLocation 

The source file basename and line number.

Constructor & Destructor Documentation

◆ StackTraceEntry() [1/4]

cuttlefish::StackTraceEntry::StackTraceEntry ( std::string  file,
size_t  line,
std::string  pretty_function,
std::string  function 
)

◆ StackTraceEntry() [2/4]

cuttlefish::StackTraceEntry::StackTraceEntry ( std::string  file,
size_t  line,
std::string  pretty_function,
std::string  function,
std::string  expression 
)

◆ StackTraceEntry() [3/4]

cuttlefish::StackTraceEntry::StackTraceEntry ( const StackTraceEntry other)

◆ StackTraceEntry() [4/4]

cuttlefish::StackTraceEntry::StackTraceEntry ( StackTraceEntry &&  )
default

Member Function Documentation

◆ format()

fmt::format_context::iterator cuttlefish::StackTraceEntry::format ( fmt::format_context &  ctx,
const std::vector< FormatSpecifier > &  specifiers,
std::optional< int >  index 
) const

◆ HasMessage()

bool cuttlefish::StackTraceEntry::HasMessage ( ) const

◆ operator android::base::expected< T, StackTraceError >() [1/2]

template<typename T >
cuttlefish::StackTraceEntry::operator android::base::expected< T, StackTraceError > ( ) &&

◆ operator android::base::expected< T, StackTraceError >() [2/2]

template<typename T >
cuttlefish::StackTraceEntry::operator android::base::expected< T, StackTraceError > ( ) &&
inline

◆ operator StackTraceError()

cuttlefish::StackTraceEntry::operator StackTraceError ( ) &&
inline

◆ operator<<() [1/2]

template<typename T >
StackTraceEntry & cuttlefish::StackTraceEntry::operator<< ( T &&  message_ext) &
inline

◆ operator<<() [2/2]

template<typename T >
StackTraceEntry cuttlefish::StackTraceEntry::operator<< ( T &&  message_ext) &&
inline

◆ operator=() [1/2]

StackTraceEntry & cuttlefish::StackTraceEntry::operator= ( const StackTraceEntry other)

◆ operator=() [2/2]

StackTraceEntry & cuttlefish::StackTraceEntry::operator= ( StackTraceEntry &&  )
default

Member Data Documentation

◆ expression_

std::string cuttlefish::StackTraceEntry::expression_
private

◆ file_

std::string cuttlefish::StackTraceEntry::file_
private

◆ function_

std::string cuttlefish::StackTraceEntry::function_
private

◆ kVerbose

constexpr auto cuttlefish::StackTraceEntry::kVerbose
staticconstexpr

◆ kVeryVerbose

constexpr auto cuttlefish::StackTraceEntry::kVeryVerbose
staticconstexpr

◆ line_

size_t cuttlefish::StackTraceEntry::line_
private

◆ message_

std::stringstream cuttlefish::StackTraceEntry::message_
private

◆ pretty_function_

std::string cuttlefish::StackTraceEntry::pretty_function_
private

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