예제 #1
0
def ListNotUtf8SourceFile(srcdir):
    paths = FileUtils.GetAllFiles(srcdir, ".h|.cpp")
    for path in paths:
        if not FileUtils.EnsureUtf8WithChinese(path):
            logging.warning(path)
        pass
    pass
예제 #2
0
def GetAllModuleDirs(src_dir):
    mdl_build_files = FileUtils.GetAllFiles(src_dir, ".Build.cs")
    mdl_dirs = []
    for filepath in mdl_build_files:
        mdl_dir = os.path.dirname(filepath)
        mdl_dirs.append(mdl_dir)
    pass
    return mdl_dirs
예제 #3
0
def NormalizeModuleAPIMacroOfUE4(mdl_dir):
    if not FileUtils.IsUE4ModuleDir(mdl_dir):
        logging.error(
            "NormalizeModuleAPIMacroOfUE4() [%s] Is Not UE4Module!!!", mdl_dir)
        return
    pass
    mdl_name = os.path.basename(mdl_dir)
    api_macro = mdl_name.upper() + "_API"
    paths = FileUtils.GetAllFiles(mdl_dir, ".h")
    for path in paths:
        NormalizeModuleAPIMacro(path, api_macro)
    pass
예제 #4
0
def NormalizeIncludeSlashAuto(dir_or_filepath):
    if not os.path.exists(dir_or_filepath):
        logging.error("[%s] Don't Existed!", dir_or_filepath)
        return
    pass
    if os.path.isdir(dir_or_filepath):
        paths = FileUtils.GetAllFiles(dir_or_filepath, ".h|.cpp")
        for filepath in paths:
            NormalizeIncludeSlash(filepath)
        pass
    else:
        NormalizeIncludeSlash(dir_or_filepath)
    pass
예제 #5
0
def GenResavePackages(basedir, excludes):
    t = time.time() - 4*3600
    exclude_tokens = excludes.split("|")
    paths = FileUtils.GetAllFiles(basedir,".uasset", [0,t])
    f = open(basedir + r"\GenResavePackagesDump.ini", mode="w",encoding="UTF-8")
    for path in paths:
        exclude_flag = False
        for token in exclude_tokens:
            if path.find(token) > 0:
                exclude_flag = True
                break
            pass
        pass
        if exclude_flag:
            continue
        pass
        f.write(path + "\n")
        #logging.warning(path)
    pass
    f.close()
예제 #6
0
 def ParserSourceCode(self):
     Headers = FileUtils.GetAllFiles(self.Dir, ".h")
     for header in Headers:
         self.__ParserHeader(header)
     pass