{
// check map of readers
Handle(PCDM_RetrievalDriver) aReader;
- if (myReaders.Find (theFormat, aReader))
+ if (myReaders.FindFromKey (theFormat, aReader))
return aReader;
// support of legacy method of loading reader as plugin
aResourceName += ".RetrievalPlugin";
if (!UTL::Find(Resources(), aResourceName))
{
- myReaders.Bind(theFormat, aReader);
+ myReaders.Add(theFormat, aReader);
Standard_SStream aMsg;
aMsg << "Could not found the item:" << aResourceName <<(char)0;
myRetrievableStatus = PCDM_RS_WrongResource;
}
catch (Standard_Failure)
{
- myReaders.Bind(theFormat, aReader);
+ myReaders.Add(theFormat, aReader);
myRetrievableStatus = PCDM_RS_WrongResource;
Standard_Failure::Caught()->Reraise();
}
}
// record in map
- myReaders.Bind (theFormat, aReader);
+ myReaders.Add(theFormat, aReader);
return aReader;
}
{
// check map of writers
Handle(PCDM_StorageDriver) aDriver;
- if (myWriters.Find (theFormat, aDriver))
+ if (myWriters.FindFromKey(theFormat, aDriver))
return aDriver;
// support of legacy method of loading reader as plugin
aResourceName += ".StoragePlugin";
if(!UTL::Find(Resources(), aResourceName))
{
- myWriters.Bind (theFormat, aDriver);
+ myWriters.Add(theFormat, aDriver);
Standard_SStream aMsg;
aMsg << "Could not found the resource definition:" << aResourceName <<(char)0;
Standard_NoSuchObject::Raise(aMsg);
}
catch (Standard_Failure)
{
- myWriters.Bind (theFormat, aDriver);
+ myWriters.Add(theFormat, aDriver);
myRetrievableStatus = PCDM_RS_WrongResource;
Standard_Failure::Caught()->Reraise();
}
}
// record in map
- myWriters.Bind(theFormat, aDriver);
+ myWriters.Add(theFormat, aDriver);
return aDriver;
}
#include <TColStd_SequenceOfExtendedString.hxx>
#include <CDF_TypeOfActivation.hxx>
#include <Standard_IStream.hxx>
-#include <NCollection_DataMap.hxx>
+#include <NCollection_IndexedDataMap.hxx>
class Standard_NoSuchObject;
class CDF_Session;
Standard_EXPORT CDF_Application();
PCDM_ReaderStatus myRetrievableStatus;
- NCollection_DataMap<TCollection_ExtendedString, Handle(PCDM_RetrievalDriver)> myReaders;
- NCollection_DataMap<TCollection_ExtendedString, Handle(PCDM_StorageDriver)> myWriters;
+ NCollection_IndexedDataMap<TCollection_ExtendedString, Handle(PCDM_RetrievalDriver)> myReaders;
+ NCollection_IndexedDataMap<TCollection_ExtendedString, Handle(PCDM_StorageDriver)> myWriters;
private:
theWriter->SetFormat(theFormat);
// register drivers
- myReaders.Bind (theFormat, theReader);
- myWriters.Bind (theFormat, theWriter);
+ myReaders.Add(theFormat, theReader);
+ myWriters.Add(theFormat, theWriter);
+}
+
+//=======================================================================
+//function : ReadingFormats
+//purpose :
+//=======================================================================
+
+void TDocStd_Application::ReadingFormats(TColStd_SequenceOfAsciiString &theFormats)
+{
+ theFormats.Clear();
+
+ NCollection_IndexedDataMap<TCollection_ExtendedString, Handle(PCDM_RetrievalDriver)>::Iterator
+ anIter(myReaders);
+ for (; anIter.More(); anIter.Next()) {
+ Handle(PCDM_RetrievalDriver) aDriver = anIter.Value();
+ if (aDriver.IsNull() == Standard_False) {
+ theFormats.Append(anIter.Key());
+ }
+ }
+}
+
+//=======================================================================
+//function : WritingFormats
+//purpose :
+//=======================================================================
+
+void TDocStd_Application::WritingFormats(TColStd_SequenceOfAsciiString &theFormats)
+{
+ theFormats.Clear();
+
+ NCollection_IndexedDataMap<TCollection_ExtendedString, Handle(PCDM_StorageDriver)>::Iterator
+ anIter(myWriters);
+ for (; anIter.More(); anIter.Next()) {
+ Handle(PCDM_StorageDriver) aDriver = anIter.Value();
+ if (aDriver.IsNull() == Standard_False) {
+ theFormats.Append(anIter.Key());
+ }
+ }
}
//=======================================================================
#include <Standard_CString.hxx>
#include <Standard_Integer.hxx>
#include <Standard_IStream.hxx>
-#include <TColStd_SequenceOfExtendedString.hxx>
+#include <TColStd_SequenceOfAsciiString.hxx>
#include <PCDM_ReaderStatus.hxx>
#include <PCDM_StoreStatus.hxx>
const TCollection_AsciiString& theExtension,
const Handle(PCDM_RetrievalDriver)& theReader,
const Handle(PCDM_StorageDriver)& theWriter);
-
+
+ //! Returns the sequence of reading formats supported by the application.
+ //!
+ //! @param theFormats - sequence of reading formats. Output parameter.
+ Standard_EXPORT void ReadingFormats(TColStd_SequenceOfAsciiString &theFormats);
+
+ //! Returns the sequence of writing formats supported by the application.
+ //!
+ //! @param theFormats - sequence of writing formats. Output parameter.
+ Standard_EXPORT void WritingFormats(TColStd_SequenceOfAsciiString &theFormats);
+
//! returns the number of documents handled by the current applicative session.
Standard_EXPORT Standard_Integer NbDocuments() const;