File: SplashFontFile.cc

package info (click to toggle)
xpdf 3.02-12%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 5,832 kB
  • ctags: 9,400
  • sloc: cpp: 81,119; ansic: 628; makefile: 446; sh: 227
file content (55 lines) | stat: -rw-r--r-- 1,109 bytes parent folder | download | duplicates (14)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
//========================================================================
//
// SplashFontFile.cc
//
//========================================================================

#include <aconf.h>

#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif

#include <stdio.h>
#ifndef WIN32
#  include <unistd.h>
#endif
#include "GString.h"
#include "SplashFontFile.h"
#include "SplashFontFileID.h"

#ifdef VMS
#if (__VMS_VER < 70000000)
extern "C" int unlink(char *filename);
#endif
#endif

//------------------------------------------------------------------------
// SplashFontFile
//------------------------------------------------------------------------

SplashFontFile::SplashFontFile(SplashFontFileID *idA, char *fileNameA,
			       GBool deleteFileA) {
  id = idA;
  fileName = new GString(fileNameA);
  deleteFile = deleteFileA;
  refCnt = 0;
}

SplashFontFile::~SplashFontFile() {
  if (deleteFile) {
    unlink(fileName->getCString());
  }
  delete fileName;
  delete id;
}

void SplashFontFile::incRefCnt() {
  ++refCnt;
}

void SplashFontFile::decRefCnt() {
  if (!--refCnt) {
    delete this;
  }
}