упорядочил папки с кодом.

This commit is contained in:
2023-11-19 01:53:56 +03:00
parent 4883b4af51
commit 44c6daffa3
596 changed files with 2140 additions and 1569 deletions

View File

@@ -0,0 +1,27 @@
package Common.Passes.All;
import Common.Global;
import Common.Utils.Utils;
import ProjectData.Files.DBProjectFile;
import Common.Passes.Transformation;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.nio.file.Paths;
public class EraseBadSymbols extends Transformation {
@Override
protected void body() throws Exception {
for (DBProjectFile file : target.db.files.Data.values()) {
String file_text = FileUtils.readFileToString(file.file);
StringBuilder res_text = new StringBuilder();
for (char c : file_text.toCharArray()) {
if (Utils.isEnglishLetter(c) || Character.isDigit(c) || Utils.isSign(c)) {
res_text.append(c);
} else if (Utils.isRussianLetter(c))
res_text.append(Utils.Translit(c));
else res_text.append(' ');
}
File dst = Paths.get(target.last_version.Home.getAbsolutePath(), Global.isWindows ? file.name : file.name.replace('\\', '/')).toFile();
FileUtils.write(dst, res_text.toString());
}
}
}