• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2024 The PDFium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CORE_FXCODEC_DATA_AND_BYTES_CONSUMED_H_
6 #define CORE_FXCODEC_DATA_AND_BYTES_CONSUMED_H_
7 
8 #include <stdint.h>
9 
10 #include "core/fxcrt/data_vector.h"
11 
12 namespace fxcodec {
13 
14 struct DataAndBytesConsumed {
15   DataAndBytesConsumed(DataVector<uint8_t> data, uint32_t bytes_consumed);
16   DataAndBytesConsumed(const DataAndBytesConsumed&) = delete;
17   DataAndBytesConsumed& operator=(const DataAndBytesConsumed&) = delete;
18   DataAndBytesConsumed(DataAndBytesConsumed&&) noexcept;
19   DataAndBytesConsumed& operator=(DataAndBytesConsumed&&) noexcept;
20   ~DataAndBytesConsumed();
21 
22   DataVector<uint8_t> data;
23   // TODO(thestig): Consider replacing with std::optional<size_t>.
24   uint32_t bytes_consumed;
25 };
26 
27 }  // namespace fxcodec
28 
29 using DataAndBytesConsumed = fxcodec::DataAndBytesConsumed;
30 
31 #endif  // CORE_FXCODEC_DATA_AND_BYTES_CONSUMED_H_
32