12 #include "GDCore/IDE/Project/ArbitraryResourceWorker.h"
13 #include "GDCore/String.h"
31 const std::map<gd::String, gd::String> &oldToNewNames_)
33 oldToNewNames(oldToNewNames_){};
42 RenameIfNeeded(imageResourceName);
45 RenameIfNeeded(audioResourceName);
48 RenameIfNeeded(fontResourceName);
51 RenameIfNeeded(jsonResourceName);
54 RenameIfNeeded(tilemapResourceName);
57 RenameIfNeeded(tilesetResourceName);
60 RenameIfNeeded(videoResourceName);
63 RenameIfNeeded(bitmapFontName);
66 RenameIfNeeded(resourceName);
69 RenameIfNeeded(resourceName);
72 RenameIfNeeded(resourceName);
76 void RenameIfNeeded(
gd::String& resourceName) {
77 if (oldToNewNames.find(resourceName) != oldToNewNames.end())
78 resourceName = oldToNewNames[resourceName];
81 std::map<gd::String, gd::String> oldToNewNames;
ArbitraryResourceWorker is used so as to inventory resources and sometimes update them.
Definition: ArbitraryResourceWorker.h:44
Inventory all resources used by a project.
Definition: ResourcesManager.h:556
Class used to rename resources (in an object, an entire project, etc...)
Definition: ResourcesRenamer.h:23
virtual void ExposeBitmapFont(gd::String &bitmapFontName) override
Expose a bitmap font, which is always a reference to a "bitmapFont" resource.
Definition: ResourcesRenamer.h:62
virtual void ExposeAudio(gd::String &audioResourceName) override
Expose an audio, which is either a reference to an "audio" resource, or a filename if no resource wit...
Definition: ResourcesRenamer.h:44
virtual void ExposeJson(gd::String &jsonResourceName) override
Expose a JSON, which is always a reference to a "json" resource.
Definition: ResourcesRenamer.h:50
ResourcesRenamer(gd::ResourcesManager &resourcesManager, const std::map< gd::String, gd::String > &oldToNewNames_)
Constructor taking the map from old name to new name.
Definition: ResourcesRenamer.h:30
virtual void ExposeTilemap(gd::String &tilemapResourceName) override
Expose a Tilemap, which is always a reference to a "tilemap" resource.
Definition: ResourcesRenamer.h:53
virtual void ExposeModel3D(gd::String &resourceName) override
Expose a 3D model, which is always a reference to a "model3D" resource.
Definition: ResourcesRenamer.h:65
virtual void ExposeFont(gd::String &fontResourceName) override
Expose a font, which is either a reference to a "font" resource, or a filename if no resource with th...
Definition: ResourcesRenamer.h:47
virtual void ExposeImage(gd::String &imageResourceName) override
Expose an image, which is always a reference to a "image" resource.
Definition: ResourcesRenamer.h:41
virtual void ExposeTileset(gd::String &tilesetResourceName) override
Expose a Tileset, which is always a reference to a "tileset" resource.
Definition: ResourcesRenamer.h:56
virtual void ExposeSpine(gd::String &resourceName) override
Expose an spine, which is always a reference to a "spine" resource.
Definition: ResourcesRenamer.h:71
virtual void ExposeFile(gd::String &resourceFileName) override
Expose a raw filename.
Definition: ResourcesRenamer.h:37
virtual void ExposeAtlas(gd::String &resourceName) override
Expose an atlas, which is always a reference to a "atlas" resource.
Definition: ResourcesRenamer.h:68
virtual void ExposeVideo(gd::String &videoResourceName) override
Expose a video, which is always a reference to a "video" resource.
Definition: ResourcesRenamer.h:59
String represents an UTF8 encoded string.
Definition: String.h:33
Definition: CommonTools.h:24