Added DataVector class to C# code, along with some unit tests.

git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@898 0109f412-320b-0410-ab79-c3e0c5ffbbe6
This commit is contained in:
dsandersoremutah
2006-09-21 23:20:01 +00:00
parent 1f800175b5
commit ef96fb881c
6 changed files with 1544 additions and 67 deletions

View File

@@ -541,6 +541,97 @@ namespace cstest
return( true);
}
//--------------------------------------------------------------------------
// Vector tests
//--------------------------------------------------------------------------
static bool vectorTests(
DbSystem dbSystem)
{
DataVector v;
byte [] b = new byte [] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
byte [] b2;
bool bDataSame;
beginTest( "Creating DataVector");
try
{
v = dbSystem.createDataVector();
}
catch (XFlaimException ex)
{
endTest( false, ex, "calling createDataVector");
return( false);
}
endTest( false, true);
beginTest( "Setting binary data");
try
{
v.setBinary( 0, b);
}
catch (XFlaimException ex)
{
endTest( false, ex, "calling setBinary");
return( false);
}
endTest( false, true);
beginTest( "Getting binary data");
try
{
b2 = v.getBinary( 0);
}
catch (XFlaimException ex)
{
endTest( false, ex, "calling getBinary");
return( false);
}
endTest( false, true);
beginTest( "Comparing set data to get data");
bDataSame = true;
if (b.Length != b2.Length)
{
bDataSame = false;
}
else
{
for( uint uiLoop = 0; uiLoop < b.Length; uiLoop++)
{
if (b [uiLoop] != b2 [uiLoop])
{
bDataSame = false;
break;
}
}
}
if (!bDataSame)
{
endTest( false, false);
System.Console.WriteLine( "Set data does not match get data");
System.Console.Write( "Set Data Length: {0}\n[", b.Length);
for( uint uiLoop = 0; uiLoop < b.Length; uiLoop++)
{
System.Console.Write( "{0} ", b[uiLoop]);
}
System.Console.WriteLine( "]");
System.Console.Write( "Get Data Length: {0}\n[", b2.Length);
for( uint uiLoop = 0; uiLoop < b2.Length; uiLoop++)
{
System.Console.Write( "{0} ", b2[uiLoop]);
}
System.Console.WriteLine( "]");
return( false);
}
endTest( false, true);
return( true);
}
//--------------------------------------------------------------------------
// Main for tester program
//--------------------------------------------------------------------------
@@ -653,6 +744,13 @@ namespace cstest
{
return;
}
// Data vector tests
if (!vectorTests( dbSystem))
{
return;
}
}
}

View File

