[Liblas-commits] hg-main-tree: add new ReadBlob method that can be called multipl...

liblas-commits at liblas.org liblas-commits at liblas.org
Fri Apr 1 10:16:05 EDT 2011


details:   http://hg.libpc.orghg-main-tree/rev/682a3fe2c2cf
changeset: 489:682a3fe2c2cf
user:      Howard Butler <hobu.inc at gmail.com>
date:      Fri Apr 01 09:15:55 2011 -0500
description:
add new ReadBlob method that can be called multiple times until the blob is entirely read

diffstat:

 include/libpc/drivers/oci/oci_wrapper.h |   2 ++
 src/drivers/oci/oci_wrapper.cpp         |  30 ++++++++++++++++++++++++++++++
 2 files changed, 32 insertions(+), 0 deletions(-)

diffs (52 lines):

diff -r 4100e8e5a35f -r 682a3fe2c2cf include/libpc/drivers/oci/oci_wrapper.h
--- a/include/libpc/drivers/oci/oci_wrapper.h	Fri Apr 01 07:43:52 2011 -0500
+++ b/include/libpc/drivers/oci/oci_wrapper.h	Fri Apr 01 09:15:55 2011 -0500
@@ -451,6 +451,8 @@
                             int nCount );
     unsigned long       ReadBlob( OCILobLocator* phLocator,
                             void* pBuffer, int nSize );
+    bool                ReadBlob( OCILobLocator* phLocator,
+                            void* pBuffer, int nSize, int* nAmountRead );
     char*               ReadCLob( OCILobLocator* phLocator );
     void                WriteCLob( OCILobLocator** pphLocator, char* pszData );
     bool                WriteBlob( OCILobLocator* phLocator,
diff -r 4100e8e5a35f -r 682a3fe2c2cf src/drivers/oci/oci_wrapper.cpp
--- a/src/drivers/oci/oci_wrapper.cpp	Fri Apr 01 07:43:52 2011 -0500
+++ b/src/drivers/oci/oci_wrapper.cpp	Fri Apr 01 09:15:55 2011 -0500
@@ -1645,6 +1645,36 @@
     return nAmont;
 }
 
+bool OWStatement::ReadBlob( OCILobLocator* phLocator,
+                                     void* pBuffer,
+                                     int nSize,
+                                     int* nAmountRead )
+{
+
+    sword status = OCILobRead(
+        poConnection->hSvcCtx,
+        hError,
+        phLocator,
+        (ub4*) nAmountRead,
+        (ub4) 1,
+        (dvoid*) pBuffer,
+        (ub4) nSize,
+        (dvoid *) 0,
+        (OCICallbackLobRead) 0,
+        (ub2) 0,
+        (ub1) SQLCS_IMPLICIT);
+    
+    if (status == OCI_NEED_DATA) 
+    {
+        return false;
+    }
+    
+    if (CheckError(status, hError)) return true;
+    
+    return true;
+}
+
+
 bool OWStatement::WriteBlob( OCILobLocator* phLocator,
                              void* pBuffer,
                              int nSize )


More information about the Liblas-commits mailing list