• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

PowerDNS / pdns / 15753995166

19 Jun 2025 09:04AM UTC coverage: 65.601% (+0.1%) from 65.499%
15753995166

Pull #15668

github

web-flow
Merge 86fb65722 into ed11bbc34
Pull Request #15668: rec: generate trace data in OpenTelemetry format

41510 of 91830 branches covered (45.2%)

Branch coverage included in aggregate %.

728 of 1009 new or added lines in 14 files covered. (72.15%)

4990 existing lines in 98 files now uncovered.

126689 of 164568 relevant lines covered (76.98%)

5439121.23 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

82.5
/ext/protozero/include/protozero/buffer_string.hpp
1
#ifndef PROTOZERO_BUFFER_STRING_HPP
2
#define PROTOZERO_BUFFER_STRING_HPP
3

4
/*****************************************************************************
5

6
protozero - Minimalistic protocol buffer decoder and encoder in C++.
7

8
This file is from https://github.com/mapbox/protozero where you can find more
9
documentation.
10

11
*****************************************************************************/
12

13
/**
14
 * @file buffer_string.hpp
15
 *
16
 * @brief Contains the customization points for buffer implementation based
17
 *        on std::string
18
 */
19

20
#include "buffer_tmpl.hpp"
21
#include "config.hpp"
22

23
#include <cstddef>
24
#include <iterator>
25
#include <string>
26

27
namespace protozero {
28

29
// Implementation of buffer customizations points for std::string
30

31
/// @cond INTERNAL
32
template <>
33
struct buffer_customization<std::string> {
34

35
    static std::size_t size(const std::string* buffer) noexcept {
11,789✔
36
        return buffer->size();
11,789✔
37
    }
11,789✔
38

39
    static void append(std::string* buffer, const char* data, std::size_t count) {
4,160✔
40
        buffer->append(data, count);
4,160✔
41
    }
4,160✔
42

43
    static void append_zeros(std::string* buffer, std::size_t count) {
2,361✔
44
        buffer->append(count, '\0');
2,361✔
45
    }
2,361✔
46

47
    static void resize(std::string* buffer, std::size_t size) {
8✔
48
        protozero_assert(size < buffer->size());
8!
49
        buffer->resize(size);
×
50
    }
8✔
51

UNCOV
52
    static void reserve_additional(std::string* buffer, std::size_t size) {
109✔
UNCOV
53
        buffer->reserve(buffer->size() + size);
109✔
UNCOV
54
    }
109✔
55

56
    static void erase_range(std::string* buffer, std::size_t from, std::size_t to) {
2,353✔
57
        protozero_assert(from <= buffer->size());
2,353!
58
        protozero_assert(to <= buffer->size());
2,353!
59
        protozero_assert(from <= to);
2,353!
60
        buffer->erase(buffer->begin() + static_cast<std::string::difference_type>(from),
316✔
61
                      buffer->begin() + static_cast<std::string::difference_type>(to));
2,353✔
62
    }
2,353✔
63

64
    static char* at_pos(std::string* buffer, std::size_t pos) {
2,353✔
65
        protozero_assert(pos <= buffer->size());
2,353!
66
        return (&*buffer->begin()) + pos;
316✔
67
    }
2,353✔
68

69
    static void push_back(std::string* buffer, char ch) {
25,930✔
70
        buffer->push_back(ch);
25,930✔
71
    }
25,930✔
72

73
};
74
/// @endcond
75

76
} // namespace protozero
77

78
#endif // PROTOZERO_BUFFER_STRING_HPP
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc