GDevelop Core
Core library for developing platforms and tools compatible with GDevelop.
AssetResourcePathCleaner.h
1 /*
2  * GDevelop Core
3  * Copyright 2008-2023 Florian Rival ([email protected]). All rights
4  * reserved. This project is released under the MIT License.
5  */
6 #pragma once
7 
8 #include "GDCore/IDE/Project/ArbitraryResourceWorker.h"
9 #include "GDCore/IDE/Project/ResourcesMergingHelper.h"
10 #include "GDCore/String.h"
11 #include <map>
12 #include <memory>
13 #include <vector>
14 
15 namespace gd {
16 class AbstractFileSystem;
17 class Project;
18 } // namespace gd
19 
20 namespace gd {
21 
31 public:
33  gd::ResourcesManager &resourcesManager,
34  std::map<gd::String, gd::String> &resourcesFileNameMap_,
35  std::map<gd::String, gd::String> &resourcesNameReverseMap_)
36  : ArbitraryResourceWorker(resourcesManager),
37  resourcesFileNameMap(resourcesFileNameMap_),
38  resourcesNameReverseMap(resourcesNameReverseMap_){};
39  virtual ~AssetResourcePathCleaner(){};
40 
41  void ExposeImage(gd::String &imageName) override;
42  void ExposeAudio(gd::String &audioName) override;
43  void ExposeFont(gd::String &fontName) override;
44  void ExposeJson(gd::String &jsonName) override;
45  void ExposeTilemap(gd::String &tilemapName) override;
46  void ExposeTileset(gd::String &tilesetName) override;
47  void ExposeVideo(gd::String &videoName) override;
48  void ExposeBitmapFont(gd::String &bitmapFontName) override;
49  void ExposeFile(gd::String &resource) override;
50 
51 protected:
52  void ExposeResourceAsFile(gd::String &resourceName);
53 
57  std::map<gd::String, gd::String> &resourcesFileNameMap;
58 
62  std::map<gd::String, gd::String> &resourcesNameReverseMap;
63 };
64 
65 } // namespace gd
ArbitraryResourceWorker is used so as to inventory resources and sometimes update them.
Definition: ArbitraryResourceWorker.h:44
AssetResourcePathCleaner is used when exporting an object as an asset. It removes the folder from the...
Definition: AssetResourcePathCleaner.h:30
std::map< gd::String, gd::String > & resourcesNameReverseMap
Definition: AssetResourcePathCleaner.h:62
std::map< gd::String, gd::String > & resourcesFileNameMap
Definition: AssetResourcePathCleaner.h:57
Inventory all resources used by a project.
Definition: ResourcesManager.h:556
String represents an UTF8 encoded string.
Definition: String.h:33
Definition: CommonTools.h:24