luaCopyFileCfg.lua 829 B

12345678910111213141516171819202122232425262728293031323334
  1. local luaCopyFileCfg= {}
  2. -- basepath 基础路径
  3. -- path 文件上层路径
  4. -- outputDis 输出后的文件上层路径
  5. -- fileName 文件名
  6. luaCopyFileCfg.FileCfg ={
  7. }
  8. function luaCopyFileCfg:Init()
  9. self.curindex = 1
  10. self.MaxIndex = #self.FileCfg
  11. self.curOutput = "_cn"
  12. end
  13. function luaCopyFileCfg:SetOutput(output)
  14. self.curOutput = output
  15. end
  16. function luaCopyFileCfg:GetNextCfg()
  17. if self.curindex >= self.MaxIndex then
  18. return {result = false}
  19. end
  20. local curCfg = self.FileCfg[self.curindex]
  21. self.curindex = self.curindex + 1
  22. local path = curCfg.basepath..curCfg.path..curCfg.fileName
  23. local outputPath = curCfg.basepath..curCfg.path..self.curOutput..'/'..curCfg.fileName
  24. return {result = true,path = path,outputPath = outputPath}
  25. end
  26. return luaCopyFileCfg