Neo  0.5.0
Developer Documentation
PackageManager.h
Go to the documentation of this file.
1 //========================================================================
2 // Copyright (c) 2003-2011 Philipp Geyer <http://nistur.com>
3 //
4 // This software is provided 'as-is', without any express or implied
5 // warranty. In no event will the authors be held liable for any damages
6 // arising from the use of this software.
7 //
8 // Permission is granted to anyone to use this software for any purpose,
9 // including commercial applications, and to alter it and redistribute it
10 // freely, subject to the following restrictions:
11 //
12 // 1. The origin of this software must not be misrepresented; you must not
13 // claim that you wrote the original software. If you use this software
14 // in a product, an acknowledgment in the product documentation would
15 // be appreciated but is not required.
16 //
17 // 2. Altered source versions must be plainly marked as such, and must not
18 // be misrepresented as being the original software.
19 //
20 // 3. This notice may not be removed or altered from any source
21 // distribution.
22 //
23 //========================================================================
24 
25 #ifndef __PACKAGE_MANAGER_H
26 #define __PACKAGE_MANAGER_H
27 
28 namespace Neo
29 {
30 typedef void * PackageEnt;
31 typedef void * Package;
32 
33 /*--------------------------------------------------------------------------------
34  * PackageManager
35  * @brief Interface for adding package managers. Can be used for any
36  * file I/O managers such as package file, or network streams
37  *-------------------------------------------------------------------------------*/
38 class NEO_ENGINE_EXPORT PackageManager
39 {
40 public:
41  // destructor
42  virtual ~PackageManager(void) {}
43 
44  virtual void init() = 0;
45  virtual void cleanup() = 0;
46 
47  // accessors for loading
48  // will add a package to the package list and
49  // allow searching for files within it
50  virtual Package loadPackage(const char *packageName) = 0;
51  virtual PackageEnt findEntity(const char *name) = 0;
52  virtual void offlinePackage(Package package) = 0;
53  virtual void unloadPackage(Package package) = 0;
54 
55  // accessors for publishing.
56  // this will not add to the package list
57  // handling these packages will be your own task
58  virtual Package openPackage(const char *packageName) = 0;
59  virtual void closePackage(Package package) = 0;
60  virtual PackageEnt addFileToPackage(const char *filename, Package package,
61  const char *entityName) = 0;
62  virtual Package mountPackage(Package package) = 0;
63 };
64 }
65 #endif
virtual ~PackageManager(void)
Definition: PackageManager.h:42
void * Package
Definition: PackageManager.h:31
Definition: PackageManager.h:38
Definition: Color.h:29
void * PackageEnt
Definition: PackageManager.h:30