merge the formfield patch from ooo-build
[ooovba.git] / autodoc / inc / ary / loc / loc_dir.hxx
blob63acc34fbdbc28063cefc482bd31976b2f0a1bf7
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: loc_dir.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef ARY_LOC_DIR_HXX
32 #define ARY_LOC_DIR_HXX
34 // BASE CLASSES
35 #include <ary/loc/loc_le.hxx>
37 // USED SERVICES
38 #include <ary/loc/loc_traits.hxx>
39 #include <ary/symtreenode.hxx>
41 namespace ary
43 namespace loc
45 class File;
52 namespace ary
54 namespace loc
58 /** Represents a directory for source code files.
60 class Directory : public LocationEntity
62 public:
63 enum E_ClassId { class_id = 7030 };
65 typedef ::ary::symtree::Node<LeNode_Traits> node_t;
67 /// Used for root directories.
68 explicit Directory(
69 Le_id i_assignedRoot );
71 /// Used for subdirectories which have a parent directory.
72 Directory(
73 const String & i_localName,
74 Le_id i_parentDirectory );
75 virtual ~Directory();
77 void Add_Dir(
78 const Directory & i_dir );
79 void Add_File(
80 const File & i_file );
82 Le_id Parent() const;
83 Le_id AssignedRoot() const;
85 Le_id Search_Dir(
86 const String & i_name ) const;
87 Le_id Search_File(
88 const String & i_name ) const;
90 const node_t & AsNode() const;
91 node_t & AsNode();
93 private:
94 struct Container;
96 // Interface csv::ConstProcessorClient:
97 virtual void do_Accept(
98 csv::ProcessorIfc & io_processor ) const;
99 // Interface ary::Object:
100 virtual ClassId get_AryClass() const;
102 // Interface LocationEntity:
103 virtual const String &
104 inq_LocalName() const;
105 virtual Le_id inq_ParentDirectory() const;
107 // DATA
108 String sLocalName;
109 Le_id nParentDirectory;
110 Le_id nAssignedRoot;
111 node_t aAssignedNode;
112 Dyn<Container> pChildren;
118 // IMPLEMENTATION
119 inline Le_id
120 Directory::Parent() const
122 return nParentDirectory;
125 inline Le_id
126 Directory::AssignedRoot() const
128 return nAssignedRoot;
131 inline const Directory::node_t &
132 Directory::AsNode() const
134 return aAssignedNode;
137 inline Directory::node_t &
138 Directory::AsNode()
140 return aAssignedNode;
146 } // namespace loc
147 } // namespace ary
148 #endif