Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot handle files that are not on a pdrive properly #8

Closed
dedmen opened this issue Jul 13, 2021 · 1 comment
Closed

Cannot handle files that are not on a pdrive properly #8

dedmen opened this issue Jul 13, 2021 · 1 comment

Comments

@dedmen
Copy link
Owner

dedmen commented Jul 13, 2021

https://github.com/dedmen/ArmaScriptCompiler/blob/master/src/main.cpp#L54

root_path is drive letter root, works fine for p-drive, doesn't work fine for not p-drive
example, compile directory
O:\dev\CBA_A3

for O:\dev\CBA_A3\addons\xeh\test
The virtual path should be assembled from pboprefix, and relative path

iterate up directory structure till first pboprefix
x\cba\addons\xeh

pathRelative = path.lexically_relative(directory of pboprefix file);
->
pathRelative = /test

virtual path -> prefix/pathRelative -> x\cba\addons\xeh/test

@dedmen
Copy link
Owner Author

dedmen commented Jul 13, 2021

std::ifstream prefixFile(i->path());
std::string prefix;
std::getline(prefixFile, prefix);
prefixFile.close();

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant