Whitespace fix
This commit is contained in:
parent
9ee1f567a5
commit
b180214152
@ -25,7 +25,7 @@ class ResourceStream
|
||||
{
|
||||
public:
|
||||
virtual ~ResourceStream() { };
|
||||
|
||||
|
||||
/// Get size of resource
|
||||
virtual size_t getSize() = 0;
|
||||
|
||||
@ -49,7 +49,7 @@ class ResourceStream
|
||||
};
|
||||
|
||||
|
||||
/***
|
||||
/***
|
||||
* Low level resource file interface.
|
||||
* Never use it, use ResourcesCollection instead.
|
||||
***/
|
||||
@ -61,7 +61,7 @@ class ResourceFile
|
||||
std::wstring name; /// resource file name
|
||||
Buffer *buffer;
|
||||
bool ownBuffer;
|
||||
|
||||
|
||||
public:
|
||||
/// Resource file directory entry
|
||||
typedef struct {
|
||||
@ -74,7 +74,7 @@ class ResourceFile
|
||||
} DirectoryEntry;
|
||||
/// List of directory entries.
|
||||
typedef std::list<DirectoryEntry> Directory;
|
||||
|
||||
|
||||
public:
|
||||
/// Create resource file. Throws exception if file can't be opened.
|
||||
/// \param fileName the name of resource file.
|
||||
@ -94,20 +94,20 @@ class ResourceFile
|
||||
/// \param offset offset from start of resource file to packed data
|
||||
/// \param packedSize size of packed resource
|
||||
/// \param unpackedSize size of unpacked resource
|
||||
void load(char *buf, long offset, long packedSize,
|
||||
void load(char *buf, long offset, long packedSize,
|
||||
long unpackedSize, int level);
|
||||
|
||||
/// Allocate buffer and load data. Memory returned by this
|
||||
|
||||
/// Allocate buffer and load data. Memory returned by this
|
||||
/// method must be freed by free() function call.
|
||||
/// \param offset offset from start of resource file to packed data
|
||||
/// \param packedSize size of packed resource
|
||||
/// \param unpackedSize size of unpacked resource
|
||||
void* load(long offset, long packedSize, long unpackedSize,
|
||||
void* load(long offset, long packedSize, long unpackedSize,
|
||||
int level);
|
||||
|
||||
/// Get priority of this resource file.
|
||||
int getPriority() const { return priority; };
|
||||
|
||||
|
||||
/// Get the name of resource file.
|
||||
const std::wstring& getFileName() const { return name; };
|
||||
|
||||
@ -133,7 +133,7 @@ class SimpleResourceFile: public ResourceFile
|
||||
private:
|
||||
typedef std::map<std::wstring, DirectoryEntry> DirectoryMap;
|
||||
DirectoryMap directory; /// Directory map.
|
||||
|
||||
|
||||
public:
|
||||
/// Open resource file. Throws exception if file can't be opened.
|
||||
/// \param fileName the name of resource file.
|
||||
@ -156,7 +156,7 @@ class SimpleResourceFile: public ResourceFile
|
||||
|
||||
|
||||
/// Internationalized resource entity.
|
||||
class ResVariant
|
||||
class ResVariant
|
||||
{
|
||||
private:
|
||||
int i18nScore;
|
||||
@ -167,7 +167,7 @@ class ResVariant
|
||||
int refCnt;
|
||||
void *data;
|
||||
int level;
|
||||
|
||||
|
||||
public:
|
||||
/// Create resource variation.
|
||||
/// \param file reesource file
|
||||
@ -175,18 +175,18 @@ class ResVariant
|
||||
/// \param entry entry in global resources directory
|
||||
ResVariant(ResourceFile *file, int score,
|
||||
const ResourceFile::DirectoryEntry &entry);
|
||||
|
||||
|
||||
~ResVariant();
|
||||
|
||||
public:
|
||||
/// Return locale compability score.
|
||||
int getI18nScore() const { return i18nScore; };
|
||||
|
||||
/// Get pointer to unpacked resource data.
|
||||
/// Get pointer to unpacked resource data.
|
||||
/// Must be freed after use this delRef()
|
||||
void* getRef();
|
||||
|
||||
/// Get pointer to unpacked resource data and return resource size.
|
||||
/// Get pointer to unpacked resource data and return resource size.
|
||||
/// Must be freed after use this delRef().
|
||||
/// \param size returned size of resource data.
|
||||
void* getRef(size_t &size);
|
||||
@ -212,7 +212,7 @@ class ResVariant
|
||||
/// Return data in buffer
|
||||
/// \param buffer buffer to store data.
|
||||
void getData(Buffer &buffer);
|
||||
|
||||
|
||||
/// Create ResourceStream for resource.
|
||||
/// This may be usefull for large streams unpacked data,
|
||||
/// for example video and sound.
|
||||
@ -223,7 +223,7 @@ class ResVariant
|
||||
|
||||
/// Internationalized resources.
|
||||
/// Collection of localized data (ResVariant) with single name.
|
||||
class Resource
|
||||
class Resource
|
||||
{
|
||||
private:
|
||||
typedef std::vector<ResVariant*> Variants;
|
||||
@ -262,7 +262,7 @@ class Resource
|
||||
/// \param variant variant number.
|
||||
void* getRef(int variant=0);
|
||||
|
||||
/// Load data from variant.
|
||||
/// Load data from variant.
|
||||
/// data must be freed with delRef()
|
||||
/// \param size size of data.
|
||||
/// \param variant variant number.
|
||||
@ -278,12 +278,12 @@ class Resource
|
||||
|
||||
/// Get name of this resource.
|
||||
const std::wstring& getName() const { return name; };
|
||||
|
||||
|
||||
/// Load data into buffer.
|
||||
/// \param buffer buffer for data.
|
||||
/// \param variant variant number.
|
||||
void getData(Buffer &buffer, int variant=0);
|
||||
|
||||
|
||||
/// Create ResourceStream for resource.
|
||||
/// This may be usefull for large streams unpacked data,
|
||||
/// for example video and sound.
|
||||
@ -295,7 +295,7 @@ class Resource
|
||||
|
||||
/// Internationalized resource files collection.
|
||||
/// When ResourceCollection created all resources checked against
|
||||
/// current locale. Resources not belonged to current locale are
|
||||
/// current locale. Resources not belonged to current locale are
|
||||
/// ignored, resources that can be used in current locale sorted
|
||||
/// by locale relevance score.
|
||||
/// All resources names interpeted as name[_language][_COUNTRY].extension
|
||||
@ -314,46 +314,46 @@ class ResourcesCollection
|
||||
private:
|
||||
/// Map resource names to resources.
|
||||
typedef std::map<std::wstring, Resource*> ResourcesMap;
|
||||
|
||||
|
||||
/// List of resources.
|
||||
typedef std::list<Resource*> ResourcesList;
|
||||
|
||||
|
||||
/// Map group names to resources list.
|
||||
typedef std::map<std::wstring, ResourcesList> ResourcesListMap;
|
||||
|
||||
|
||||
/// List of resource files.
|
||||
typedef std::vector<ResourceFile*> ResourceFiles;
|
||||
|
||||
|
||||
ResourcesMap resources; /// Map of all available resources.
|
||||
ResourcesListMap groups; /// Map of all available groups.
|
||||
ResourceFiles files; /// List of resource files.
|
||||
Buffer buffer; /// Temporary buffer for resource files.
|
||||
|
||||
|
||||
public:
|
||||
/// Load resource files, make grouping and i18n optimizations.
|
||||
ResourcesCollection(StringList &directories);
|
||||
~ResourcesCollection();
|
||||
|
||||
public:
|
||||
/// Returns resource entry.
|
||||
/// Returns resource entry.
|
||||
/// If resource not found Exception will be thrown.
|
||||
Resource* getResource(const std::wstring &name);
|
||||
|
||||
/// Load resource.
|
||||
|
||||
/// Load resource.
|
||||
/// Loaded data must be freed with delRef method.
|
||||
void* getRef(const std::wstring &name, int &size);
|
||||
|
||||
/// Load resource.
|
||||
|
||||
/// Load resource.
|
||||
/// Loaded data must be freed with delRef method.
|
||||
void* getRef(const std::wstring &name);
|
||||
|
||||
/// Delete reference to resource.
|
||||
void delRef(void *data);
|
||||
|
||||
|
||||
/// Visit all group members.
|
||||
void forEachInGroup(const std::wstring &groupName,
|
||||
void forEachInGroup(const std::wstring &groupName,
|
||||
Visitor<Resource*> &visitor);
|
||||
|
||||
|
||||
/// Create ResourceStream for resource.
|
||||
/// This may be usefull for large streams unpacked data,
|
||||
/// for example video and sound.
|
||||
@ -382,7 +382,7 @@ class ResDataHolder
|
||||
private:
|
||||
void *data;
|
||||
size_t size;
|
||||
|
||||
|
||||
public:
|
||||
/// Create holder without data
|
||||
ResDataHolder();
|
||||
@ -404,10 +404,9 @@ class ResDataHolder
|
||||
};
|
||||
|
||||
|
||||
/// Global collection of resources.
|
||||
/// Global collection of resources.
|
||||
/// Careated at first step at boot time stage2
|
||||
extern ResourcesCollection *resources;
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user