Crashpad
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Loading...
Searching...
No Matches
crashpad::StringAnnotation< MaxSize > Class Template Reference

An. More...

#include "client/annotation.h"

Inheritance diagram for crashpad::StringAnnotation< MaxSize >:
[legend]
Collaboration diagram for crashpad::StringAnnotation< MaxSize >:
[legend]

Public Types

enum class  Tag
 A constructor tag that enables braced initialization in C arrays. More...
 
- Public Types inherited from crashpad::Annotation
enum class  Type : uint16_t
 The type of data stored in the annotation. More...
 
enum class  ConcurrentAccessGuardMode : bool
 Mode used to guard concurrent reads from writes. More...
 
using ValueSizeType = uint32_t
 The type used for SetSize().
 

Public Member Functions

constexpr StringAnnotation (const char name[])
 Constructs a new StringAnnotation with the given name.
 
 StringAnnotation (const StringAnnotation &)=delete
 
StringAnnotationoperator= (const StringAnnotation &)=delete
 
constexpr StringAnnotation (const char name[], Tag tag)
 Constructs a new StringAnnotation with the given name.
 
void Set (const char *value)
 Sets the Annotation's string value.
 
void Set (base::StringPiece string)
 Sets the Annotation's string value.
 
const base::StringPiece value () const
 
- Public Member Functions inherited from crashpad::Annotation
constexpr Annotation (Type type, const char name[], void *value_ptr)
 Constructs a new annotation.
 
 Annotation (const Annotation &)=delete
 
Annotationoperator= (const Annotation &)=delete
 
void SetSize (ValueSizeType size)
 Specifies the number of bytes in value_ptr_ to include when generating a crash report.
 
void Clear ()
 Marks the annotation as cleared, indicating the value_ptr_ should not be included in a crash report.
 
bool is_set () const
 Tests whether the annotation has been set.
 
Type type () const
 
ValueSizeType size () const
 
const char * name () const
 
const void * value () const
 
ConcurrentAccessGuardMode concurrent_access_guard_mode () const
 
std::optional< ScopedSpinGuardTryCreateScopedSpinGuard (uint64_t timeout_ns)
 If this Annotation guards concurrent access using ScopedSpinGuard, tries to obtain the spin guard and returns the result.
 

Additional Inherited Members

- Static Public Member Functions inherited from crashpad::Annotation
static constexpr Type UserDefinedType (uint16_t value)
 Creates a user-defined Annotation::Type.
 
- Static Public Attributes inherited from crashpad::Annotation
static constexpr size_t kNameMaxLength = 256
 The maximum length of an annotation’s name, in bytes. Matches the behavior of Breakpad's SimpleStringDictionary.
 
static constexpr size_t kValueMaxSize = 5 * 4096
 The maximum size of an annotation’s value, in bytes.
 
- Protected Member Functions inherited from crashpad::Annotation
constexpr Annotation (Type type, const char name[], void *value_ptr, ConcurrentAccessGuardMode concurrent_access_guard_mode)
 Constructs a new annotation.
 
std::atomic< Annotation * > & link_node ()
 
AnnotationGetLinkNode (std::memory_order order=std::memory_order_seq_cst)
 
const AnnotationGetLinkNode (std::memory_order order=std::memory_order_seq_cst) const
 

Detailed Description

template<Annotation::ValueSizeType MaxSize>
class crashpad::StringAnnotation< MaxSize >

An.

See also
Annotation that stores a NUL-terminated C-string value.

The storage for the value is allocated by the annotation and the template parameter MaxSize controls the maxmium length for the value.

It is expected that the string value be valid UTF-8, although this is not validated.

Member Enumeration Documentation

◆ Tag

template<Annotation::ValueSizeType MaxSize>
enum class crashpad::StringAnnotation::Tag
strong

A constructor tag that enables braced initialization in C arrays.

See also
StringAnnotation()

Constructor & Destructor Documentation

◆ StringAnnotation() [1/2]

template<Annotation::ValueSizeType MaxSize>
crashpad::StringAnnotation< MaxSize >::StringAnnotation ( const char name[])
inlineexplicitconstexpr

Constructs a new StringAnnotation with the given name.

Parameters
[in]nameThe Annotation name.

◆ StringAnnotation() [2/2]

template<Annotation::ValueSizeType MaxSize>
crashpad::StringAnnotation< MaxSize >::StringAnnotation ( const char name[],
Tag tag )
inlineconstexpr

Constructs a new StringAnnotation with the given name.

This constructor takes the ArrayInitializerTag for use when initializing a C array of annotations. The main constructor is explicit and cannot be brace-initialized. As an example:

static crashpad::StringAnnotation<32> annotations[] = {
{"name-1", crashpad::StringAnnotation<32>::Tag::kArray},
{"name-2", crashpad::StringAnnotation<32>::Tag::kArray},
{"name-3", crashpad::StringAnnotation<32>::Tag::kArray},
};
An.
Definition annotation.h:284
Parameters
[in]nameThe Annotation name.
[in]tagA constructor tag.

Member Function Documentation

◆ Set() [1/2]

template<Annotation::ValueSizeType MaxSize>
void crashpad::StringAnnotation< MaxSize >::Set ( base::StringPiece string)
inline

Sets the Annotation's string value.

Parameters
[in]stringThe string value.

◆ Set() [2/2]

template<Annotation::ValueSizeType MaxSize>
void crashpad::StringAnnotation< MaxSize >::Set ( const char * value)
inline

Sets the Annotation's string value.

Parameters
[in]valueThe NUL-terminated C-string value.

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