diff options
Diffstat (limited to 'autodoc/inc/ary/loc')
-rw-r--r-- | autodoc/inc/ary/loc/loc_dir.hxx | 145 | ||||
-rw-r--r-- | autodoc/inc/ary/loc/loc_file.hxx | 68 | ||||
-rw-r--r-- | autodoc/inc/ary/loc/loc_filebase.hxx | 72 | ||||
-rw-r--r-- | autodoc/inc/ary/loc/loc_le.hxx | 94 | ||||
-rw-r--r-- | autodoc/inc/ary/loc/loc_root.hxx | 110 | ||||
-rw-r--r-- | autodoc/inc/ary/loc/loc_traits.hxx | 115 | ||||
-rw-r--r-- | autodoc/inc/ary/loc/loc_types4loc.hxx | 54 | ||||
-rw-r--r-- | autodoc/inc/ary/loc/locp_le.hxx | 88 |
8 files changed, 746 insertions, 0 deletions
diff --git a/autodoc/inc/ary/loc/loc_dir.hxx b/autodoc/inc/ary/loc/loc_dir.hxx new file mode 100644 index 000000000000..4d63d526b6df --- /dev/null +++ b/autodoc/inc/ary/loc/loc_dir.hxx @@ -0,0 +1,145 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_LOC_DIR_HXX +#define ARY_LOC_DIR_HXX + +// BASE CLASSES +#include <ary/loc/loc_le.hxx> + +// USED SERVICES +#include <ary/loc/loc_traits.hxx> +#include <ary/symtreenode.hxx> + +namespace ary +{ +namespace loc +{ + class File; +} +} + + + + +namespace ary +{ +namespace loc +{ + + +/** Represents a directory for source code files. +*/ +class Directory : public LocationEntity +{ + public: + enum E_ClassId { class_id = 7030 }; + + typedef ::ary::symtree::Node<LeNode_Traits> node_t; + + /// Used for root directories. + explicit Directory( + Le_id i_assignedRoot ); + + /// Used for subdirectories which have a parent directory. + Directory( + const String & i_localName, + Le_id i_parentDirectory ); + virtual ~Directory(); + + void Add_Dir( + const Directory & i_dir ); + void Add_File( + const File & i_file ); + + Le_id Parent() const; + Le_id AssignedRoot() const; + + Le_id Search_Dir( + const String & i_name ) const; + Le_id Search_File( + const String & i_name ) const; + + const node_t & AsNode() const; + node_t & AsNode(); + + private: + struct Container; + + // Interface csv::ConstProcessorClient: + virtual void do_Accept( + csv::ProcessorIfc & io_processor ) const; + // Interface ary::Object: + virtual ClassId get_AryClass() const; + + // Interface LocationEntity: + virtual const String & + inq_LocalName() const; + virtual Le_id inq_ParentDirectory() const; + + // DATA + String sLocalName; + Le_id nParentDirectory; + Le_id nAssignedRoot; + node_t aAssignedNode; + Dyn<Container> pChildren; +}; + + + + +// IMPLEMENTATION +inline Le_id +Directory::Parent() const +{ + return nParentDirectory; +} + +inline Le_id +Directory::AssignedRoot() const +{ + return nAssignedRoot; +} + +inline const Directory::node_t & +Directory::AsNode() const +{ + return aAssignedNode; +} + +inline Directory::node_t & +Directory::AsNode() +{ + return aAssignedNode; +} + + + + +} // namespace loc +} // namespace ary +#endif diff --git a/autodoc/inc/ary/loc/loc_file.hxx b/autodoc/inc/ary/loc/loc_file.hxx new file mode 100644 index 000000000000..63586ad4977d --- /dev/null +++ b/autodoc/inc/ary/loc/loc_file.hxx @@ -0,0 +1,68 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_LOC_FILE_HXX +#define ARY_LOC_FILE_HXX + +// BASE CLASSES +#include <ary/loc/loc_filebase.hxx> + + + + +namespace ary +{ +namespace loc +{ + + +/** Represents an unspecified source code file. +*/ +class File : public FileBase +{ + public: + enum E_ClassId { class_id = 7100 }; + + File( + const String & i_sLocalName, + Le_id i_nParentDirectory ); + virtual ~File(); + + private: + // Interface csv::ConstProcessorClient: + virtual void do_Accept( + csv::ProcessorIfc & io_processor ) const; + // Interface ary::Object: + virtual ClassId get_AryClass() const; +}; + + + + +} // namespace loc +} // namespace ary +#endif diff --git a/autodoc/inc/ary/loc/loc_filebase.hxx b/autodoc/inc/ary/loc/loc_filebase.hxx new file mode 100644 index 000000000000..8cb5c98cbc85 --- /dev/null +++ b/autodoc/inc/ary/loc/loc_filebase.hxx @@ -0,0 +1,72 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_LOC_FILEBASE_HXX +#define ARY_LOC_FILEBASE_HXX + +// USED SERVICES + // BASE CLASSES +#include <ary/loc/loc_le.hxx> + // COMPONENTS + // PARAMETERS + + +namespace ary +{ +namespace loc +{ + + + +/** Base class for classes representing source code files. +*/ +class FileBase : public LocationEntity +{ + public: + virtual ~FileBase() {} + + protected: + FileBase( + const String & i_localName , + Le_id i_parentDirectory ); + private: + // Interface LocationEntity: + virtual const String & + inq_LocalName() const; + virtual Le_id inq_ParentDirectory() const; + + // DATA + String sLocalName; + Le_id nParentDirectory; +}; + + + + +} // namespace loc +} // namespace ary +#endif diff --git a/autodoc/inc/ary/loc/loc_le.hxx b/autodoc/inc/ary/loc/loc_le.hxx new file mode 100644 index 000000000000..fdf3ad077df5 --- /dev/null +++ b/autodoc/inc/ary/loc/loc_le.hxx @@ -0,0 +1,94 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_LOC_LE_HXX +#define ARY_LOC_LE_HXX + +// USED SERVICES + // BASE CLASSES +#include <ary/entity.hxx> + // COMPONENTS + // PARAMETERS +#include <ary/loc/loc_types4loc.hxx> +#include <ary/loc/loc_traits.hxx> + + + +namespace ary +{ +namespace loc +{ + + +/** Base class for all file locations in the Autodoc repository. +*/ +class LocationEntity : public ::ary::Entity +{ + public: + typedef Le_Traits traits_t; + + virtual ~LocationEntity() {} + + Le_id LeId() const; + const String & LocalName() const; + Le_id ParentDirectory() const; + + private: + virtual const String & + inq_LocalName() const = 0; + virtual Le_id inq_ParentDirectory() const = 0; +}; + + + + +// IMPLEMENTATION +inline Le_id +LocationEntity::LeId() const +{ + return TypedId<LocationEntity>(Id()); +} + +inline const String & +LocationEntity::LocalName() const +{ + return inq_LocalName(); +} + +inline Le_id +LocationEntity::ParentDirectory() const +{ + return inq_ParentDirectory(); +} + + + + + +} // namespace loc +} // namespace ary +#endif diff --git a/autodoc/inc/ary/loc/loc_root.hxx b/autodoc/inc/ary/loc/loc_root.hxx new file mode 100644 index 000000000000..5b789a8cbeaa --- /dev/null +++ b/autodoc/inc/ary/loc/loc_root.hxx @@ -0,0 +1,110 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_LOC_PROJECT_HXX +#define ARY_LOC_PROJECT_HXX + +// BASE CLASSES +#include <ary/loc/loc_le.hxx> +// USED SERVICES +#include <cosv/ploc.hxx> +#include <ary/loc/loc_dir.hxx> + + + + +namespace ary +{ +namespace loc +{ + + +/** Represents a root directory for source files. +*/ +class Root : public LocationEntity +{ + public: + enum E_ClassId { class_id = 7000 }; + + explicit Root( + const csv::ploc::Path & + i_rRootDirectoryPath ); + void Assign_Directory( + Le_id i_assignedDirectory ); + virtual ~Root(); + + // INQUIRY + const csv::ploc::Path & + Path() const; + Le_id MyDir() const; + + private: + // Interface csv::ConstProcessorClient: + virtual void do_Accept( + csv::ProcessorIfc & io_processor ) const; + // Interface ary::Object: + virtual ClassId get_AryClass() const; + + // Interface LocationEntity: + virtual const String & + inq_LocalName() const; + virtual Le_id inq_ParentDirectory() const; + + // DATA + csv::ploc::Path aPath; + String sPathAsString; + Le_id aMyDirectory; +}; + + + + +// IMPLEMENTATION +inline void +Root::Assign_Directory(Le_id i_assignedDirectory) +{ + aMyDirectory = i_assignedDirectory; +} + +inline const csv::ploc::Path & +Root::Path() const +{ + return aPath; +} + +inline Le_id +Root::MyDir() const +{ + return aMyDirectory; +} + + + + +} // namespace loc +} // namespace ary +#endif diff --git a/autodoc/inc/ary/loc/loc_traits.hxx b/autodoc/inc/ary/loc/loc_traits.hxx new file mode 100644 index 000000000000..52cd6dd9b22b --- /dev/null +++ b/autodoc/inc/ary/loc/loc_traits.hxx @@ -0,0 +1,115 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_LOC_TRAITS_HXX +#define ARY_LOC_TRAITS_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <ary/loc/loc_types4loc.hxx> + + +namespace ary +{ +namespace symtree +{ + template <class> class Node; +} +} + + + + +namespace ary +{ +namespace loc +{ + + + +/** Basic traits for derived ones of ->LocationEntity. +*/ +struct Le_Traits +{ + typedef LocationEntity entity_base_type; + typedef Le_id id_type; + + static entity_base_type & + EntityOf_( + id_type i_id ); +}; + + +/** An instance of SYMBOL_TRAITS for ->::ary::symtree::Node. + + @see ::ary::symtree::Node +*/ +struct LeNode_Traits : public Le_Traits +{ + static symtree::Node<LeNode_Traits> * + NodeOf_( + entity_base_type & i_entity ); + + static entity_base_type * + ParentOf_( + const entity_base_type & + i_entity ); + template <class KEY> + static id_type Search_( + const entity_base_type & + i_entity, + const KEY & i_localKey ); +}; + + + +/** An instance of COMPARE for ->::ary::SortedIds<>. + + @see ::ary::SortedIds<> +*/ +struct Le_Compare : public Le_Traits +{ + typedef String key_type; + + static const key_type & + KeyOf_( + const entity_base_type & + i_entity ); + static bool Lesser_( + const key_type & i_1, + const key_type & i_2 ); +}; + + + + + +} // namespace loc +} // namespace ary +#endif diff --git a/autodoc/inc/ary/loc/loc_types4loc.hxx b/autodoc/inc/ary/loc/loc_types4loc.hxx new file mode 100644 index 000000000000..fd45476a7187 --- /dev/null +++ b/autodoc/inc/ary/loc/loc_types4loc.hxx @@ -0,0 +1,54 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_LOC_TYPES4LOC_HXX +#define ARY_LOC_TYPES4LOC_HXX + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <ary/types.hxx> + + +namespace ary +{ +namespace loc +{ + +class LocationEntity; + + + +typedef ::ary::TypedId<LocationEntity> Le_id; + + + + +} // namespace loc +} // namespace ary +#endif diff --git a/autodoc/inc/ary/loc/locp_le.hxx b/autodoc/inc/ary/loc/locp_le.hxx new file mode 100644 index 000000000000..585282f233f6 --- /dev/null +++ b/autodoc/inc/ary/loc/locp_le.hxx @@ -0,0 +1,88 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#ifndef ARY_LOCP_LE_HXX +#define ARY_LOCP_LE_HXX + + +// USED SERVICES + // BASE CLASSES + // COMPONENTS + // PARAMETERS +#include <cosv/ploc.hxx> +#include <ary/loc/loc_types4loc.hxx> + + +namespace ary +{ +namespace loc +{ + class Root; + class Directory; + class File; +} +} + + +namespace ary +{ +namespace loc +{ + + + +/** Provides access to files and directories stored in the + repository. +*/ +class LocationPilot +{ + public: + virtual ~LocationPilot() {} + + virtual Root & CheckIn_Root( + const csv::ploc::Path & + i_rPath ) = 0; + virtual File & CheckIn_File( + const String & i_name, + const csv::ploc::DirectoryChain & + i_subPath, + Le_id i_root ) = 0; + + virtual Root & Find_Root( + Le_id i_id ) const = 0; + virtual Directory & Find_Directory( + Le_id i_id ) const = 0; + virtual File & Find_File( + Le_id i_id ) const = 0; +}; + + + + +} // namespace loc +} // namespace ary +#endif |