Calamity Engine 1.0.0
A cross-platform 2D game engine written in C++ and SDL3.
Loading...
Searching...
No Matches
file.hpp File Reference
#include <SDL3/SDL.h>
#include <memory>
#include "../core/definitions.hpp"
#include "../core/node/node.hpp"
#include "../services/engine.hpp"
#include "../core/node/components.hpp"

Go to the source code of this file.

Classes

class  File
 

Enumerations

enum class  Whence { BEGIN , CURRENT , END }
 

Functions

void loadNodeTree (const std::shared_ptr< Node > &parent, const std::string &jsonText)
 
std::string exportNodeTree (std::shared_ptr< Node > node)
 
std::string exportWindow (std::shared_ptr< Window > window)
 
void loadWindow (const std::string &jsonText, std::shared_ptr< Window > window)
 
std::string parseFilePath (std::string path)
 

Enumeration Type Documentation

◆ Whence

enum class Whence
strong
Enumerator
BEGIN 
CURRENT 
END 

Function Documentation

◆ exportNodeTree()

std::string exportNodeTree ( std::shared_ptr< Node node)

Exports a specific node and its children/components to an std::string.

This function is for exporting any node as a JSON file.

◆ exportWindow()

std::string exportWindow ( std::shared_ptr< Window window)

This function is specifically for loading the root node of the engine.

This function exports the root node of the provided window. You can think of the root node of a window as a "scene" system that other engines would have.

◆ loadNodeTree()

void loadNodeTree ( const std::shared_ptr< Node > &  parent,
const std::string &  jsonText 
)

Imports a specific node from an std::string.

This function is for loading a node tree from JSON text.

◆ loadWindow()

void loadWindow ( const std::string &  jsonText,
std::shared_ptr< Window window 
)

This function loads the root node of the provided window from the provided json text.

◆ parseFilePath()

std::string parseFilePath ( std::string  path)

This function takes a path like "user://myfile.txt" or "res://myfile.txt" and returns the actual file path on the filesystem.