Crashpad
Public Types | Public Member Functions | List of all members
crashpad::StringAnnotation< MaxSize > Class Template Reference

An. More...

#include "client/annotation.h"

Inheritance diagram for crashpad::StringAnnotation< MaxSize >:
crashpad::Annotation

Public Types

enum  Tag
 A constructor tag that enables braced initialization in C arrays. More...
 
- Public Types inherited from crashpad::Annotation
enum  Type : uint16_t
 The type of data stored in the annotation. 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. More...
 
constexpr StringAnnotation (const char name[], Tag tag)
 Constructs a new StringAnnotation with the given name. More...
 
void Set (const char *value)
 Sets the Annotation's string value. More...
 
void Set (base::StringPiece string)
 Sets the Annotation's string value. More...
 
const base::StringPiece value () const
 
- Public Member Functions inherited from crashpad::Annotation
constexpr Annotation (Type type, const char name[], void *const value_ptr)
 Constructs a new annotation. More...
 
void SetSize (ValueSizeType size)
 Specifies the number of bytes in value_ptr_ to include when generating a crash report. More...
 
void Clear ()
 Marks the annotation as cleared, indicating the value_ptr_ should not be included in a crash report. More...
 
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
 

Additional Inherited Members

- Static Public Member Functions inherited from crashpad::Annotation
constexpr static Type UserDefinedType (uint16_t value)
 Creates a user-defined Annotation::Type. More...
 
- Static Public Attributes inherited from crashpad::Annotation
static constexpr size_t kNameMaxLength = 64
 The maximum length of an annotation’s name, in bytes.
 
static constexpr size_t kValueMaxSize = 5 * 4096
 The maximum size of an annotation’s value, in bytes.
 
- Protected Member Functions inherited from crashpad::Annotation
std::atomic< Annotation * > & link_node ()
 

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 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>
constexpr 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>
constexpr 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:

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:
crashpad::StringAnnotation
An.
Definition: annotation.h:197