]> git.ipfire.org Git - thirdparty/cups.git/blob - pdftops/SplashFontFile.cxx
Load cups into easysw/current.
[thirdparty/cups.git] / pdftops / SplashFontFile.cxx
1 //========================================================================
2 //
3 // SplashFontFile.cc
4 //
5 //========================================================================
6
7 #include <config.h>
8
9 #ifdef USE_GCC_PRAGMAS
10 #pragma implementation
11 #endif
12
13 #include <stdio.h>
14 #ifndef WIN32
15 # include <unistd.h>
16 #endif
17 #include "GString.h"
18 #include "SplashFontFile.h"
19 #include "SplashFontFileID.h"
20
21 #ifdef VMS
22 #if (__VMS_VER < 70000000)
23 extern "C" int unlink(char *filename);
24 #endif
25 #endif
26
27 //------------------------------------------------------------------------
28 // SplashFontFile
29 //------------------------------------------------------------------------
30
31 SplashFontFile::SplashFontFile(SplashFontFileID *idA, char *fileNameA,
32 GBool deleteFileA) {
33 id = idA;
34 fileName = new GString(fileNameA);
35 deleteFile = deleteFileA;
36 refCnt = 0;
37 }
38
39 SplashFontFile::~SplashFontFile() {
40 if (deleteFile) {
41 unlink(fileName->getCString());
42 }
43 delete fileName;
44 delete id;
45 }
46
47 void SplashFontFile::incRefCnt() {
48 ++refCnt;
49 }
50
51 void SplashFontFile::decRefCnt() {
52 if (!--refCnt) {
53 delete this;
54 }
55 }