Avara3D 0.2.0
C++ API reference
Filesystem.h
1//
2// Filesystem.h
3// avara3d
4//
5// Created by Morgan Davis on 1/1/26.
6// Copyright © 2026 Morgan K Davis. All rights reserved.
7//
8
9#ifndef AVARA3D_UTIL_FILESYSTEM_H
10#define AVARA3D_UTIL_FILESYSTEM_H
11
12#include <filesystem>
13#include <memory>
14#include <optional>
15#include <string>
16
17#include "a3d/mesh/Mesh.h"
18#include "a3d/scene/Scene.h"
19
20namespace a3d {
21
22 class CubeImage;
23 class Font;
24 class Image;
25
26}
27
28namespace a3d::util::fs {
29
30 // [Process]
31
33 std::optional<std::filesystem::path> ExecutablePath();
34
36 std::optional<std::filesystem::path> ExecutableDirectory();
37
39 std::optional<std::string> ExecutableName();
40
42 std::optional<std::filesystem::path> CurrentWorkingDirectory();
43
44 // [Image]
45
52 std::unique_ptr<Image> ImageAt(const std::filesystem::path& resourcePath,
53 bool flipVertical = true,
54 bool flipHorizontal = false);
55
66 std::unique_ptr<CubeImage> CubeImageAt(const std::filesystem::path& baseFilename);
67
68 // [Scene]
69
76 std::unique_ptr<Scene> SceneAt(const std::filesystem::path& resourcePath,
78
79 // [Mesh]
80
87 std::shared_ptr<Mesh> MeshAt(const std::filesystem::path& resourcePath,
89
90 // [Text]
91
97 std::optional<std::string> TextAt(const std::filesystem::path& resourcePath);
98
99 // [Font]
100
107 std::unique_ptr<Font> FontAt(const std::filesystem::path& resourcePath);
108
109 // [Auxiliary]
110
117 std::optional<std::filesystem::path> AuxiliaryFileAt(const std::filesystem::path& resourcePath);
118
119}
120
121#endif // AVARA3D_UTIL_FILESYSTEM_H
ImportOptions
Selects optional resources imported with Mesh::FromFile().
Definition: Mesh.h:48
@ ImportMaterials
Import materials referenced by the mesh.
ImportOptions
Selects which resource categories are imported by FromFile().
Definition: Scene.h:50
@ ImportAll
Import all supported resource categories.