annotation_snapshot.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. // Copyright 2017 The Crashpad Authors. All rights reserved.
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. #ifndef CRASHPAD_SNAPSHOT_ANNOTATION_SNAPSHOT_H_
  15. #define CRASHPAD_SNAPSHOT_ANNOTATION_SNAPSHOT_H_
  16. #include <stdint.h>
  17. #include <string>
  18. #include <vector>
  19. namespace crashpad {
  20. // \!brief The snapshot representation of a client's Annotation.
  21. struct AnnotationSnapshot {
  22. AnnotationSnapshot();
  23. AnnotationSnapshot(const std::string& name,
  24. uint16_t type,
  25. const std::vector<uint8_t>& value);
  26. ~AnnotationSnapshot();
  27. bool operator==(const AnnotationSnapshot& other) const;
  28. bool operator!=(const AnnotationSnapshot& other) const {
  29. return !(*this == other);
  30. }
  31. //! \brief A non-unique name by which this annotation can be identified.
  32. std::string name;
  33. //! \brief The Annotation::Type of data stored in the annotation. This value
  34. //! may be client-supplied and need not correspond to a Crashpad-defined
  35. //! type.
  36. uint16_t type;
  37. //! \brief The data for the annotation. Guranteed to be non-empty, since
  38. //! empty annotations are skipped. The representation of the data should
  39. //! be interpreted as \a #type.
  40. std::vector<uint8_t> value;
  41. };
  42. } // namespace crashpad
  43. #endif // CRASHPAD_SNAPSHOT_ANNOTATION_SNAPSHOT_H_