mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-03 14:10:33 +03:00
0025418: Debug output to be limited to OCC development environment
Macros ending on "DEB" are replaced by OCCT_DEBUG across OCCT code; new macros described in documentation. Macros starting with DEB are changed to start with "OCCT_DEBUG_". Some code cleaned.
This commit is contained in:
@@ -71,13 +71,6 @@ void BinLDrivers_DocumentStorageDriver::Write
|
||||
myMsgDriver = theDocument -> Application() -> MessageDriver();
|
||||
myMapUnsupported.Clear();
|
||||
|
||||
#if defined(_DEBUG) || defined(DEB)
|
||||
TCollection_ExtendedString aMethStr ("BinLDrivers_DocumentStorageDriver, ");
|
||||
#else
|
||||
TCollection_ExtendedString aMethStr;
|
||||
#endif
|
||||
TCollection_ExtendedString anErrorStr ("Error: ");
|
||||
|
||||
Handle(TDocStd_Document) aDoc =
|
||||
Handle(TDocStd_Document)::DownCast(theDocument);
|
||||
if (aDoc.IsNull()) {
|
||||
@@ -111,7 +104,7 @@ void BinLDrivers_DocumentStorageDriver::Write
|
||||
ofstream anOS (aFileName.ToCString(), ios::ate);
|
||||
//ofstream anOS (aFileName.ToCString(), ios::out| ios::binary | ios::ate);
|
||||
#endif
|
||||
#ifdef BINLDRIVERS_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
const Standard_Integer aP = (Standard_Integer) anOS.tellp();
|
||||
cout << "POS = " << aP <<endl;
|
||||
#endif
|
||||
@@ -155,26 +148,21 @@ void BinLDrivers_DocumentStorageDriver::Write
|
||||
|
||||
if (!myRelocTable.Extent()) {
|
||||
// No objects written
|
||||
#ifdef DEB
|
||||
WriteMessage (aMethStr + "no objects written");
|
||||
#ifdef OCCT_DEBUG
|
||||
WriteMessage ("BinLDrivers_DocumentStorageDriver, no objects written");
|
||||
#endif
|
||||
SetIsError(Standard_True);
|
||||
SetStoreStatus(PCDM_SS_No_Obj);
|
||||
|
||||
SetIsError(Standard_True);
|
||||
SetStoreStatus(PCDM_SS_No_Obj);
|
||||
}
|
||||
myRelocTable.Clear();
|
||||
}
|
||||
|
||||
if (!anOS) {
|
||||
// A problem with the stream
|
||||
#if defined(_DEBUG) || defined(DEB)
|
||||
WriteMessage (anErrorStr + aMethStr +
|
||||
"Problem with the file stream, rdstate="
|
||||
#ifdef OCCT_DEBUG
|
||||
TCollection_ExtendedString anErrorStr ("Error: ");
|
||||
WriteMessage (anErrorStr + "BinLDrivers_DocumentStorageDriver, Problem with the file stream, rdstate="
|
||||
+ (Standard_Integer )anOS.rdstate());
|
||||
#else
|
||||
TCollection_ExtendedString aStr =
|
||||
anErrorStr + aMethStr + "Problem writing the file ";
|
||||
WriteMessage (aStr + theFileName);
|
||||
#endif
|
||||
SetIsError(Standard_True);
|
||||
SetStoreStatus(PCDM_SS_WriteFailure);
|
||||
@@ -191,13 +179,13 @@ void BinLDrivers_DocumentStorageDriver::Write
|
||||
void BinLDrivers_DocumentStorageDriver::UnsupportedAttrMsg
|
||||
(const Handle(Standard_Type)& theType)
|
||||
{
|
||||
#ifdef DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
static TCollection_ExtendedString aMsg
|
||||
("BinDrivers_DocumentStorageDriver: warning: attribute driver for type ");
|
||||
#endif
|
||||
if (!myMapUnsupported.Contains(theType)) {
|
||||
myMapUnsupported.Add(theType);
|
||||
#ifdef DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
WriteMessage (aMsg + theType->Name() + " not found");
|
||||
#endif
|
||||
}
|
||||
@@ -245,7 +233,7 @@ void BinLDrivers_DocumentStorageDriver::WriteSubTree
|
||||
// Write data to the stream -->!!!
|
||||
theOS << myPAtt;
|
||||
}
|
||||
#ifdef DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
else
|
||||
UnsupportedAttrMsg (aType);
|
||||
#endif
|
||||
@@ -312,7 +300,7 @@ Standard_Boolean BinLDrivers_DocumentStorageDriver::FirstPassSubTree
|
||||
hasAttr = Standard_True;
|
||||
myTypesMap.Add (aType);
|
||||
}
|
||||
#ifdef DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
else
|
||||
UnsupportedAttrMsg (aType);
|
||||
#endif
|
||||
@@ -369,12 +357,8 @@ void BinLDrivers_DocumentStorageDriver::WriteInfoSection
|
||||
{
|
||||
FSD_BinaryFile aFileDriver;
|
||||
if (aFileDriver.Open( theFileName, Storage_VSWrite ) != Storage_VSOk) {
|
||||
#if defined(DEB) || defined(_DEBUG)
|
||||
WriteMessage ("BinDrivers_DocumentStorageDriver: error opening file");
|
||||
#else
|
||||
WriteMessage (TCollection_ExtendedString("Error: Cannot open file ") +
|
||||
theFileName);
|
||||
#endif
|
||||
SetIsError(Standard_True);
|
||||
return;
|
||||
}
|
||||
@@ -429,15 +413,11 @@ void BinLDrivers_DocumentStorageDriver::WriteInfoSection
|
||||
aFileDriver.EndWriteDataSection();
|
||||
}
|
||||
else {
|
||||
#if defined(DEB) || defined(_DEBUG)
|
||||
WriteMessage("BinDrivers_DocumentStorageDriver: error writing header");
|
||||
#else
|
||||
WriteMessage(TCollection_ExtendedString("Error: Problem writing header "
|
||||
"into file ") + theFileName);
|
||||
#endif
|
||||
SetIsError(Standard_True);
|
||||
}
|
||||
#ifdef BINLDRIVERS_DEB
|
||||
#ifdef OCCT_DEBUG
|
||||
const Standard_Integer aP = (Standard_Integer) aFileDriver.Tell();
|
||||
cout << "POS = " << aP <<endl;
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user