Hello Michael,

On 05/25/2011 01:43 AM, Michael Raab wrote:
that solution doesn't solve the issue. Writing seems to be fine, but loading 
throws lots of warnings and the loaded content has some errors that hard to 
guess at the moment.
To me the cleanest solution would be, to avoid writing internal attachments 
inside the NFIO writer. Do you think it is a hard task to extend the writer in 
this direction?

I don't think so, actually something like the attached (not tested) should do it.

        Cheers,
                Carsten
Index: Source/Experimental/NativeFileIO/OSGNFIOBase.cpp
===================================================================
RCS file: 
/cvsroot/opensg/OpenSG/Source/Experimental/NativeFileIO/OSGNFIOBase.cpp,v
retrieving revision 1.18
diff -u -r1.18 OSGNFIOBase.cpp
--- Source/Experimental/NativeFileIO/OSGNFIOBase.cpp    31 Aug 2008 10:30:35 
-0000      1.18
+++ Source/Experimental/NativeFileIO/OSGNFIOBase.cpp    25 May 2011 17:14:01 
-0000
@@ -873,6 +873,13 @@
 
     for(; mapIt != mapEnd; ++mapIt)
     {
+        // skip Attachments marked as internal
+        if(mapIt->second                              != NullFC &&
+           mapIt->second->getSFInternal()->getValue() == true     )
+        {
+            continue;
+        }
+
         writeFCId(mapIt->second);
     }
 
@@ -881,6 +888,13 @@
     mapIt = amap->getValue().begin();
     for(; mapIt != mapEnd; ++mapIt)
     {
+        // skip Attachments marked as internal
+        if(mapIt->second                              != NullFC &&
+           mapIt->second->getSFInternal()->getValue() == true     )
+        {
+            continue;
+        }
+
         id_binding = UInt16(mapIt->first & 0x0000ffff);
         if(id_binding != 0)
             break;
@@ -893,11 +907,17 @@
         mapIt = amap->getValue().begin();
         for(; mapIt != mapEnd; ++mapIt)
         {
+            // skip Attachments marked as internal
+            if(mapIt->second                              != NullFC &&
+               mapIt->second->getSFInternal()->getValue() == true     )
+            {
+                continue;
+            }
+
             id_binding = UInt16(mapIt->first & 0x0000ffff);
             _out->putValue(id_binding);
         }
     }
-
 }
 
 void NFIOBase::readEndMarker(void)
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Opensg-users mailing list
Opensg-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to