================ idFileSystemLocal::DirTree_f ================ */
| 1940 | ================ |
| 1941 | */ |
| 1942 | void idFileSystemLocal::DirTree_f( const idCmdArgs &args ) { |
| 1943 | idStr relativePath; |
| 1944 | idStr extension; |
| 1945 | idFileList *fileList; |
| 1946 | int i; |
| 1947 | |
| 1948 | if ( args.Argc() < 2 || args.Argc() > 3 ) { |
| 1949 | common->Printf( "usage: dirtree <directory> [extension]\n" ); |
| 1950 | return; |
| 1951 | } |
| 1952 | |
| 1953 | if ( args.Argc() == 2 ) { |
| 1954 | relativePath = args.Argv( 1 ); |
| 1955 | extension = ""; |
| 1956 | } |
| 1957 | else { |
| 1958 | relativePath = args.Argv( 1 ); |
| 1959 | extension = args.Argv( 2 ); |
| 1960 | if ( extension[0] != '.' ) { |
| 1961 | common->Warning( "extension should have a leading dot" ); |
| 1962 | } |
| 1963 | } |
| 1964 | relativePath.BackSlashesToSlashes(); |
| 1965 | relativePath.StripTrailing( '/' ); |
| 1966 | |
| 1967 | common->Printf( "Listing of %s/*%s /s\n", relativePath.c_str(), extension.c_str() ); |
| 1968 | common->Printf( "---------------\n" ); |
| 1969 | |
| 1970 | fileList = fileSystemLocal.ListFilesTree( relativePath, extension ); |
| 1971 | |
| 1972 | for ( i = 0; i < fileList->GetNumFiles(); i++ ) { |
| 1973 | common->Printf( "%s\n", fileList->GetFile( i ) ); |
| 1974 | } |
| 1975 | common->Printf( "%d files\n", fileList->list.Num() ); |
| 1976 | |
| 1977 | fileSystemLocal.FreeFileList( fileList ); |
| 1978 | } |
| 1979 | |
| 1980 | /* |
| 1981 | ============ |
nothing calls this directly
no test coverage detected