merge the formfield patch from ooo-build
[ooovba.git] / autodoc / source / ary / loc / loc_dir.cxx
blob7a80e9c0d0dfaced7c939e34472b78cda2dbb548
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.cxx,v $
10 * $Revision: 1.6 $
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 #include <precomp.h>
32 #include <ary/loc/loc_dir.hxx>
35 // NOT FULLY DEFINED SERVICES
36 #include <ary/loc/loc_file.hxx>
37 #include <sortedids.hxx>
38 #include "locs_le.hxx"
41 namespace ary
43 namespace loc
46 struct Directory::Container
48 typedef SortedIds<Le_Compare> SortedChildList;
50 SortedChildList aSubDirectories;
51 SortedChildList aFiles;
53 Container()
54 : aSubDirectories(),
55 aFiles()
62 Directory::Directory(Le_id i_assignedRoot)
63 : sLocalName(),
64 nParentDirectory(0),
65 nAssignedRoot(i_assignedRoot),
66 aAssignedNode(),
67 pChildren(new Container)
69 aAssignedNode.Assign_Entity(*this);
72 Directory::Directory( const String & i_localName,
73 Le_id i_parentDirectory )
74 : sLocalName(i_localName),
75 nParentDirectory(i_parentDirectory),
76 nAssignedRoot(0),
77 aAssignedNode(),
78 pChildren(new Container)
80 aAssignedNode.Assign_Entity(*this);
83 Directory::~Directory()
87 void
88 Directory::Add_Dir(const Directory & i_dir)
90 pChildren->aSubDirectories.Add(i_dir.LeId());
93 void
94 Directory::Add_File(const File & i_file)
96 pChildren->aFiles.Add(i_file.LeId());
99 Le_id
100 Directory::Search_Dir(const String & i_name) const
102 return pChildren->aSubDirectories.Search(i_name);
105 Le_id
106 Directory::Search_File(const String & i_name) const
108 return pChildren->aFiles.Search(i_name);
111 void
112 Directory::do_Accept(csv::ProcessorIfc & io_processor) const
114 csv::CheckedCall(io_processor,*this);
117 ClassId
118 Directory::get_AryClass() const
120 return class_id;
123 const String &
124 Directory::inq_LocalName() const
126 return sLocalName;
129 Le_id
130 Directory::inq_ParentDirectory() const
132 return nParentDirectory;
136 } // namespace loc
137 } // namespace ary