///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
// All rights reserved.
//
// This software and its documentation and related materials are owned by
// the Alliance. The software may only be incorporated into application
// programs owned by members of the Alliance, subject to a signed
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable
// trade secrets of the Alliance and its suppliers. The software is also
// protected by copyright law and international treaty provisions. Application
// programs incorporating this software must include the following statement
// with their copyright notices:
//
// This application incorporates Open Design Alliance software pursuant to a license
// agreement with Open Design Alliance.
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
// All rights reserved.
//
// By use of this software, its documentation or related materials, you
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
#ifndef _BCF_3_0_ARCHIVE_H
#define _BCF_3_0_ARCHIVE_H
#include "BcfCommon.h"
#include "BcfValidation.h"
#include "OdGUID.h"
#define STL_USING_MAP
#include "OdaSTL.h"
/** \details
Contains declarations related to working with BCF files content.
*/
namespace OdBcf {
class OdBcfArchiveFolder;
/** \details
A data type that represents a smart pointer to an OdBcfArchiveFolder object.
*/
typedef OdSmartPtr OdBcfArchiveFolderPtr;
class OdBcfValidationContext;
}
/** \details
Contains declarations related to working with data of the BCF format version 3.0.
*/
namespace OdBcf_3_0 {
class OdBcfExtensions;
/** \details
A data type that represents a smart pointer to an OdBcfExtensions object.
*/
typedef OdSmartPtr OdBcfExtensionsPtr;
class OdBcfVersion;
/** \details
A data type that represents a smart pointer to an OdBcfVersion object.
*/
typedef OdSmartPtr OdBcfVersionPtr;
class OdBcfDocumentInfo;
/** \details
A data type that represents a smart pointer to an OdBcfDocumentInfo object.
*/
typedef OdSmartPtr OdBcfDocumentInfoPtr;
class OdBcfProjectInfo;
/** \details
A data type that represents a smart pointer to an OdBcfProjectInfo object.
*/
typedef OdSmartPtr OdBcfProjectInfoPtr;
class OdBcfTopicFolder;
/** \details
A data type that represents a smart pointer to an OdBcfTopicFolder object.
*/
typedef OdSmartPtr OdBcfTopicFolderPtr;
/** \details
A data type that represents an STD map of pairs consisting of OdGUID and a pointer to an OdBcfTopicFolder objects.
*/
typedef std::map OdBcfTopicFolderMap;
class OdBcfSession;
/** \details
A class that provides functionality for working with project archive.
*/
class BCF_3_0_EXPORT OdBcfArchive : public OdRxObject, public OdBcf::OdBcfValidation
{
public:
//DOM-IGNORE-BEGIN
ODRX_DECLARE_MEMBERS(OdBcfArchive);
//DOM-IGNORE-END
/** \details
Creates a new archive object.
\param rootDir [in] A pointer to the archive root directory.
\param pExtensions [in] A pointer to extensions of archive.
\param pVersion [in] A pointer to version of archive.
\param pDocumentInfo [in] A pointer to document info of archive.
\param pProjectInfo [in] A pointer to project info of archive.
\param topics [in] A map of topics in the archive.
\param changed [in] A flag that determines whether the archive was changed after creation (equal to true) or not (equal to false).
\returns A smart pointer to the created OdBcfArchive instance.
*/
static OdSmartPtr createObject(
const OdBcf::OdBcfArchiveFolderPtr &rootDir,
const OdBcfExtensionsPtr &pExtensions,
const OdBcfVersionPtr &pVersion,
const OdBcfDocumentInfoPtr &pDocumentInfo = OdBcfDocumentInfoPtr(),
const OdBcfProjectInfoPtr &pProjectInfo = OdBcfProjectInfoPtr(),
const OdBcfTopicFolderMap &topics = OdBcfTopicFolderMap(),
bool changed = false);
/** \details
Creates a new archive object with default parameters.
*/
OdBcfArchive();
/** \details
Retrieves the archive's root directory.
\returns A smart pointer to the OdBcfArchiveFolder object that represents the root directory.
\remarks
The root directory object returned by the method can't be modified in the calling subroutine.
*/
const OdBcf::OdBcfArchiveFolderPtr& getRootDir() const;
/** \details
Checks whether the archive's root directory is not initialized.
\returns true if the root directory is not initialized; otherwise, the method returns false.
*/
bool isRootDirUnset() const;
/** \details
Retrieves the archive's extensions.
\returns A smart pointer to the OdBcfExtensions object that represents the version.
\remarks
The extensions object returned by the method can't be modified in the calling subroutine.
*/
const OdBcfExtensionsPtr& getExtensions() const;
/** \details
Checks whether the archive's extensions is not initialized.
\returns true if the extensions is not initialized; otherwise, the method returns false.
*/
bool isExtensionsUnset() const;
/** \details
Retrieves the archive's version.
\returns A smart pointer to the OdBcfVersion object that represents the version.
\remarks
The version object returned by the method can't be modified in the calling subroutine.
*/
const OdBcfVersionPtr& getVersion() const;
/** \details
Checks whether the archive's version is not initialized.
\returns true if the version is not initialized; otherwise, the method returns false.
*/
bool isVersionUnset() const;
/** \details
Sets a new document info object for the archive.
\param documentInfoValue [in] A smart pointer to the OdBcfDocumentInfo object to be set.
*/
void setDocumentInfo(const OdBcfDocumentInfoPtr& documentInfoValue);
/** \details
Retrieves the archive's document info.
\returns A smart pointer to the OdBcfDocumentInfo object that represents the document info.
\remarks
The document info object returned by the method can be modified in the calling subroutine.
*/
OdBcfDocumentInfoPtr& getDocumentInfo();
/** \details
Retrieves the archive's document info.
\returns A smart pointer to the OdBcfDocumentInfo object that represents the document info.
\remarks
The document info object returned by the method can't be modified in the calling subroutine.
*/
const OdBcfDocumentInfoPtr& getDocumentInfo() const;
/** \details
Checks whether the archive's document info is not initialized.
\returns true if the document info is not initialized; otherwise, the method returns false.
*/
bool isDocumentInfoUnset() const;
/** \details
Sets a new project info object for the archive.
\param projectInfoValue [in] A smart pointer to the OdBcfProjectInfo object to be set.
*/
void setProjectInfo(const OdBcfProjectInfoPtr &projectInfoValue);
/** \details
Retrieves the archive's project extension.
\returns A smart pointer to the OdBcfProjectInfo object that represents the project extension.
\remarks
The project extension object returned by the method can be modified in the calling subroutine.
*/
OdBcfProjectInfoPtr& getProjectInfo();
/** \details
Retrieves the archive's project extension.
\returns A smart pointer to the OdBcfProjectInfo object that represents the project extension.
\remarks
The project extension object returned by the method can't be modified in the calling subroutine.
*/
const OdBcfProjectInfoPtr& getProjectInfo() const;
/** \details
Checks whether the archive's project extension is not initialized.
\returns true if the project extension is not initialized; otherwise, the method returns false.
*/
bool isProjectInfoUnset() const;
/** \details
Sets new topic folders for the archive.
\param topicsValue [in] A smart pointer to the map of OdBcfTopicFolder objects to be set as archive topics.
*/
void setTopics(const OdBcfTopicFolderMap &topicsValue);
/** \details
Retrieves the archive's topic folders.
\returns A map of the OdBcfTopicFolder objects.
\remarks
The project extension object returned by the method can be modified in the calling subroutine.
*/
OdBcfTopicFolderMap& getTopics();
/** \details
Retrieves the archive's topic folders.
\returns A map of the OdBcfTopicFolder objects.
\remarks
The project extension object returned by the method can't be modified in the calling subroutine.
*/
const OdBcfTopicFolderMap& getTopics() const;
/** \details
Checks whether the archive's topic folders are not initialized.
\returns true if the topic folders map is not initialized; otherwise, the method returns false.
*/
bool isTopicsUnset() const;
/** \details
Retrieves the archive's global unique identifier (GUID).
\returns An OdGUID object that represents the identifier.
*/
const OdGUID& getArchiveGUID() const;
/** \details
Checks whether the archive's global unique identifier (GUID) is not initialized.
\returns true if the GUID is not initialized; otherwise, the method returns false.
*/
bool isArchiveGUIDUnset() const;
//DOM-IGNORE-BEGIN
protected:
OdBcfExtensionsPtr m_pExtensions;
OdBcfVersionPtr m_pVersion;
OdBcfDocumentInfoPtr m_pDocumentInfo;
OdBcfProjectInfoPtr m_pProjectInfo;
OdBcfTopicFolderMap m_topics;
OdGUID m_archiveGUID;
OdBcf::OdBcfArchiveFolderPtr m_rootDir;
bool m_changed;
/** \details
Sets a new root directory for the archive.
\param rootDirValue [in] A smart pointer to the OdBcfArchiveFolder object to be set as a root directory.
*/
void setRootDir(const OdBcf::OdBcfArchiveFolderPtr &rootDirValue);
/** \details
Sets a new extensions for the archive.
\param extensionsValue [in] A smart pointer to the OdBcfExtensions object to be set.
*/
void setExtensions(const OdBcfExtensionsPtr& extensionsValue);
/** \details
Sets a new version for the archive.
\param versionValue [in] A smart pointer to the OdBcfVersion object to be set.
*/
void setVersion(const OdBcfVersionPtr &versionValue);
/** \details
Retrieves the archive's root directory.
\returns A smart pointer to the OdBcfArchiveFolder object that represents the root directory.
\remarks
The object that represents the root directory returned by the method can be modified in the calling subroutine.
*/
OdBcf::OdBcfArchiveFolderPtr& getRootDir();
/** \details
Retrieves the archive's extensions.
\returns A smart pointer to the OdBcfExtensions object that represents the extensions.
\remarks
The object that represents the extensions returned by the method can be modified in the calling subroutine.
*/
OdBcfExtensionsPtr& getExtensions();
/** \details
Retrieves the archive's version.
\returns A smart pointer to the OdBcfVersion object that represents the version.
\remarks
The object that represents the version returned by the method can be modified in the calling subroutine.
*/
OdBcfVersionPtr& getVersion();
/** \details
Checks whether the instance has all required fields initialized.
\param context [in/out] A raw pointer to the validation context to store results in.
\returns true if all required fields are initialized; otherwise, the method returns false.
*/
virtual bool validateData(OdBcf::OdBcfValidationContext *context) const ODRX_OVERRIDE;
friend OdBcfSession;
//DOM-IGNORE-END
};
/** \details
A data type that represents a smart pointer to an OdBcfArchive object.
*/
typedef OdSmartPtr OdBcfArchivePtr;
/** \details
A data type that represents an STD map of pairs consisting of a string and a pointer to an OdBcfArchive objects.
*/
typedef std::map OdBcfArchiveMap;
} //namespace OdBcf_3_0
#endif // _BCF_3_0_ARCHIVE_H