Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Roblox
GitHub Repository: Roblox/luau
Path: blob/master/CLI/include/Luau/VfsNavigator.h
2727 views
1
// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details
2
#pragma once
3
4
#include <optional>
5
#include <string>
6
7
enum class NavigationStatus
8
{
9
Success,
10
Ambiguous,
11
NotFound
12
};
13
14
class VfsNavigator
15
{
16
public:
17
NavigationStatus resetToStdIn();
18
NavigationStatus resetToPath(const std::string& path);
19
20
NavigationStatus toParent();
21
NavigationStatus toChild(const std::string& name);
22
23
std::string getFilePath() const;
24
std::string getAbsoluteFilePath() const;
25
26
enum class ConfigStatus
27
{
28
Absent,
29
Ambiguous,
30
PresentJson,
31
PresentLuau
32
};
33
34
ConfigStatus getConfigStatus() const;
35
std::optional<std::string> getConfig() const;
36
37
private:
38
std::string getConfigPath(const std::string& filename) const;
39
40
NavigationStatus updateRealPaths();
41
42
std::string realPath;
43
std::string absoluteRealPath;
44
std::string absolutePathPrefix;
45
46
std::string modulePath;
47
std::string absoluteModulePath;
48
};
49
50