summaryrefslogtreecommitdiff
path: root/xfa_test/pdf/pdfium/pdfium_mem_buffer_file_read.h
blob: 88ec410a6c6fbb0080052e602415f5bd659d503f (plain)
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
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef PDF_PDFIUM_PDFIUM_MEM_BUFFER_FILE_READ_H_
#define PDF_PDFIUM_PDFIUM_MEM_BUFFER_FILE_READ_H_

#include <stdlib.h>

#include "third_party/pdfium/fpdfsdk/include/fpdfview.h"

namespace chrome_pdf {

// Implementation of FPDF_FILEACCESS from a memory buffer.
class PDFiumMemBufferFileRead : public FPDF_FILEACCESS {
 public:
  PDFiumMemBufferFileRead(const void* data, size_t size);
  ~PDFiumMemBufferFileRead();

 private:
  static int GetBlock(void* param,
                      unsigned long position,
                      unsigned char* buf,
                      unsigned long size);
  const unsigned char* data_;
};

}  // namespace chrome_pdf

#endif  // PDF_PDFIUM_PDFIUM_MEM_BUFFER_FILE_READ_H_