diff options
Diffstat (limited to 'include/qpdf/Pipeline.hh')
-rw-r--r-- | include/qpdf/Pipeline.hh | 69 |
1 files changed, 29 insertions, 40 deletions
diff --git a/include/qpdf/Pipeline.hh b/include/qpdf/Pipeline.hh index a35e7ec6..9b5bc483 100644 --- a/include/qpdf/Pipeline.hh +++ b/include/qpdf/Pipeline.hh @@ -2,44 +2,36 @@ // // This file is part of qpdf. // -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at +// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except +// in compliance with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. +// Unless required by applicable law or agreed to in writing, software distributed under the License +// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express +// or implied. See the License for the specific language governing permissions and limitations under +// the License. // -// Versions of qpdf prior to version 7 were released under the terms -// of version 2.0 of the Artistic License. At your option, you may -// continue to consider qpdf to be licensed under those terms. Please -// see the manual for additional information. +// Versions of qpdf prior to version 7 were released under the terms of version 2.0 of the Artistic +// License. At your option, you may continue to consider qpdf to be licensed under those terms. +// Please see the manual for additional information. -// Generalized Pipeline interface. By convention, subclasses of -// Pipeline are called Pl_Something. +// Generalized Pipeline interface. By convention, subclasses of Pipeline are called Pl_Something. // -// When an instance of Pipeline is created with a pointer to a next -// pipeline, that pipeline writes its data to the next one when it -// finishes with it. In order to make possible a usage style in which -// a pipeline may be passed to a function which may stick other -// pipelines in front of it, the allocator of a pipeline is -// responsible for its destruction. In other words, one pipeline -// object does not attempt to manage the memory of its successor. +// When an instance of Pipeline is created with a pointer to a next pipeline, that pipeline writes +// its data to the next one when it finishes with it. In order to make possible a usage style in +// which a pipeline may be passed to a function which may stick other pipelines in front of it, the +// allocator of a pipeline is responsible for its destruction. In other words, one pipeline object +// does not attempt to manage the memory of its successor. // -// The client is required to call finish() before destroying a -// Pipeline in order to avoid loss of data. A Pipeline class should -// not throw an exception in the destructor if this hasn't been done +// The client is required to call finish() before destroying a Pipeline in order to avoid loss of +// data. A Pipeline class should not throw an exception in the destructor if this hasn't been done // though since doing so causes too much trouble when deleting // pipelines during error conditions. // -// Some pipelines are reusable (i.e., you can call write() after -// calling finish() and can call finish() multiple times) while others -// are not. It is up to the caller to use a pipeline according to its -// own restrictions. +// Some pipelines are reusable (i.e., you can call write() after calling finish() and can call +// finish() multiple times) while others are not. It is up to the caller to use a pipeline +// according to its own restrictions. #ifndef PIPELINE_HH #define PIPELINE_HH @@ -50,8 +42,8 @@ #include <memory> #include <string> -// Remember to use QPDF_DLL_CLASS on anything derived from Pipeline so -// it will work with dynamic_cast across the shared object boundary. +// Remember to use QPDF_DLL_CLASS on anything derived from Pipeline so it will work with +// dynamic_cast across the shared object boundary. class QPDF_DLL_CLASS Pipeline { public: @@ -61,9 +53,8 @@ class QPDF_DLL_CLASS Pipeline QPDF_DLL virtual ~Pipeline() = default; - // Subclasses should implement write and finish to do their jobs - // and then, if they are not end-of-line pipelines, call - // getNext()->write or getNext()->finish. + // Subclasses should implement write and finish to do their jobs and then, if they are not + // end-of-line pipelines, call getNext()->write or getNext()->finish. QPDF_DLL virtual void write(unsigned char const* data, size_t len) = 0; QPDF_DLL @@ -71,17 +62,15 @@ class QPDF_DLL_CLASS Pipeline QPDF_DLL std::string getIdentifier() const; - // These are convenience methods for making it easier to write - // certain other types of data to pipelines without having to - // cast. The methods that take char const* expect null-terminated - // C strings and do not write the null terminators. + // These are convenience methods for making it easier to write certain other types of data to + // pipelines without having to cast. The methods that take char const* expect null-terminated C + // strings and do not write the null terminators. QPDF_DLL void writeCStr(char const* cstr); QPDF_DLL void writeString(std::string const&); - // This allows *p << "x" << "y" but is not intended to be a - // general purpose << compatible with ostream and does not have - // local awareness or the ability to be "imbued" with properties. + // This allows *p << "x" << "y" but is not intended to be a general purpose << compatible with + // ostream and does not have local awareness or the ability to be "imbued" with properties. QPDF_DLL Pipeline& operator<<(char const* cstr); QPDF_DLL |