source: trunk/poppler/mypoppler/poppler/LocalPDFDocBuilder.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// LocalPDFDocBuilder.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 "LocalPDFDocBuilder.h"
15
16//------------------------------------------------------------------------
17// LocalPDFDocBuilder
18//------------------------------------------------------------------------
19
20PDFDoc *
21LocalPDFDocBuilder::buildPDFDoc(
22    const GooString &uri, GooString *ownerPassword, GooString
23    *userPassword, void *guiDataA)
24{
25  if (uri.cmpN("file://", 7) == 0) {
26     GooString *fileName = uri.copy();
27     fileName->del(0, 7);
28     return new PDFDoc(fileName, ownerPassword, userPassword, guiDataA);
29  } else {
30     GooString *fileName = uri.copy();
31     return new PDFDoc(fileName, ownerPassword, userPassword, guiDataA);
32  }
33}
34
35GBool LocalPDFDocBuilder::supports(const GooString &uri)
36{
37  if (uri.cmpN("file://", 7) == 0) {
38    return gTrue;
39  } else if (!strstr(uri.getCString(), "://")) {
40    return gTrue;
41  } else {
42    return gFalse;
43  }
44}
45
46
Note: See TracBrowser for help on using the repository browser.