Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
doxygen-1.8.11
src
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
20
/** @brief Compiled resource */
21
struct
Resource
22
{
23
enum
Type
{
Verbatim
,
Luminance
,
LumAlpha
,
CSS
};
24
const
char
*
category
;
25
const
char
*
name
;
26
const
unsigned
char
*
data
;
27
int
size
;
28
Type
type
;
29
};
30
31
/** @brief Singleton for managing resources compiled into an executable */
32
class
ResourceMgr
33
{
34
public
:
35
/** Returns the one and only instance of this class */
36
static
ResourceMgr
&
instance
();
37
38
/** Registers an array of resources */
39
void
registerResources(
const
Resource
resources[],
int
numResources);
40
41
/** Copies all resource belonging to a given category to a given target directory */
42
bool
copyCategory(
const
char
*categoryName,
const
char
*targetDir)
const
;
43
44
/** Copies a registered resource to a given target directory */
45
bool
copyResource(
const
char
*
name
,
const
char
*targetDir)
const
;
46
47
/** Copies a registered resource to a given target directory under a given target name */
48
bool
copyResourceAs(
const
char
*name,
const
char
*targetDir,
const
char
*targetName)
const
;
49
50
/** Gets the resource data as a C string */
51
QCString
getAsString(
const
char
*name)
const
;
52
53
private
:
54
/** Returns a pointer to the resource object with the given name. */
55
const
Resource
*
get
(
const
char
*
name
)
const
;
56
57
ResourceMgr
();
58
~ResourceMgr();
59
class
Private
;
60
Private
*
p
;
61
};
62
63
#endif
Resource::LumAlpha
Definition:
resourcemgr.h:23
instance
const std::string instance
Definition:
BlipMaker_module.cc:35
qcstring.h
Resource
Compiled resource.
Definition:
resourcemgr.h:21
Resource::Verbatim
Definition:
resourcemgr.h:23
Resource::data
const unsigned char * data
Definition:
resourcemgr.h:26
ResourceMgr
Singleton for managing resources compiled into an executable.
Definition:
resourcemgr.h:32
Resource::Luminance
Definition:
resourcemgr.h:23
Resource::Type
Type
Definition:
resourcemgr.h:23
Resource::size
int size
Definition:
resourcemgr.h:27
Resource::name
const char * name
Definition:
resourcemgr.h:25
ResourceMgr::p
Private * p
Definition:
resourcemgr.h:59
Resource::type
Type type
Definition:
resourcemgr.h:28
Resource::CSS
Definition:
resourcemgr.h:23
QCString
Definition:
qcstring.h:131
ResourceMgr::Private
Definition:
resourcemgr.cpp:28
Resource::category
const char * category
Definition:
resourcemgr.h:24
Generated by
1.8.11