summaryrefslogtreecommitdiff
path: root/Build/source/libs/poppler/poppler-0.36.0/poppler/CurlPDFDocBuilder.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/poppler/poppler-0.36.0/poppler/CurlPDFDocBuilder.cc')
-rw-r--r--Build/source/libs/poppler/poppler-0.36.0/poppler/CurlPDFDocBuilder.cc47
1 files changed, 47 insertions, 0 deletions
diff --git a/Build/source/libs/poppler/poppler-0.36.0/poppler/CurlPDFDocBuilder.cc b/Build/source/libs/poppler/poppler-0.36.0/poppler/CurlPDFDocBuilder.cc
new file mode 100644
index 00000000000..5b02b14a784
--- /dev/null
+++ b/Build/source/libs/poppler/poppler-0.36.0/poppler/CurlPDFDocBuilder.cc
@@ -0,0 +1,47 @@
+//========================================================================
+//
+// CurlPDFDocBuilder.cc
+//
+// This file is licensed under the GPLv2 or later
+//
+// Copyright 2010 Hib Eris <hib@hiberis.nl>
+// Copyright 2010 Albert Astals Cid <aacid@kde.org>
+//
+//========================================================================
+
+#include <config.h>
+
+#include "CurlPDFDocBuilder.h"
+
+#include "CachedFile.h"
+#include "CurlCachedFile.h"
+
+//------------------------------------------------------------------------
+// CurlPDFDocBuilder
+//------------------------------------------------------------------------
+
+PDFDoc *
+CurlPDFDocBuilder::buildPDFDoc(const GooString &uri,
+ GooString *ownerPassword, GooString *userPassword, void *guiDataA)
+{
+ Object obj;
+
+ CachedFile *cachedFile = new CachedFile(
+ new CurlCachedFileLoader(), uri.copy());
+
+ obj.initNull();
+ BaseStream *str = new CachedFileStream(
+ cachedFile, 0, gFalse, cachedFile->getLength(), &obj);
+
+ return new PDFDoc(str, ownerPassword, userPassword, guiDataA);
+}
+
+GBool CurlPDFDocBuilder::supports(const GooString &uri)
+{
+ if (uri.cmpN("http://", 7) == 0 || uri.cmpN("https://", 8) == 0) {
+ return gTrue;
+ } else {
+ return gFalse;
+ }
+}
+