OSDN Git Service

こっそり、気持ち程度の日本語化しました (UTF-8 / Windows 環境用)。
[ring-lang-081/annotated-ring-with-OmegaT.git] / target / ringpm / core / listoffiles.ring
1 /*
2         名称 :        Ring パッケージ管理プログラム (RingPM) 
3         日付  : 2018年10月31日
4         作者: Mahmoud Fayed <msfclipper@yahoo.com>
5 */
6
7 class ListOfFiles
8
9         func ListAllFiles cPath,cExt
10                 if left(cExt,2) = "*."
11                         cExt = substr(cExt,3)
12                 ok
13                 aList = dir(cPath)
14                 return ListAllFiles_process(cPath,aList,cExt)
15         
16         func ListAllFiles_Process cPath,aList,cExt
17                 aOutput = []
18                 for aSub in aList 
19                         if aSub[2] # ディレクトリ
20                                 cNewPath = cPath + "/" + aSub[1]
21                                 aSubOutput = listAllFiles(cNewPath,cExt)
22                                 for item in aSubOutput 
23                                         aOutput + item
24                                 next 
25                         else            # File
26                                 if cExt != NULL
27                                         if right(aSub[1],len(cExt)+1) = "."+cExt 
28                                                 aOutput + ( cPath + "/" + aSub[1] )
29                                         ok
30                                 else
31                                         aOutput + ( cPath + "/" + aSub[1] )
32                                 ok
33                         ok
34                 next
35                 return aOutput
36