Panda3D
 All Classes Functions Variables Enumerations
patcher.cxx
1 // Filename: patcher.cxx
2 // Created by: mike (09Jan97)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "pandabase.h"
16 
17 #ifdef HAVE_OPENSSL
18 
19 #include "config_downloader.h"
20 #include "patcher.h"
21 #include "filename.h"
22 
23 ////////////////////////////////////////////////////////////////////
24 // Function: Patcher::Constructor
25 // Access: Public
26 // Description:
27 ////////////////////////////////////////////////////////////////////
28 Patcher::
29 Patcher() {
30  PT(Buffer) buffer = new Buffer(patcher_buffer_size);
31  init(buffer);
32 }
33 
34 ////////////////////////////////////////////////////////////////////
35 // Function: Patcher::Constructor
36 // Access: Public
37 // Description:
38 ////////////////////////////////////////////////////////////////////
39 Patcher::
40 Patcher(PT(Buffer) buffer) {
41  init(buffer);
42 }
43 
44 ////////////////////////////////////////////////////////////////////
45 // Function: Patcher::Constructor
46 // Access: Private
47 // Description:
48 ////////////////////////////////////////////////////////////////////
49 void Patcher::
50 init(PT(Buffer) buffer) {
51  nassertv(!buffer.is_null());
52  _buffer = buffer;
53 
54  _patchfile = NULL;
55  _patchfile = new Patchfile(_buffer);
56 }
57 
58 ////////////////////////////////////////////////////////////////////
59 // Function: Patcher::Destructor
60 // Access: Public
61 // Description:
62 ////////////////////////////////////////////////////////////////////
63 Patcher::
64 ~Patcher() {
65  delete _patchfile;
66 }
67 
68 ////////////////////////////////////////////////////////////////////
69 // Function: Patcher::initiate
70 // Access: Public
71 // Description:
72 ////////////////////////////////////////////////////////////////////
73 int Patcher::
74 initiate(Filename &patch, Filename &infile) {
75  return _patchfile->initiate(patch, infile);
76 }
77 
78 ////////////////////////////////////////////////////////////////////
79 // Function: Patcher::run
80 // Access: Public
81 // Description:
82 ////////////////////////////////////////////////////////////////////
83 int Patcher::
84 run() {
85  return _patchfile->run();
86 }
87 
88 #endif // HAVE_OPENSSL
Definition: buffer.h:26
The name of a file, such as a texture file or an Egg file.
Definition: filename.h:44