FFileManager

namespace marengine
class FFileDeserializer

Public Static Functions

void loadSceneFromFile(Scene *pScene, const std::string &path)

Method loads scene from given path. Make sure that it is correct path with .marscene.json extension.

Warning

If path is not correct, returns empty scene.

Return

Returns loaded scene, if path was correct. Empty scene otherwise.

Parameters
  • path: path, at which .marscene.json file should exist and it should be correct one.

void loadConfigFromFile(FEngineConfig *pEngineConfig, const std::string &path)
void loadProjectFromFile(FProject *pProject, const std::string &path, FMeshManager *pMeshManager, FMaterialManager *pMaterialManager)
class FFileManager
#include “Core/filesystem/FileManager.h”

Class responsible for working with files, needed for play mode as in editor mode.

Public Static Functions

void loadFile(std::string &stringToFill, const char *path)

Method loads file from given path and saves it into given stringToFill variable.

Parameters
  • stringToFill: string variable, at which loaded file will be saved

  • path: path, from which file will be loaded.

void saveAsFile(const std::string &sourceCode, const char *path)

Method saves file given at sourceCode variable to given path.

Parameters
  • sourceCode: string variable containg all the sourceCode of the script

  • path: path at which script will be saved.

bool isContainingExtension(const std::string &path, const std::string &extension)
std::string getAbsolutePath(const std::string &relativePath)
bool isValidPath(const std::string &path)
std::string getRelativePath(const std::string &absolutePath, const std::string &path)
std::string getFilenameFromPath(const std::string &path)
std::string getCurrentExePath()
std::string deleteFilenameFromPath(std::string path)
std::string joinPaths(const std::string &path1, const std::string &path2)
bool isPathEndingWithSubstring(const std::string &path, const std::string &substring)
class FFileSerializer

Public Static Functions

void saveSceneToFile(const Scene *scene, const std::string &path)

Serializes given scene and then saves it into given path. Make sure that path is ending with .marscene.json extension.

Warning

if path is incorrect, it immediately returns and displays error.

Parameters
  • path: path at which scene will be saved

  • scene: scene, that will be saved

void saveConfigToFile(const FEngineConfig *pEngineConfig, const std::string &path)
void saveProjectToFile(const FProject *pProject, const std::string &path)