ICE 3.4.2
[php5-ice-freebsdport.git] / cs / demo / book / lifecycle / Filesystem.ice
bloba677b645d7785745aca29801b5d997d257b2ab22
1 // **********************************************************************
2 //
3 // Copyright (c) 2003-2011 ZeroC, Inc. All rights reserved.
4 //
5 // This copy of Ice is licensed to you under the terms described in the
6 // ICE_LICENSE file included in this distribution.
7 //
8 // **********************************************************************
10 module Filesystem {
11     exception GenericError
12     {
13         string reason;
14     };
15     exception PermissionDenied extends GenericError {};
16     exception NameInUse extends GenericError {};
17     exception NoSuchName extends GenericError {};
19     interface Node
20     {
21         idempotent string name();
22         void destroy() throws PermissionDenied;
23     };
25     sequence<string> Lines;
27     interface File extends Node
28     {
29         idempotent Lines read();
30         idempotent void write(Lines text) throws GenericError;
31     };
33     enum NodeType { DirType, FileType };
35     struct NodeDesc
36     {
37         string name;
38         NodeType type;
39         Node* proxy;
40     };
42     sequence<NodeDesc> NodeDescSeq;
44     interface Directory extends Node
45     {
46         idempotent NodeDescSeq list();
47         idempotent NodeDesc find(string name) throws NoSuchName;
48         File* createFile(string name) throws NameInUse;
49         Directory* createDirectory(string name) throws NameInUse;
50     };