Mercurial > projects > dbus-d
comparison dbus-d-javatests/jsrc/filetree/DataFileSystem.d @ 0:a5576806d36d
recreate repository without any libs for lightweight repository
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Sat, 20 Oct 2007 18:07:18 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:a5576806d36d |
---|---|
1 /* | |
2 * Generated with TioLink | |
3 * TioLink was written by Frank Benoit <benoit@tionex.de> | |
4 * http://www.dsource.org/projects/tiolink | |
5 * | |
6 * User specific code can be place after the generated comment line containing: | |
7 * "USER CONTENT STARTS HERE". | |
8 * Everything before that line will be programmatically overwritten. | |
9 * | |
10 * File type: D programming language source code | |
11 */ | |
12 module filetree.DataFileSystem; | |
13 | |
14 import org.freedesktop.dbus.DBus; | |
15 import org.freedesktop.dbus.Introspectable; | |
16 | |
17 // Interface for DataFileSystem | |
18 | |
19 interface DataFileSystem : org.freedesktop.dbus.DBusInterface.DBusInterface { | |
20 public filetree.DataItem.DataItem[] getRoots(); | |
21 const static char[] introspectionXml = | |
22 `<interface name="filetree.DataFileSystem"/>`\n | |
23 ` <method name="getRoots">`\n | |
24 ` <arg name="p0" type="ao" direction="out"/>`\n | |
25 ` </method>`\n | |
26 `</interface>`\n | |
27 ; | |
28 } | |
29 | |
30 CConnection.DBusHandlerResult intfHandler__filetree_DataFileSystem_DataFileSystem( CConnection.DBusConnection* conn, CConnection.DBusMessage* message, void* user_data ){ | |
31 DataFileSystem o = cast(DataFileSystem)cast(Object)user_data; | |
32 if( o is null || !checkIntf( "filetree.DataFileSystem", message) ) | |
33 return CConnection.DBusHandlerResult.DBUS_HANDLER_RESULT_NOT_YET_HANDLED; | |
34 | |
35 try{ | |
36 char[METHOD_SIG_MAXLENGTH] buf; | |
37 switch( methodSignature( message, buf ) ){ | |
38 case "getRoots|": | |
39 { | |
40 filetree.DataItem.DataItem[] callResult = o.getRoots(); | |
41 sendReply( conn, message, callResult ); | |
42 } | |
43 break; | |
44 default: | |
45 return CConnection.DBusHandlerResult.DBUS_HANDLER_RESULT_NOT_YET_HANDLED; | |
46 } | |
47 } | |
48 catch( Exception e ){ | |
49 sendException( conn, message, e ); | |
50 } | |
51 return CConnection.DBusHandlerResult.DBUS_HANDLER_RESULT_HANDLED; | |
52 } | |
53 void intfFree__filetree_DataFileSystem_DataFileSystem( CConnection.DBusConnection *connection, void *user_data ){ | |
54 } | |
55 | |
56 | |
57 // Dimpl for MyDataFileSystem | |
58 | |
59 extern(C) CConnection.DBusHandlerResult dimplHandler__filetree_DataFileSystem_MyDataFileSystem( CConnection.DBusConnection* conn, CConnection.DBusMessage* message, void* user_data ){ | |
60 CConnection.DBusHandlerResult res = CConnection.DBusHandlerResult.DBUS_HANDLER_RESULT_NOT_YET_HANDLED; | |
61 if( res == CConnection.DBusHandlerResult.DBUS_HANDLER_RESULT_NOT_YET_HANDLED ){ | |
62 res = intfHandler__filetree_DataFileSystem_DataFileSystem( conn, message, user_data ); | |
63 } | |
64 if( res == CConnection.DBusHandlerResult.DBUS_HANDLER_RESULT_NOT_YET_HANDLED ){ | |
65 res = intfHandler__org_freedesktop_dbus_Introspectable_Introspectable( conn, message, user_data ); | |
66 } | |
67 return res; | |
68 } | |
69 | |
70 extern(C) void dimplFree__filetree_DataFileSystem_MyDataFileSystem( CConnection.DBusConnection *connection, void *user_data ){ | |
71 } | |
72 | |
73 CConnection.DBusObjectPathVTable vtable__filetree_DataFileSystem_MyDataFileSystem = { | |
74 unregister_function : & dimplFree__filetree_DataFileSystem_MyDataFileSystem, | |
75 message_function : & dimplHandler__filetree_DataFileSystem_MyDataFileSystem | |
76 }; | |
77 | |
78 | |
79 static assert( is( MyDataFileSystem : filetree.DataFileSystem.DataFileSystem )); | |
80 static assert( is( MyDataFileSystem : org.freedesktop.dbus.Introspectable.Introspectable )); | |
81 | |
82 // --- USER CONTENT STARTS HERE (do not change this marker line) --- | |
83 import tango.io.Stdout; | |
84 import tango.io.FileRoots; | |
85 import tango.io.FilePath; | |
86 import filetree.DataItem; | |
87 | |
88 class MyDataFileSystem : DBusObject, DataFileSystem, Introspectable { | |
89 | |
90 public this(){ | |
91 super( this.classinfo ); | |
92 } | |
93 | |
94 public DBusObjectPathVTable* getDBusVTable(){ | |
95 return &vtable__filetree_DataFileSystem_MyDataFileSystem; | |
96 } | |
97 | |
98 public DataItem[] getRoots(){ | |
99 auto roots = FileRoots.list(); | |
100 DataItem[] res = new DataItem[ roots.length ]; | |
101 for( int i = 0; i < roots.length; i++ ){ | |
102 res[i] = new MyDataItem( new FilePath(roots[i]) ); | |
103 } | |
104 return res; | |
105 } | |
106 public char[] Introspect(){ | |
107 Stdout.formatln( "FileSys inspect" ); | |
108 return buildIntrospect( [DataFileSystem.introspectionXml, Introspectable.introspectionXml ], null ); | |
109 } | |
110 /+ | |
111 public this( char[] path ){ | |
112 super( new FilePath( path )); | |
113 } | |
114 | |
115 public String getName(){ | |
116 char[] name = file.toUtf8(); | |
117 Stdout.formatln( "{} {} {}", __LINE__, __FILE__, name ); | |
118 auto res = toJavaString( name ); | |
119 Stdout.formatln( "{} {} ", __LINE__, __FILE__ ); | |
120 return res; | |
121 // return toJavaString( file.name() ); | |
122 } | |
123 | |
124 public override bool isFolder(){ | |
125 return true; | |
126 } | |
127 public override bool isDrive(){ | |
128 return true; | |
129 } | |
130 +/ | |
131 } | |
132 | |
133 | |
134 | |
135 |