dedmen / ArmaScriptCompiler

GNU General Public License v3.0
26 stars 12 forks source link

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

Closed dedmen closed 7 months ago

dedmen commented 3 years ago

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 commented 3 years ago

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