My Project
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
resourcemgr.h
Go to the documentation of this file.
1 /******************************************************************************
2  *
3  * Copyright (C) 1997-2015 by Dimitri van Heesch.
4  *
5  * Permission to use, copy, modify, and distribute this software and its
6  * documentation under the terms of the GNU General Public License is hereby
7  * granted. No representations are made about the suitability of this software
8  * for any purpose. It is provided "as is" without express or implied warranty.
9  * See the GNU General Public License for more details.
10  *
11  * Documents produced by Doxygen are derivative works derived from the
12  * input used in their production; they are not affected by this license.
13  *
14  */
15 #ifndef RESOURCEMGR_H
16 #define RESOURCEMGR_H
17 
18 #include <qcstring.h>
19 
21 struct Resource
22 {
24  const char *category;
25  const char *name;
26  const unsigned char *data;
27  int size;
29 };
30 
33 {
34  public:
36  static ResourceMgr &instance();
37 
39  void registerResources(const Resource resources[],int numResources);
40 
42  bool writeCategory(const char *categoryName,const char *targetDir) const;
43 
45  bool copyResource(const char *name,const char *targetDir) const;
46 
48  bool copyResourceAs(const char *name,const char *targetDir,const char *targetName) const;
49 
51  QCString getAsString(const char *name) const;
52 
53  private:
55  const Resource *get(const char *name) const;
56 
57  ResourceMgr();
58  ~ResourceMgr();
59  class Private;
60  Private *p;
61 };
62 
63 #endif