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

PowerDNS / pdns / 15579171380

11 Jun 2025 07:51AM UTC coverage: 61.789% (-3.7%) from 65.507%
15579171380

Pull #15656

github

web-flow
Merge 097608c5e into 0282a2cbb
Pull Request #15656: Remove never used argument

37959 of 91238 branches covered (41.6%)

Branch coverage included in aggregate %.

1 of 1 new or added line in 1 file covered. (100.0%)

6265 existing lines in 77 files now uncovered.

119203 of 163116 relevant lines covered (73.08%)

5623215.79 hits per line

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

67.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 {
4,530✔
36
        return buffer->size();
4,530✔
37
    }
4,530✔
38

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

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

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

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

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

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

69
    static void push_back(std::string* buffer, char ch) {
14,242✔
70
        buffer->push_back(ch);
14,242✔
71
    }
14,242✔
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

© 2026 Coveralls, Inc