source: trunk/poppler/mypoppler/poppler/CurlPDFDocBuilder.cc @ 461

Last change on this file since 461 was 461, checked in by Silvan Scherrer, 11 years ago

poppler update to 0.14.2

File size: 1.2 KB
Line 
1//========================================================================
2//
3// CurlPDFDocBuilder.cc
4//
5// This file is licensed under the GPLv2 or later
6//
7// Copyright 2010 Hib Eris <hib@hiberis.nl>
8// Copyright 2010 Albert Astals Cid <aacid@kde.org>
9//
10//========================================================================
11
12#include <config.h>
13
14#include "CurlPDFDocBuilder.h"
15
16#include "CachedFile.h"
17#include "CurlCachedFile.h"
18
19//------------------------------------------------------------------------
20// CurlPDFDocBuilder
21//------------------------------------------------------------------------
22
23PDFDoc *
24CurlPDFDocBuilder::buildPDFDoc(const GooString &uri,
25        GooString *ownerPassword, GooString *userPassword, void *guiDataA)
26{
27    Object obj;
28
29    CachedFile *cachedFile = new CachedFile(
30        new CurlCachedFileLoader(), uri.copy());
31
32    obj.initNull();
33    BaseStream *str = new CachedFileStream(
34         cachedFile, 0, gFalse, cachedFile->getLength(), &obj);
35
36    return new PDFDoc(str, ownerPassword, userPassword, guiDataA);
37}
38
39GBool CurlPDFDocBuilder::supports(const GooString &uri)
40{
41  if (uri.cmpN("http://", 7) == 0 || uri.cmpN("https://", 8) == 0) {
42    return gTrue;
43  } else {
44    return gFalse;
45  }
46};
47
Note: See TracBrowser for help on using the repository browser.