@@ -29,6 +29,23 @@ using System.Runtime.InteropServices;
namespace xflaim
{
/// <summary>
/// Data types supported in an XFLAIM database.
/// IMPORTANT NOTE: These should be kept in sync with data types defined
/// in xflaim.h
/// </summary>
public enum FlmDataType : int
{
/// <summary>No data may be stored with a node of this type</summary>
XFLM_NODATA_TYPE = 0,
/// <summary>String data - UTF8 - unicode 16 supported</summary>
XFLM_TEXT_TYPE = 1,
/// <summary>Integer numbers - 64 bit signed and unsigned supported</summary>
XFLM_NUMBER_TYPE = 2,
/// <summary>Binary data</summary>
XFLM_BINARY_TYPE = 3
}
/// <summary>
/// DOM Node types
/// </summary>

View File

@@ -0,0 +1,425 @@
//------------------------------------------------------------------------------
// Desc: Native C routines to support C# DataVector class
//
// Tabs: 3
//
// Copyright (c) 2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id$
//------------------------------------------------------------------------------
#include "xflaim.h"
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP void FLMAPI xflaim_DataVector_Release(
FLMUINT64 ui64This)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
if (pDataVector)
{
pDataVector->Release();
}
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP void FLMAPI xflaim_DataVector_setDocumentID(
FLMUINT64 ui64This,
FLMUINT64 ui64DocumentID)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
pDataVector->setDocumentID( ui64DocumentID);
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DataVector_setID(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber,
FLMUINT64 ui64ID)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->setID( (FLMUINT)ui32ElementNumber, ui64ID));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DataVector_setNameId(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber,
FLMUINT32 ui32NameId,
FLMBOOL bIsAttr,
FLMBOOL bIsData)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->setNameId( (FLMUINT)ui32ElementNumber,
(FLMUINT)ui32NameId, bIsAttr, bIsData));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DataVector_setULong(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber,
FLMUINT64 ui64Value)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->setUINT64( (FLMUINT)ui32ElementNumber, ui64Value));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DataVector_setLong(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber,
FLMINT64 i64Value)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->setINT64( (FLMUINT)ui32ElementNumber, i64Value));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DataVector_setUInt(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber,
FLMUINT32 ui32Value)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->setUINT( (FLMUINT)ui32ElementNumber, (FLMUINT)ui32Value));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DataVector_setInt(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber,
FLMINT32 i32Value)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->setINT( (FLMUINT)ui32ElementNumber, (FLMINT)i32Value));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DataVector_setString(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber,
const FLMUNICODE * puzValue)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->setUnicode( (FLMUINT)ui32ElementNumber, puzValue));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DataVector_setBinary(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber,
const void * pvValue,
FLMUINT32 ui32Len)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->setBinary( (FLMUINT)ui32ElementNumber, pvValue, (FLMUINT)ui32Len));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP void FLMAPI xflaim_DataVector_setRightTruncated(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
pDataVector->setRightTruncated( (FLMUINT)ui32ElementNumber);
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP void FLMAPI xflaim_DataVector_setLeftTruncated(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
pDataVector->setLeftTruncated( (FLMUINT)ui32ElementNumber);
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP void FLMAPI xflaim_DataVector_clearRightTruncated(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
pDataVector->clearRightTruncated( (FLMUINT)ui32ElementNumber);
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP void FLMAPI xflaim_DataVector_clearLeftTruncated(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
pDataVector->clearLeftTruncated( (FLMUINT)ui32ElementNumber);
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP FLMBOOL FLMAPI xflaim_DataVector_isRightTruncated(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->isRightTruncated( (FLMUINT)ui32ElementNumber));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP FLMBOOL FLMAPI xflaim_DataVector_isLeftTruncated(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->isLeftTruncated( (FLMUINT)ui32ElementNumber));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP FLMUINT64 FLMAPI xflaim_DataVector_getDocumentID(
FLMUINT64 ui64This)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->getDocumentID());
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP FLMUINT64 FLMAPI xflaim_DataVector_getID(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->getID( (FLMUINT)ui32ElementNumber));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP FLMUINT32 FLMAPI xflaim_DataVector_getNameId(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( (FLMUINT32)pDataVector->getNameId( (FLMUINT)ui32ElementNumber));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP FLMBOOL FLMAPI xflaim_DataVector_isAttr(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->isAttr( (FLMUINT)ui32ElementNumber));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP FLMBOOL FLMAPI xflaim_DataVector_isDataComponent(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->isDataComponent( (FLMUINT)ui32ElementNumber));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP FLMBOOL FLMAPI xflaim_DataVector_isKeyComponent(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->isKeyComponent( (FLMUINT)ui32ElementNumber));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP FLMUINT32 FLMAPI xflaim_DataVector_getDataLength(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( (FLMUINT32)pDataVector->getDataLength( (FLMUINT)ui32ElementNumber));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP FLMINT32 FLMAPI xflaim_DataVector_getDataType(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( (FLMINT32)pDataVector->getDataType( (FLMUINT)ui32ElementNumber));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DataVector_getULong(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber,
FLMUINT64 * pui64Value)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->getUINT64( (FLMUINT)ui32ElementNumber, pui64Value));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DataVector_getLong(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber,
FLMINT64 * pi64Value)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->getINT64( (FLMUINT)ui32ElementNumber, pi64Value));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DataVector_getUInt(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber,
FLMUINT32 * pui32Value)
{
RCODE rc;
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
FLMUINT uiValue;
rc = pDataVector->getUINT( (FLMUINT)ui32ElementNumber, &uiValue);
*pui32Value = (FLMUINT32)uiValue;
return( rc);
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DataVector_getInt(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber,
FLMINT32 * pi32Value)
{
RCODE rc;
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
FLMINT iValue;
rc = pDataVector->getINT( (FLMUINT)ui32ElementNumber, &iValue);
*pi32Value = (FLMINT32)iValue;
return( rc);
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DataVector_getString(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber,
FLMUNICODE ** ppuzValue)
{
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
return( pDataVector->getUnicode( (FLMUINT)ui32ElementNumber, ppuzValue));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DataVector_getBinary(
FLMUINT64 ui64This,
FLMUINT32 ui32ElementNumber,
FLMUINT32 ui32Len,
void * pvValue)
{
RCODE rc = NE_XFLM_OK;
IF_DataVector * pDataVector = ((IF_DataVector *)(FLMUINT)ui64This);
FLMUINT uiLength = (FLMUINT)ui32Len;
if (RC_BAD( rc = pDataVector->getBinary( (FLMUINT)ui32ElementNumber,
pvValue, &uiLength)))
{
goto Exit;
}
flmAssert( uiLength == (FLMUINT)ui32Len);
Exit:
return( rc);
}

View File

@@ -0,0 +1,863 @@
//------------------------------------------------------------------------------
// Desc: Data Vector Class
//
// Tabs: 3
//
// Copyright (c) 2006 Novell, Inc. All Rights Reserved.
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of version 2 of the GNU General Public
// License as published by the Free Software Foundation.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, contact Novell, Inc.
//
// To contact Novell about this file by physical or electronic mail,
// you may find current contact information at www.novell.com
//
// $Id$
//------------------------------------------------------------------------------
using System;
using System.Runtime.InteropServices;
namespace xflaim
{
/// <summary>
/// The DataVector class provides a number of methods that allow C#
/// applications to access data vector object in unmanaged space. A
/// DataVector object is obtained by calling <see cref="DbSystem.createDataVector"/>.
/// </summary>
public class DataVector
{
private ulong m_pDataVector; // Pointer to IF_DataVector object in unmanaged space
private DbSystem m_dbSystem;
/// <summary>
/// Db constructor.
/// </summary>
/// <param name="pDataVector">
/// Reference to an IF_Db object.
/// </param>
/// <param name="dbSystem">
/// DbSystem object that this Db object is associated with.
/// </param>
internal DataVector(
ulong pDataVector,
DbSystem dbSystem)
{
if (pDataVector == 0)
{
throw new XFlaimException( "Invalid IF_DataVector reference");
}
m_pDataVector = pDataVector;
if (dbSystem == null)
{
throw new XFlaimException( "Invalid DbSystem reference");
}
m_dbSystem = dbSystem;
// Must call something inside of DbSystem. Otherwise, the
// m_dbSystem object gets a compiler warning on linux because
// it is not used anywhere. Other than that, there is really
// no need to make the following call.
if (m_dbSystem.getDbSystem() == 0)
{
throw new XFlaimException( "Invalid DbSystem.IF_DbSystem object");
}
}
/// <summary>
/// Destructor.
/// </summary>
~DataVector()
{
close();
}
/// <summary>
/// Return the pointer to the IF_DataVector object.
/// </summary>
/// <returns>Returns a pointer to the IF_DataVector object.</returns>
internal ulong getDataVector()
{
return( m_pDataVector);
}
/// <summary>
/// Close this data vector object.
/// </summary>
public void close()
{
// Release the native pDataVector!
if (m_pDataVector != 0)
{
xflaim_DataVector_Release( m_pDataVector);
m_pDataVector = 0;
}
// Remove our reference to the dbSystem so it can be released.
m_dbSystem = null;
}
[DllImport("xflaim")]
private static extern void xflaim_DataVector_Release(
ulong pDataVector);
//-----------------------------------------------------------------------------
// setDocumentID
//-----------------------------------------------------------------------------
/// <summary>
/// Set the document ID a data vector is associated with.
/// </summary>
/// <param name="ulDocId">
/// Docment ID.
/// </param>
public void setDocumentID(
ulong ulDocId)
{
xflaim_DataVector_setDocumentID( m_pDataVector, ulDocId);
}
[DllImport("xflaim")]
private static extern void xflaim_DataVector_setDocumentID(
ulong pDataVector,
ulong ulDocId);
//-----------------------------------------------------------------------------
// setID
//-----------------------------------------------------------------------------
/// <summary>
/// Set the ID for a particular element in a data vector.
/// </summary>
/// <param name="uiElementNumber">
/// Element number whose ID is to be set.
/// </param>
/// <param name="ulID">
/// ID to be set for the element. This is generally a node ID.
/// </param>
public void setID(
uint uiElementNumber,
ulong ulID)
{
RCODE rc;
if ((rc = xflaim_DataVector_setID( m_pDataVector, uiElementNumber, ulID)) != 0)
{
throw new XFlaimException( rc);
}
}
[DllImport("xflaim")]
private static extern RCODE xflaim_DataVector_setID(
ulong pDataVector,
uint uiElementNumber,
ulong ulID);
//-----------------------------------------------------------------------------
// setNameId
//-----------------------------------------------------------------------------
/// <summary>
/// Set the name ID for the specified element in the data vector.
/// </summary>
/// <param name="uiElementNumber">Element number whose value is to be set</param>
/// <param name="uiNameId">Name Id to be set</param>
/// <param name="bIsAttr">Flag that specifies whether the value is an attribute</param>
/// <param name="bIsData">Flag that specifies whether the value is a data component</param>
public void setNameId(
uint uiElementNumber,
uint uiNameId,
bool bIsAttr,
bool bIsData)
{
RCODE rc;
if ((rc = xflaim_DataVector_setNameId( m_pDataVector,
uiElementNumber, uiNameId, (int)(bIsAttr ? 1 : 0),
(int)(bIsData ? 1 : 0))) != 0)
{
throw new XFlaimException( rc);
}
}
[DllImport("xflaim")]
private static extern RCODE xflaim_DataVector_setNameId(
ulong pDataVector,
uint uiElementNumber,
uint uiNameId,
int bIsAttr,
int bIsData);
//-----------------------------------------------------------------------------
// setULong
//-----------------------------------------------------------------------------
/// <summary>
/// Set an unsigned long value for the specified element in the data vector.
/// </summary>
/// <param name="uiElementNumber">Element number whose value is to be set</param>
/// <param name="ulValue">Value to be set</param>
public void setULong(
uint uiElementNumber,
ulong ulValue)
{
RCODE rc;
if ((rc = xflaim_DataVector_setULong( m_pDataVector,
uiElementNumber, ulValue)) != 0)
{
throw new XFlaimException( rc);
}
}
[DllImport("xflaim")]
private static extern RCODE xflaim_DataVector_setULong(
ulong pDataVector,
uint uiElementNumber,
ulong ulValue);
//-----------------------------------------------------------------------------
// setLong
//-----------------------------------------------------------------------------
/// <summary>
/// Set a long value for the specified element in the data vector.
/// </summary>
/// <param name="uiElementNumber">Element number whose value is to be set</param>
/// <param name="lValue">Value to be set</param>
public void setLong(
uint uiElementNumber,
long lValue)
{
RCODE rc;
if ((rc = xflaim_DataVector_setLong( m_pDataVector,
uiElementNumber, lValue)) != 0)
{
throw new XFlaimException( rc);
}
}
[DllImport("xflaim")]
private static extern RCODE xflaim_DataVector_setLong(
ulong pDataVector,
uint uiElementNumber,
long lValue);
//-----------------------------------------------------------------------------
// setUInt
//-----------------------------------------------------------------------------
/// <summary>
/// Set an unsigned int value for the specified element in the data vector.
/// </summary>
/// <param name="uiElementNumber">Element number whose value is to be set</param>
/// <param name="uiValue">Value to be set</param>
public void setUInt(
uint uiElementNumber,
uint uiValue)
{
RCODE rc;
if ((rc = xflaim_DataVector_setUInt( m_pDataVector,
uiElementNumber, uiValue)) != 0)
{
throw new XFlaimException( rc);
}
}
[DllImport("xflaim")]
private static extern RCODE xflaim_DataVector_setUInt(
ulong pDataVector,
uint uiElementNumber,
uint uiValue);
//-----------------------------------------------------------------------------
// setInt
//-----------------------------------------------------------------------------
/// <summary>
/// Set an int value for the specified element in the data vector.
/// </summary>
/// <param name="uiElementNumber">Element number whose value is to be set</param>
/// <param name="iValue">Value to be set</param>
public void setInt(
uint uiElementNumber,
int iValue)
{
RCODE rc;
if ((rc = xflaim_DataVector_setInt( m_pDataVector,
uiElementNumber, iValue)) != 0)
{
throw new XFlaimException( rc);
}
}
[DllImport("xflaim")]
private static extern RCODE xflaim_DataVector_setInt(
ulong pDataVector,
uint uiElementNumber,
int iValue);
//-----------------------------------------------------------------------------
// setString
//-----------------------------------------------------------------------------
/// <summary>
/// Set a string value for the specified element in the data vector.
/// </summary>
/// <param name="uiElementNumber">Element number whose value is to be set</param>
/// <param name="sValue">Value to be set</param>
public void setString(
uint uiElementNumber,
string sValue)
{
RCODE rc;
if ((rc = xflaim_DataVector_setString( m_pDataVector,
uiElementNumber, sValue)) != 0)
{
throw new XFlaimException( rc);
}
}
[DllImport("xflaim")]
private static extern RCODE xflaim_DataVector_setString(
ulong pDataVector,
uint uiElementNumber,
[MarshalAs(UnmanagedType.LPWStr)]
string sValue);
//-----------------------------------------------------------------------------
// setBinary
//-----------------------------------------------------------------------------
/// <summary>
/// Set a binary value for the specified element in the data vector.
/// </summary>
/// <param name="uiElementNumber">Element number whose value is to be set</param>
/// <param name="pvValue">Value to be set</param>
public void setBinary(
uint uiElementNumber,
byte [] pvValue)
{
RCODE rc;
if ((rc = xflaim_DataVector_setBinary( m_pDataVector,
uiElementNumber, pvValue, (uint)pvValue.Length)) != 0)
{
throw new XFlaimException( rc);
}
}
[DllImport("xflaim")]
private static extern RCODE xflaim_DataVector_setBinary(
ulong pDataVector,
uint uiElementNumber,
[MarshalAs(UnmanagedType.LPArray), In]
byte [] pvValue,
uint uiLen);
//-----------------------------------------------------------------------------
// setRightTruncated
//-----------------------------------------------------------------------------
/// <summary>
/// Set the right truncated flag for the specified element in the vector.
/// </summary>
/// <param name="uiElementNumber">Element whose right truncation flag is to be set</param>
public void setRightTruncated(
uint uiElementNumber)
{
xflaim_DataVector_setRightTruncated( m_pDataVector, uiElementNumber);
}
[DllImport("xflaim")]
private static extern void xflaim_DataVector_setRightTruncated(
ulong pDataVector,
uint uiElementNumber);
//-----------------------------------------------------------------------------
// setLeftTruncated
//-----------------------------------------------------------------------------
/// <summary>
/// Set the left truncated flag for the specified element in the vector.
/// </summary>
/// <param name="uiElementNumber">Element whose left truncation flag is to be set</param>
public void setLeftTruncated(
uint uiElementNumber)
{
xflaim_DataVector_setLeftTruncated( m_pDataVector, uiElementNumber);
}
[DllImport("xflaim")]
private static extern void xflaim_DataVector_setLeftTruncated(
ulong pDataVector,
uint uiElementNumber);
//-----------------------------------------------------------------------------
// clearRightTruncated
//-----------------------------------------------------------------------------
/// <summary>
/// Clear the right truncated flag for the specified element in the vector.
/// </summary>
/// <param name="uiElementNumber">Element whose right truncation flag is to be cleared</param>
public void clearRightTruncated(
uint uiElementNumber)
{
xflaim_DataVector_clearRightTruncated( m_pDataVector, uiElementNumber);
}
[DllImport("xflaim")]
private static extern void xflaim_DataVector_clearRightTruncated(
ulong pDataVector,
uint uiElementNumber);
//-----------------------------------------------------------------------------
// clearLeftTruncated
//-----------------------------------------------------------------------------
/// <summary>
/// Clear the left truncated flag for the specified element in the vector.
/// </summary>
/// <param name="uiElementNumber">Element whose left truncation flag is to be cleared</param>
public void clearLeftTruncated(
uint uiElementNumber)
{
xflaim_DataVector_clearLeftTruncated( m_pDataVector, uiElementNumber);
}
[DllImport("xflaim")]
private static extern void xflaim_DataVector_clearLeftTruncated(
ulong pDataVector,
uint uiElementNumber);
//-----------------------------------------------------------------------------
// isRightTruncated
//-----------------------------------------------------------------------------
/// <summary>
/// Determine if the right truncated flag for the specified element in the vector is set.
/// </summary>
/// <param name="uiElementNumber">Element to be tested</param>
/// <returns>
/// Returns a flag indicating whether the specified element's right truncation flag is set.
/// </returns>
public bool isRightTruncated(
uint uiElementNumber)
{
return( xflaim_DataVector_isRightTruncated( m_pDataVector, uiElementNumber) != 0 ? true : false);
}
[DllImport("xflaim")]
private static extern int xflaim_DataVector_isRightTruncated(
ulong pDataVector,
uint uiElementNumber);
//-----------------------------------------------------------------------------
// isLeftTruncated
//-----------------------------------------------------------------------------
/// <summary>
/// Determine if the left truncated flag for the specified element in the vector is set.
/// </summary>
/// <param name="uiElementNumber">Element to be tested</param>
/// <returns>
/// Returns a flag indicating whether the specified element's left truncation flag is set.
/// </returns>
public bool isLeftTruncated(
uint uiElementNumber)
{
return( xflaim_DataVector_isLeftTruncated( m_pDataVector, uiElementNumber) != 0 ? true : false);
}
[DllImport("xflaim")]
private static extern int xflaim_DataVector_isLeftTruncated(
ulong pDataVector,
uint uiElementNumber);
//-----------------------------------------------------------------------------
// getDocumentID
//-----------------------------------------------------------------------------
/// <summary>
/// Get the document ID associated with the data vector.
/// </summary>
/// <returns>
/// Document ID for the data vector.
/// </returns>
public ulong getDocumentID()
{
return( xflaim_DataVector_getDocumentID( m_pDataVector));
}
[DllImport("xflaim")]
private static extern ulong xflaim_DataVector_getDocumentID(
ulong pDataVector);
//-----------------------------------------------------------------------------
// getID
//-----------------------------------------------------------------------------
/// <summary>
/// Get the ID associated with the specified element in the data vector.
/// </summary>
/// <param name="uiElementNumber">Element number whose ID is to be returned.</param>
/// <returns>
/// ID for the specified element in the data vector.
/// </returns>
public ulong getID(
uint uiElementNumber)
{
return( xflaim_DataVector_getID( m_pDataVector, uiElementNumber));
}
[DllImport("xflaim")]
private static extern ulong xflaim_DataVector_getID(
ulong pDataVector,
uint uiElementNumber);
//-----------------------------------------------------------------------------
// getNameId
//-----------------------------------------------------------------------------
/// <summary>
/// Get the name ID associated with the specified element in the data vector.
/// </summary>
/// <param name="uiElementNumber">Element number whose name ID is to be returned.</param>
/// <returns>
/// Name ID for the specified element in the data vector.
/// </returns>
public uint getNameId(
uint uiElementNumber)
{
return( xflaim_DataVector_getNameId( m_pDataVector, uiElementNumber));
}
[DllImport("xflaim")]
private static extern uint xflaim_DataVector_getNameId(
ulong pDataVector,
uint uiElementNumber);
//-----------------------------------------------------------------------------
// isAttr
//-----------------------------------------------------------------------------
/// <summary>
/// Determine if the specified element in the data vector is an attribute.
/// </summary>
/// <param name="uiElementNumber">Element number to be tested.</param>
/// <returns>
/// Flag indicating whether the specified element in the data vector is an attribute.
/// </returns>
public bool isAttr(
uint uiElementNumber)
{
return( xflaim_DataVector_isAttr( m_pDataVector, uiElementNumber) != 0 ? true : false);
}
[DllImport("xflaim")]
private static extern int xflaim_DataVector_isAttr(
ulong pDataVector,
uint uiElementNumber);
//-----------------------------------------------------------------------------
// isDataComponent
//-----------------------------------------------------------------------------
/// <summary>
/// Determine if the specified element in the data vector is a data component.
/// </summary>
/// <param name="uiElementNumber">Element number to be tested.</param>
/// <returns>
/// Flag indicating whether the specified element in the data vector is a data component.
/// </returns>
public bool isDataComponent(
uint uiElementNumber)
{
return( xflaim_DataVector_isDataComponent( m_pDataVector, uiElementNumber) != 0 ? true : false);
}
[DllImport("xflaim")]
private static extern int xflaim_DataVector_isDataComponent(
ulong pDataVector,
uint uiElementNumber);
//-----------------------------------------------------------------------------
// isKeyComponent
//-----------------------------------------------------------------------------
/// <summary>
/// Determine if the specified element in the data vector is a key component.
/// </summary>
/// <param name="uiElementNumber">Element number to be tested.</param>
/// <returns>
/// Flag indicating whether the specified element in the data vector is a key component.
/// </returns>
public bool isKeyComponent(
uint uiElementNumber)
{
return( xflaim_DataVector_isKeyComponent( m_pDataVector, uiElementNumber) != 0 ? true : false);
}
[DllImport("xflaim")]
private static extern int xflaim_DataVector_isKeyComponent(
ulong pDataVector,
uint uiElementNumber);
//-----------------------------------------------------------------------------
// getDataLength
//-----------------------------------------------------------------------------
/// <summary>
/// Get the length of the data that is stored in the specified element in the data vector.
/// </summary>
/// <param name="uiElementNumber">Element number whose data length is to be returned.</param>
/// <returns>
/// Length of data in the specified element.
/// </returns>
public uint getDataLength(
uint uiElementNumber)
{
return( xflaim_DataVector_getDataLength( m_pDataVector, uiElementNumber));
}
[DllImport("xflaim")]
private static extern uint xflaim_DataVector_getDataLength(
ulong pDataVector,
uint uiElementNumber);
//-----------------------------------------------------------------------------
// getDataType
//-----------------------------------------------------------------------------
/// <summary>
/// Get the type of the data that is stored in the specified element in the data vector.
/// </summary>
/// <param name="uiElementNumber">Element number whose data type is to be returned.</param>
/// <returns>
/// Type of data in the specified element.
/// </returns>
public FlmDataType getDataType(
uint uiElementNumber)
{
return( xflaim_DataVector_getDataType( m_pDataVector, uiElementNumber));
}
[DllImport("xflaim")]
private static extern FlmDataType xflaim_DataVector_getDataType(
ulong pDataVector,
uint uiElementNumber);
//-----------------------------------------------------------------------------
// getULong
//-----------------------------------------------------------------------------
/// <summary>
/// Get the data in the specified element in the data vector as an unsigned
/// long value.
/// </summary>
/// <param name="uiElementNumber">Element number whose value is to be returned.</param>
/// <returns>
/// Element's value is returned as an unsigned long.
/// </returns>
public ulong getULong(
uint uiElementNumber)
{
RCODE rc;
ulong ulValue;
if ((rc = xflaim_DataVector_getULong( m_pDataVector, uiElementNumber, out ulValue)) != 0)
{
throw new XFlaimException( rc);
}
return( ulValue);
}
[DllImport("xflaim")]
private static extern RCODE xflaim_DataVector_getULong(
ulong pDataVector,
uint uiElementNumber,
out ulong pulValue);
//-----------------------------------------------------------------------------
// getLong
//-----------------------------------------------------------------------------
/// <summary>
/// Get the data in the specified element in the data vector as a
/// long value.
/// </summary>
/// <param name="uiElementNumber">Element number whose value is to be returned.</param>
/// <returns>
/// Element's value is returned as a long.
/// </returns>
public long getLong(
uint uiElementNumber)
{
RCODE rc;
long lValue;
if ((rc = xflaim_DataVector_getLong( m_pDataVector, uiElementNumber, out lValue)) != 0)
{
throw new XFlaimException( rc);
}
return( lValue);
}
[DllImport("xflaim")]
private static extern RCODE xflaim_DataVector_getLong(
ulong pDataVector,
uint uiElementNumber,
out long plValue);
//-----------------------------------------------------------------------------
// getUInt
//-----------------------------------------------------------------------------
/// <summary>
/// Get the data in the specified element in the data vector as an unsigned
/// int value.
/// </summary>
/// <param name="uiElementNumber">Element number whose value is to be returned.</param>
/// <returns>
/// Element's value is returned as an unsigned int.
/// </returns>
public uint getUInt(
uint uiElementNumber)
{
RCODE rc;
uint uiValue;
if ((rc = xflaim_DataVector_getUInt( m_pDataVector, uiElementNumber, out uiValue)) != 0)
{
throw new XFlaimException( rc);
}
return( uiValue);
}
[DllImport("xflaim")]
private static extern RCODE xflaim_DataVector_getUInt(
ulong pDataVector,
uint uiElementNumber,
out uint puiValue);
//-----------------------------------------------------------------------------
// getInt
//-----------------------------------------------------------------------------
/// <summary>
/// Get the data in the specified element in the data vector as a signed
/// int value.
/// </summary>
/// <param name="uiElementNumber">Element number whose value is to be returned.</param>
/// <returns>
/// Element's value is returned as a signed int.
/// </returns>
public int getInt(
uint uiElementNumber)
{
RCODE rc;
int iValue;
if ((rc = xflaim_DataVector_getInt( m_pDataVector, uiElementNumber, out iValue)) != 0)
{
throw new XFlaimException( rc);
}
return( iValue);
}
[DllImport("xflaim")]
private static extern RCODE xflaim_DataVector_getInt(
ulong pDataVector,
uint uiElementNumber,
out int piValue);
//-----------------------------------------------------------------------------
// getString
//-----------------------------------------------------------------------------
/// <summary>
/// Get the data in the specified element in the data vector as a string
/// value.
/// </summary>
/// <param name="uiElementNumber">Element number whose value is to be returned.</param>
/// <returns>
/// Element's value is returned as a string.
/// </returns>
public string getString(
uint uiElementNumber)
{
RCODE rc;
IntPtr pValue;
string sValue;
if ((rc = xflaim_DataVector_getString( m_pDataVector, uiElementNumber, out pValue)) != 0)
{
throw new XFlaimException( rc);
}
sValue = Marshal.PtrToStringUni( pValue);
m_dbSystem.freeUnmanagedMem( pValue);
return( sValue);
}
[DllImport("xflaim")]
private static extern RCODE xflaim_DataVector_getString(
ulong pDataVector,
uint uiElementNumber,
out IntPtr pValue);
//-----------------------------------------------------------------------------
// getBinary
//-----------------------------------------------------------------------------
/// <summary>
/// Get the data in the specified element in the data vector as a byte array
/// value.
/// </summary>
/// <param name="uiElementNumber">Element number whose value is to be returned.</param>
/// <returns>
/// Element's value is returned as a byte array.
/// </returns>
public byte [] getBinary(
uint uiElementNumber)
{
RCODE rc;
byte [] pvValue = null;
uint uiLen = xflaim_DataVector_getDataLength( m_pDataVector, uiElementNumber);
pvValue = new byte [uiLen];
if ((rc = xflaim_DataVector_getBinary( m_pDataVector, uiElementNumber,
uiLen, pvValue)) != 0)
{
throw new XFlaimException( rc);
}
return( pvValue);
}
[DllImport("xflaim")]
private static extern RCODE xflaim_DataVector_getBinary(
ulong pDataVector,
uint uiElementNumber,
uint uiLen,
[MarshalAs(UnmanagedType.LPArray), Out]
byte [] pvValue);
}
}

View File

@@ -1433,3 +1433,37 @@ FLMEXTC FLMEXP RCODE FLMAPI xflaim_DbSystem_writeToOStream(
return( pDbSystem->writeToOStream( pIStream, pOStream));
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP RCODE FLMAPI xflaim_DbSystem_createDataVector(
FLMUINT64 ui64This,
FLMUINT64 * pui64DataVector)
{
RCODE rc = NE_XFLM_OK;
IF_DataVector * pDataVector = NULL;
IF_DbSystem * pDbSystem = (IF_DbSystem *)((FLMUINT)ui64This);
if (RC_BAD( rc = pDbSystem->createIFDataVector( &pDataVector)))
{
goto Exit;
}
Exit:
*pui64DataVector = (FLMUINT64)((FLMUINT)pDataVector);
return( rc);
}
/****************************************************************************
Desc:
****************************************************************************/
FLMEXTC FLMEXP void FLMAPI xflaim_DbSystem_freeUnmanagedMem(
FLMUINT64 ui64This,
void * pvMem)
{
IF_DbSystem * pDbSystem = ((IF_DbSystem *)(FLMUINT)ui64This);
pDbSystem->freeMem( &pvMem);
}

View File

@@ -293,9 +293,9 @@ namespace xflaim
return m_pDbSystem;
}
//-----------------------------------------------------------------------------
// dbCreate
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// dbCreate
//-----------------------------------------------------------------------------
/// <summary>
/// Creates a new XFlaim database.
@@ -375,9 +375,9 @@ namespace xflaim
XFLM_CREATE_OPTS pCreateOpts,
out ulong ppDb);
//-----------------------------------------------------------------------------
// dbOpen
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// dbOpen
//-----------------------------------------------------------------------------
/// <summary>
/// Opens an existing XFlaim database.
@@ -434,9 +434,9 @@ namespace xflaim
int bAllowLimited,
out ulong ppDb);
//-----------------------------------------------------------------------------
// dbRemove
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// dbRemove
//-----------------------------------------------------------------------------
/// <summary>
/// Removes (deletes) an XFlaim database.
@@ -480,9 +480,9 @@ namespace xflaim
string pszRflDir,
int bRemoveRflFiles);
//-----------------------------------------------------------------------------
// dbRestore
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// dbRestore
//-----------------------------------------------------------------------------
/// <summary>
/// Restores a previously backed up database. The <paramref name="sBackupPath"/> parameter
@@ -793,9 +793,9 @@ namespace xflaim
private RestoreStatus m_restoreStatus;
}
//-----------------------------------------------------------------------------
// dbCheck
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// dbCheck
//-----------------------------------------------------------------------------
/// <summary>
/// Check for physical and logical corruptions on the specified database.
@@ -896,13 +896,13 @@ namespace xflaim
{
rc = m_dbCheckStatus.reportProgress(
(XFLM_PROGRESS_CHECK_INFO)Marshal.PtrToStructure( pProgressInfo,
typeof( XFLM_PROGRESS_CHECK_INFO)));
typeof( XFLM_PROGRESS_CHECK_INFO)));
}
else
{
rc = m_dbCheckStatus.reportCheckErr(
(XFLM_CORRUPT_INFO)Marshal.PtrToStructure( pCorruptInfo,
typeof( XFLM_CORRUPT_INFO)));
typeof( XFLM_CORRUPT_INFO)));
}
return( rc);
}
@@ -910,9 +910,9 @@ namespace xflaim
private DbCheckStatus m_dbCheckStatus;
}
//-----------------------------------------------------------------------------
// dbCopy
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// dbCopy
//-----------------------------------------------------------------------------
/// <summary>
/// Makes a copy of an existing database.
@@ -1028,9 +1028,9 @@ namespace xflaim
private DbCopyStatus m_dbCopyStatus;
}
//-----------------------------------------------------------------------------
// dbRename
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// dbRename
//-----------------------------------------------------------------------------
/// <summary>
/// Rename a database.
@@ -1121,9 +1121,9 @@ namespace xflaim
private DbRenameStatus m_dbRenameStatus;
}
//-----------------------------------------------------------------------------
// dbRebuild
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// dbRebuild
//-----------------------------------------------------------------------------
/// <summary>
/// Rebuild a database.
@@ -1255,9 +1255,9 @@ namespace xflaim
private DbRebuildStatus m_dbRebuildStatus;
}
//-----------------------------------------------------------------------------
// openBufferIStream
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// openBufferIStream
//-----------------------------------------------------------------------------
/// <summary>
/// Open an input stream that reads from a string buffer.
@@ -1288,9 +1288,9 @@ namespace xflaim
string pszBuffer,
out ulong ppIStream);
//-----------------------------------------------------------------------------
// openFileIStream
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// openFileIStream
//-----------------------------------------------------------------------------
/// <summary>
/// Open an input stream that reads from a file.
@@ -1322,9 +1322,9 @@ namespace xflaim
string pszFileName,
out ulong ppIStream);
//-----------------------------------------------------------------------------
// openMultiFileIStream
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// openMultiFileIStream
//-----------------------------------------------------------------------------
/// <summary>
/// Open an input stream that reads from multiple files.
@@ -1349,7 +1349,7 @@ namespace xflaim
ulong pIStream = 0;
if ((rc = xflaim_DbSystem_openMultiFileIStream( m_pDbSystem, sDirectory,
sBaseName, out pIStream)) != 0)
sBaseName, out pIStream)) != 0)
{
throw new XFlaimException( rc);
}
@@ -1365,9 +1365,9 @@ namespace xflaim
string pszBaseName,
out ulong ppIStream);
//-----------------------------------------------------------------------------
// openBufferedIStream
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// openBufferedIStream
//-----------------------------------------------------------------------------
/// <summary>
/// Open an input stream that buffers an existing input stream.
@@ -1393,7 +1393,7 @@ namespace xflaim
ulong pIStream = 0;
if ((rc = xflaim_DbSystem_openBufferedIStream( m_pDbSystem,
inputIStream.getIStream(), uiBufferSize, out pIStream)) != 0)
inputIStream.getIStream(), uiBufferSize, out pIStream)) != 0)
{
throw new XFlaimException( rc);
}
@@ -1407,9 +1407,9 @@ namespace xflaim
uint uiBufferSize,
out ulong ppIStream);
//-----------------------------------------------------------------------------
// openUncompressingIStream
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// openUncompressingIStream
//-----------------------------------------------------------------------------
/// <summary>
/// Open an input stream that decompresses data from another input stream. It
@@ -1442,9 +1442,9 @@ namespace xflaim
ulong pInputIStream,
out ulong ppIStream);
//-----------------------------------------------------------------------------
// openBase64Encoder
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// openBase64Encoder
//-----------------------------------------------------------------------------
/// <summary>
/// Open an input stream that encodes data from another input stream into
@@ -1485,9 +1485,9 @@ namespace xflaim
int bInsertLineBreaks,
out ulong ppIStream);
//-----------------------------------------------------------------------------
// openBase64Decoder
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// openBase64Decoder
//-----------------------------------------------------------------------------
/// <summary>
/// Open an input stream that decodes data from another input stream. It is
@@ -1522,9 +1522,9 @@ namespace xflaim
ulong pInputIStream,
out ulong ppIStream);
//-----------------------------------------------------------------------------
// openFileOStream
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// openFileOStream
//-----------------------------------------------------------------------------
/// <summary>
/// Open an output stream that writes data to a file.
@@ -1564,9 +1564,9 @@ namespace xflaim
int bTruncateIfExists,
out ulong ppOStream);
//-----------------------------------------------------------------------------
// openMultiFileOStream
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// openMultiFileOStream
//-----------------------------------------------------------------------------
/// <summary>
/// Open a multi-file output stream. Data is written to one or more files.
@@ -1619,9 +1619,9 @@ namespace xflaim
int bOkToOverwrite,
out ulong ppOStream);
//-----------------------------------------------------------------------------
// removeMultiFileStream
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// removeMultiFileStream
//-----------------------------------------------------------------------------
/// <summary>
/// Remove a multi-file output stream from disk.
@@ -1655,9 +1655,9 @@ namespace xflaim
[MarshalAs(UnmanagedType.LPStr)]
string sBaseName);
//-----------------------------------------------------------------------------
// openBufferedOStream
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// openBufferedOStream
//-----------------------------------------------------------------------------
/// <summary>
/// Open a buffered output stream. A buffer is allocated for writing data to
@@ -1700,9 +1700,9 @@ namespace xflaim
uint uiBufferSize,
out ulong ppOStream);
//-----------------------------------------------------------------------------
// openCompressingOStream
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// openCompressingOStream
//-----------------------------------------------------------------------------
/// <summary>
/// Open a compressing output stream. Data is compressed before writing it
@@ -1736,9 +1736,9 @@ namespace xflaim
ulong pInputOStream,
out ulong ppOStream);
//-----------------------------------------------------------------------------
// writeToOStream
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
// writeToOStream
//-----------------------------------------------------------------------------
/// <summary>
/// Read data from an input stream and write it out to an output stream. This
@@ -1768,5 +1768,45 @@ namespace xflaim
ulong pDbSystem,
ulong pIStream,
ulong pOStream);
//-----------------------------------------------------------------------------
// createDataVector
//-----------------------------------------------------------------------------
/// <summary>
/// Create a <see cref="DataVector"/> object.
/// </summary>
/// <returns>Returns a <see cref="DataVector"/> objecdt</returns>
public DataVector createDataVector()
{
RCODE rc;
ulong pDataVector;
if ((rc = xflaim_DbSystem_createDataVector( m_pDbSystem, out pDataVector)) != 0)
{
throw new XFlaimException( rc);
}
return( new DataVector( pDataVector, this));
}
[DllImport("xflaim",CharSet=CharSet.Ansi)]
private static extern RCODE xflaim_DbSystem_createDataVector(
ulong pDbSystem,
out ulong ppDataVector);
//-----------------------------------------------------------------------------
// freeUnmanagedMem
//-----------------------------------------------------------------------------
internal void freeUnmanagedMem(
IntPtr pMem)
{
xflaim_DbSystem_freeUnmanagedMem( m_pDbSystem, pMem);
}
[DllImport("xflaim")]
private static extern void xflaim_DbSystem_freeUnmanagedMem(
ulong pDbSystem,
IntPtr pMem);
}
}