Data update
This commit is contained in:
parent
5150844a7d
commit
4bb20c9b71
7735 changed files with 38060 additions and 199180 deletions
|
|
@ -1,36 +0,0 @@
|
|||
with Ada.Text_IO, Ada.Directories;
|
||||
|
||||
procedure Directory_Tree is
|
||||
|
||||
procedure Print_Tree(Current: String; Indention: Natural := 0) is
|
||||
|
||||
function Spaces(N: Natural) return String is
|
||||
(if N= 0 then "" else " " & Spaces(N-1));
|
||||
|
||||
use Ada.Directories;
|
||||
Search: Search_Type;
|
||||
Found: Directory_Entry_Type;
|
||||
|
||||
begin
|
||||
Start_Search(Search, Current, "");
|
||||
while More_Entries(Search) loop
|
||||
Get_Next_Entry(Search, Found);
|
||||
declare
|
||||
Name: String := Simple_Name(Found);
|
||||
Dir: Boolean := Kind(Found) = Directory;
|
||||
begin
|
||||
if Name(Name'First) /= '.' then
|
||||
-- skip all files who's names start with ".", namely "." and ".."
|
||||
Ada.Text_IO.Put_Line(Spaces(2*Indention) & Simple_Name(Found)
|
||||
& (if Dir then " (dir)" else ""));
|
||||
if Dir then
|
||||
Print_Tree(Full_Name(Found), Indention + 1);
|
||||
end if;
|
||||
end if;
|
||||
end;
|
||||
end loop;
|
||||
end Print_Tree;
|
||||
|
||||
begin
|
||||
Print_Tree(Ada.Directories.Current_Directory);
|
||||
end Directory_Tree;
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
/// a program to produce a visual representation of some tree.
|
||||
|
||||
import system'routines;
|
||||
import extensions;
|
||||
|
||||
|
|
@ -17,7 +19,7 @@ class Node
|
|||
<= new(value, new Node[](0));
|
||||
|
||||
constructor new(Node[] children)
|
||||
<= new(emptyString, children);
|
||||
<= new(EmptyString, children);
|
||||
|
||||
get() = theValue;
|
||||
|
||||
|
|
@ -48,7 +50,7 @@ extension treeOp
|
|||
= self.writeTree(node,"");
|
||||
}
|
||||
|
||||
public program()
|
||||
public Program()
|
||||
{
|
||||
var tree := Node.new(
|
||||
new Node[]{
|
||||
|
|
@ -60,5 +62,5 @@ public program()
|
|||
Node.new("e")
|
||||
});
|
||||
|
||||
console.writeTree(tree).readChar()
|
||||
Console.writeTree(tree).readChar()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue