Coverage Report

Created: 2025-07-01 06:10

/src/qpdf/libqpdf/Pipeline.cc
Line
Count
Source (jump to first uncovered line)
1
#include <qpdf/Pipeline.hh>
2
3
#include <cstring>
4
#include <stdexcept>
5
6
Pipeline::Pipeline(char const* identifier, Pipeline* next) :
7
312
    identifier(identifier),
8
312
    next_(next)
9
312
{
10
312
}
11
12
Pipeline*
13
Pipeline::getNext(bool allow_null)
14
0
{
15
0
    if (!next_ && !allow_null) {
16
0
        throw std::logic_error(
17
0
            identifier + ": Pipeline::getNext() called on pipeline with no next");
18
0
    }
19
0
    return next_;
20
0
}
21
22
std::string
23
Pipeline::getIdentifier() const
24
0
{
25
0
    return identifier;
26
0
}
27
28
void
29
Pipeline::writeCStr(char const* cstr)
30
0
{
31
0
    write(cstr, strlen(cstr));
32
0
}
33
34
void
35
Pipeline::writeString(std::string const& str)
36
0
{
37
0
    write(str.c_str(), str.length());
38
0
}
39
40
Pipeline&
41
Pipeline::operator<<(char const* cstr)
42
0
{
43
0
    writeCStr(cstr);
44
0
    return *this;
45
0
}
46
47
Pipeline&
48
Pipeline::operator<<(std::string const& str)
49
0
{
50
0
    writeString(str);
51
0
    return *this;
52
0
}
53
54
Pipeline&
55
Pipeline::operator<<(short i)
56
0
{
57
0
    writeString(std::to_string(i));
58
0
    return *this;
59
0
}
60
61
Pipeline&
62
Pipeline::operator<<(int i)
63
0
{
64
0
    writeString(std::to_string(i));
65
0
    return *this;
66
0
}
67
68
Pipeline&
69
Pipeline::operator<<(long i)
70
0
{
71
0
    writeString(std::to_string(i));
72
0
    return *this;
73
0
}
74
75
Pipeline&
76
Pipeline::operator<<(long long i)
77
0
{
78
0
    writeString(std::to_string(i));
79
0
    return *this;
80
0
}
81
82
Pipeline&
83
Pipeline::operator<<(unsigned short i)
84
0
{
85
0
    writeString(std::to_string(i));
86
0
    return *this;
87
0
}
88
89
Pipeline&
90
Pipeline::operator<<(unsigned int i)
91
0
{
92
0
    writeString(std::to_string(i));
93
0
    return *this;
94
0
}
95
96
Pipeline&
97
Pipeline::operator<<(unsigned long i)
98
0
{
99
0
    writeString(std::to_string(i));
100
0
    return *this;
101
0
}
102
103
Pipeline&
104
Pipeline::operator<<(unsigned long long i)
105
0
{
106
0
    writeString(std::to_string(i));
107
0
    return *this;
108
0
}
109
110
void
111
Pipeline::write(char const* data, size_t len)
112
0
{
113
0
    write(reinterpret_cast<unsigned char const*>(data), len);
114
0
}