added REMOVE_SPF pass

This commit is contained in:
ALEXks
2025-03-18 09:37:20 +03:00
parent 43dfc2368a
commit d58227bd0c
10 changed files with 63 additions and 93 deletions

View File

@@ -556,7 +556,7 @@ string renameInclude(const string& inc)
void copyIncludes(const set<string> &allIncludeFiles, const map<string, map<int, set<string>>> &commentsToInclude,
const map<string, map<int, set<string>>>& newCopyDeclToIncl,
const char *folderName, bool keepSpfDirs, bool isFreeStyle, bool isRename,
int removeDvmDirs)
int removeDirs)
{
for (auto &include : allIncludeFiles)
{
@@ -601,18 +601,24 @@ void copyIncludes(const set<string> &allIncludeFiles, const map<string, map<int,
bufStr = "\n";
}
//remove DVM dirs or save DVM dirs as comment
if (removeDvmDirs == 1 || removeDvmDirs == 2)
if (removeDirs == 1 || removeDirs == 2)
{
if (bufStr[0] == '!' || bufStr[0] == 'c')
{
if (bufStr[1] == 'd' && bufStr[2] == 'v' && bufStr[3] == 'm' && bufStr[4] == '$')
{
if (removeDvmDirs == 1)
if (removeDirs == 1)
bufStr = "";
else if (removeDvmDirs == 2)
else if (removeDirs == 2)
bufStr.insert(1, " ");
}
}
} //remove SPF dirs
else if (removeDirs == 3)
{
if (bufStr[0] == '!' || bufStr[0] == 'c')
if (bufStr[1] == '$' && bufStr[2] == 's' && bufStr[3] == 'p' && bufStr[4] == 'f')
bufStr = "";
}
// save original include name