GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members

ResourcesMergingHelper is used (mainly during export) to list resources and generate new filenames, to allow them to be all copied in a single directory (potentially changing the filename to avoid conflicts, but preserving extensions). More...

#include <ResourcesMergingHelper.h>

Inherits gd::ArbitraryResourceWorker.

Public Member Functions

 ResourcesMergingHelper (gd::AbstractFileSystem &fileSystem)
 
void SetBaseDirectory (const gd::String &baseDirectory)
 Set the directory used as base directory: All resources filename are relative to this directory. (usually, it is the project directory).
 
void PreserveDirectoriesStructure (bool preserveDirectoriesStructure_=true)
 Set if the directories structure, starting from the base directory, must be preserved. For compilation in GD C++ Platform, all resources must be in a single folder, so that the directories structure is not preserved.
 
void PreserveAbsoluteFilenames (bool preserveAbsoluteFilenames_=true)
 Set if the absolute filenames must be preserved.
 
std::map< gd::String,
gd::String > & 
GetAllResourcesOldAndNewFilename ()
 Return a map containing the resources old absolute filename as key, and the resources new filenames as value. The new filenames are relative to the Base Directory.
 
virtual void ExposeFile (gd::String &resource)
 
- Public Member Functions inherited from gd::ArbitraryResourceWorker
void ExposeResources (gd::ResourcesManager *resourcesManager)
 Expose a set of resources. More...
 
virtual void ExposeImage (gd::String &imageName)
 Expose an image, which is always a reference to a "image" resource.
 
virtual void ExposeAudio (gd::String &audioName)
 Expose an audio, which is either a reference to an "audio" resource, or a filename if no resource with this name exists.
 
virtual void ExposeFont (gd::String &fontName)
 Expose a font, which is either a reference to a "font" resource, or a filename if no resource with this name exists.
 
virtual void ExposeShader (gd::String &shaderName)
 Expose a shader. Currently unsupported.
 

Protected Member Functions

void SetNewFilename (gd::String oldFilename, gd::String newFilename)
 
- Protected Member Functions inherited from gd::ArbitraryResourceWorker
const std::vector
< gd::ResourcesManager * > & 
GetResources ()
 

Protected Attributes

std::map< gd::String, gd::StringoldFilenames
 
std::map< gd::String, gd::StringnewFilenames
 
gd::String baseDirectory
 
bool preserveDirectoriesStructure
 
bool preserveAbsoluteFilenames
 
gd::AbstractFileSystemfs
 The gd::AbstractFileSystem used to manipulate files.
 

Detailed Description

ResourcesMergingHelper is used (mainly during export) to list resources and generate new filenames, to allow them to be all copied in a single directory (potentially changing the filename to avoid conflicts, but preserving extensions).

See also
ArbitraryResourceWorker

Member Function Documentation

void gd::ResourcesMergingHelper::ExposeFile ( gd::String resource)
virtual

Resources merging helper collects all resources filenames and update these filenames.

Implements gd::ArbitraryResourceWorker.

Member Data Documentation

bool gd::ResourcesMergingHelper::preserveAbsoluteFilenames
protected

If set to true, the filenames which are absolute (C:.png will not be transformed into a relative filename (MyFile.png).

bool gd::ResourcesMergingHelper::preserveDirectoriesStructure
protected

If set to true, the directory structure, starting from baseDirectory, will be preserved in filenames.


The documentation for this class was generated from the following files: