aboutsummaryrefslogtreecommitdiffstats
path: root/libqpdf/Pl_String.cc
blob: 9009268ac1adab9fe74658acbd8d8dd306a7aecd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#include <qpdf/Pl_String.hh>

#include <stdexcept>

Pl_String::Members::Members(std::string& s) :
    s(s)
{
}

Pl_String::Pl_String(char const* identifier, Pipeline* next, std::string& s) :
    Pipeline(identifier, next),
    m(new Members(s))
{
}

Pl_String::~Pl_String() // NOLINT (modernize-use-equals-default)
{
    // Must be explicit and not inline -- see QPDF_DLL_CLASS in README-maintainer
}

void
Pl_String::write(unsigned char const* buf, size_t len)
{
    m->s.append(reinterpret_cast<char const*>(buf), len);
    if (getNext(true)) {
        getNext()->write(buf, len);
    }
}

void
Pl_String::finish()
{
    if (getNext(true)) {
        getNext()->finish();
    }
}