diff --git a/xflaim/csharp/xflaim/DOMNode.cpp b/xflaim/csharp/xflaim/DOMNode.cpp index b46f3b3..b4c138e 100644 --- a/xflaim/csharp/xflaim/DOMNode.cpp +++ b/xflaim/csharp/xflaim/DOMNode.cpp @@ -31,10 +31,604 @@ Desc: FLMEXTC FLMEXP void FLMAPI xflaim_DOMNode_Release( FLMUINT64 ui64This) { - IF_DOMNode * pNode = ((IF_DOMNode *)(FLMUINT)ui64This); + IF_DOMNode * pNode = (IF_DOMNode *)((FLMUINT)ui64This); if (pNode) { pNode->Release(); } } + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_createNode( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT32 ui32NodeType, + FLMUINT32 ui32NameId, + FLMUINT32 ui32InsertLoc, + FLMUINT64 * pui64Node) +{ + RCODE rc; + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + IF_DOMNode * pNode = (IF_DOMNode *)((FLMUINT)(*pui64Node)); + + rc = pThisNode->createNode( pDb, (eDomNodeType)ui32NodeType, (FLMUINT)ui32NameId, + (eNodeInsertLoc)ui32InsertLoc, &pNode, NULL); + *pui64Node = (FLMUINT64)((FLMUINT)pNode); + return( rc); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_createChildElement( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT32 ui32ChildElementNameId, + FLMBOOL bFirstChild, + FLMUINT64 * pui64Node) +{ + RCODE rc; + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + IF_DOMNode * pNode = (IF_DOMNode *)((FLMUINT)(*pui64Node)); + + rc = pThisNode->createChildElement( pDb, (FLMUINT)ui32ChildElementNameId, + (eNodeInsertLoc)(bFirstChild ? XFLM_FIRST_CHILD : XFLM_LAST_CHILD), + &pNode, NULL); + *pui64Node = (FLMUINT64)((FLMUINT)pNode); + return( rc); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_deleteNode( + FLMUINT64 ui64This, + FLMUINT64 ui64Db) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->deleteNode( pDb)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_deleteChildren( + FLMUINT64 ui64This, + FLMUINT64 ui64Db) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->deleteChildren( pDb)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP FLMUINT32 FLMAPI xflaim_DOMNode_getNodeType( + FLMUINT64 ui64This) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + + return( (FLMUINT32)pThisNode->getNodeType()); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_isDataLocalToNode( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMBOOL * pbLocal) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->isDataLocalToNode( pDb, pbLocal)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_createAttribute( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT32 ui32AttrNameId, + FLMUINT64 * pui64Node) +{ + RCODE rc; + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + IF_DOMNode * pNode = (IF_DOMNode *)((FLMUINT)(*pui64Node)); + + rc = pThisNode->createAttribute( pDb, (FLMUINT)ui32AttrNameId, &pNode); + *pui64Node = (FLMUINT64)((FLMUINT)pNode); + return( rc); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_getFirstAttribute( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT64 * pui64Node) +{ + RCODE rc; + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + IF_DOMNode * pNode = (IF_DOMNode *)((FLMUINT)(*pui64Node)); + + rc = pThisNode->getFirstAttribute( pDb, &pNode); + *pui64Node = (FLMUINT64)((FLMUINT)pNode); + return( rc); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_getLastAttribute( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT64 * pui64Node) +{ + RCODE rc; + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + IF_DOMNode * pNode = (IF_DOMNode *)((FLMUINT)(*pui64Node)); + + rc = pThisNode->getLastAttribute( pDb, &pNode); + *pui64Node = (FLMUINT64)((FLMUINT)pNode); + return( rc); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_getAttribute( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT32 ui32AttrNameId, + FLMUINT64 * pui64Node) +{ + RCODE rc; + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + IF_DOMNode * pNode = (IF_DOMNode *)((FLMUINT)(*pui64Node)); + + rc = pThisNode->getAttribute( pDb, (FLMUINT)ui32AttrNameId, &pNode); + *pui64Node = (FLMUINT64)((FLMUINT)pNode); + return( rc); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_deleteAttribute( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT32 ui32AttrNameId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->deleteAttribute( pDb, (FLMUINT)ui32AttrNameId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_hasAttribute( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT32 ui32AttrNameId, + FLMBOOL * pbHasAttr) +{ + RCODE rc; + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + rc = pThisNode->hasAttribute( pDb, (FLMUINT)ui32AttrNameId, NULL); + + if (RC_OK( rc)) + { + *pbHasAttr = TRUE; + } + else if (rc == NE_XFLM_DOM_NODE_NOT_FOUND) + { + *pbHasAttr = FALSE; + rc = NE_XFLM_OK; + } + return( rc); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_hasAttributes( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMBOOL * pbHasAttrs) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->hasAttributes( pDb, pbHasAttrs)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_hasNextSibling( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMBOOL * pbHasNextSibling) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->hasNextSibling( pDb, pbHasNextSibling)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_hasPreviousSibling( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMBOOL * pbHasPreviousSibling) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->hasPreviousSibling( pDb, pbHasPreviousSibling)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_hasChildren( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMBOOL * pbHasChildren) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->hasChildren( pDb, pbHasChildren)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_isNamespaceDecl( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMBOOL * pbIsNamespaceDecl) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->isNamespaceDecl( pDb, pbIsNamespaceDecl)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_getParentId( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT64 * pui64ParentId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->getParentId( pDb, pui64ParentId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_getNodeId( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT64 * pui64NodeId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->getNodeId( pDb, pui64NodeId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_getDocumentId( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT64 * pui64DocumentId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->getDocumentId( pDb, pui64DocumentId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_getPrevSibId( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT64 * pui64PrevSibId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->getPrevSibId( pDb, pui64PrevSibId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_getNextSibId( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT64 * pui64NextSibId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->getNextSibId( pDb, pui64NextSibId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_getFirstChildId( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT64 * pui64FirstChildId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->getFirstChildId( pDb, pui64FirstChildId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_getLastChildId( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT64 * pui64LastChildId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->getLastChildId( pDb, pui64LastChildId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_getNameId( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT32 * pui32NameId) +{ + RCODE rc; + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + FLMUINT uiNameId; + + rc = pThisNode->getNameId( pDb, &uiNameId); + *pui32NameId = (FLMUINT32)uiNameId; + return( rc); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_setULong( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT64 ui64Value, + FLMUINT32 ui32EncId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->setUINT64( pDb, ui64Value, (FLMUINT)ui32EncId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_setAttributeValueULong( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT32 ui32AttrNameId, + FLMUINT64 ui64Value, + FLMUINT32 ui32EncId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->setAttributeValueUINT64( pDb, (FLMUINT)ui32AttrNameId, + ui64Value, (FLMUINT)ui32EncId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_setLong( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMINT64 i64Value, + FLMUINT32 ui32EncId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->setINT64( pDb, i64Value, (FLMUINT)ui32EncId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_setAttributeValueLong( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT32 ui32AttrNameId, + FLMINT64 i64Value, + FLMUINT32 ui32EncId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->setAttributeValueINT64( pDb, (FLMUINT)ui32AttrNameId, + i64Value, (FLMUINT)ui32EncId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_setUInt( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT32 ui32Value, + FLMUINT32 ui32EncId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->setUINT( pDb, (FLMUINT)ui32Value, (FLMUINT)ui32EncId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_setAttributeValueUInt( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT32 ui32AttrNameId, + FLMUINT32 ui32Value, + FLMUINT32 ui32EncId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->setAttributeValueUINT( pDb, (FLMUINT)ui32AttrNameId, + (FLMUINT)ui32Value, (FLMUINT)ui32EncId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_setInt( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMINT32 i32Value, + FLMUINT32 ui32EncId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->setINT( pDb, (FLMINT)i32Value, (FLMUINT)ui32EncId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_setAttributeValueInt( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT32 ui32AttrNameId, + FLMINT32 i32Value, + FLMUINT32 ui32EncId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->setAttributeValueINT( pDb, (FLMUINT)ui32AttrNameId, + (FLMINT)i32Value, (FLMUINT)ui32EncId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_setString( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + const FLMUNICODE * puzValue, + FLMBOOL bLast, + FLMUINT32 ui32EncId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->setUnicode( pDb, puzValue, 0, bLast, + (FLMUINT)ui32EncId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_setAttributeValueString( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT32 ui32AttrNameId, + const FLMUNICODE * puzValue, + FLMUINT32 ui32EncId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->setAttributeValueUnicode( pDb, (FLMUINT)ui32AttrNameId, + puzValue, (FLMUINT)ui32EncId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_setBinary( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + const void * pvValue, + FLMUINT32 ui32Len, + FLMBOOL bLast, + FLMUINT32 ui32EncId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->setBinary( pDb, pvValue, (FLMUINT)ui32Len, bLast, + (FLMUINT)ui32EncId)); +} + +/**************************************************************************** +Desc: +****************************************************************************/ +FLMEXTC FLMEXP RCODE FLMAPI xflaim_DOMNode_setAttributeValueBinary( + FLMUINT64 ui64This, + FLMUINT64 ui64Db, + FLMUINT32 ui32AttrNameId, + const void * pvValue, + FLMUINT32 ui32Len, + FLMUINT32 ui32EncId) +{ + IF_DOMNode * pThisNode = (IF_DOMNode *)((FLMUINT)ui64This); + IF_Db * pDb = (IF_Db *)((FLMUINT)ui64Db); + + return( pThisNode->setAttributeValueBinary( pDb, (FLMUINT)ui32AttrNameId, + pvValue, (FLMUINT)ui32Len, (FLMUINT)ui32EncId)); +} diff --git a/xflaim/csharp/xflaim/DOMNode.cs b/xflaim/csharp/xflaim/DOMNode.cs index 6685bd4..c27c136 100644 --- a/xflaim/csharp/xflaim/DOMNode.cs +++ b/xflaim/csharp/xflaim/DOMNode.cs @@ -143,7 +143,11 @@ namespace xflaim } /// - /// Set the IF_DOMNode pointer inside this object. + /// Set the IF_DOMNode pointer inside this object. NOTE: We deliberately + /// do NOT release the m_pNode in this case, because it will already have + /// been released by the caller. Usually, the caller has made a call into + /// the native C++ code that will have released this pointer if it was + /// successful. /// /// /// Reference to an IF_DOMNode object. @@ -155,7 +159,6 @@ namespace xflaim ulong pNode, Db db) { - close(); m_pNode = pNode; m_db = db; } @@ -199,5 +202,1681 @@ namespace xflaim private static extern void xflaim_DOMNode_Release( ulong pNode); +//----------------------------------------------------------------------------- +// createNode +//----------------------------------------------------------------------------- + + /// + /// Creates a new DOM node and inserts it into the database in the + /// specified position relative to the current node. An existing + /// DOMNode object can optionally be passed in, and it will be reused + /// instead of a new object being allocated. + /// + /// + /// Type of node to create. + /// + /// + /// The dictionary tag number that represents the node name. This name ID + /// must exist in the dictionary before it can be used here. The value + /// may be one of the predefined ones, or it may be created by calling + /// . + /// + /// + /// The relative position to insert the new node with respect to this node. + /// + /// + /// An existing object can optionally be passed in, and + /// it will be reused instead of a new object being allocated. + /// + /// + /// Returns a object. + /// + public DOMNode createNode( + eDomNodeType eNodeType, + uint uiNameId, + eNodeInsertLoc eInsertLoc, + DOMNode nodeToReuse) + { + RCODE rc; + DOMNode newNode; + ulong pNode = (nodeToReuse != null) ? nodeToReuse.getNode() : 0; + + if ((rc = xflaim_DOMNode_createNode( m_pNode, m_db.getDb(), + eNodeType, uiNameId, eInsertLoc, ref pNode)) != 0) + { + throw new XFlaimException( rc); + } + if (nodeToReuse == null) + { + newNode = new DOMNode( pNode, m_db); + } + else + { + newNode = nodeToReuse; + newNode.setNodePtr( pNode, m_db); + } + + return( newNode); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_createNode( + ulong pNode, + ulong pDb, + eDomNodeType eNodeType, + uint uiNameId, + eNodeInsertLoc eInsertLoc, + ref ulong ppNode); + +//----------------------------------------------------------------------------- +// createChildElement +//----------------------------------------------------------------------------- + + /// + /// Creates a new element node and inserts it into the database in the + /// as either the first or last child of the current node. An existing + /// object can optionally be passed in, and it will be reused + /// instead of a new object being allocated. + /// + /// + /// The dictionary tag number that represents the node name. This name ID + /// must exist in the dictionary before it can be used here. The value + /// may be one of the predefined ones, or it may be created by calling + /// . + /// + /// + /// Specifies whether the new element is to be created as a first or last child. + /// + /// + /// An existing object can optionally be passed in, and + /// it will be reused instead of a new object being allocated. + /// + /// + /// Returns a object. + /// + public DOMNode createChildElement( + uint uiChildElementNameId, + bool bFirstChild, + DOMNode nodeToReuse) + { + RCODE rc; + DOMNode newNode; + ulong pNode = (nodeToReuse != null) ? nodeToReuse.getNode() : 0; + + if ((rc = xflaim_DOMNode_createChildElement( m_pNode, m_db.getDb(), + uiChildElementNameId, (int)(bFirstChild ? 1 : 0), ref pNode)) != 0) + { + throw new XFlaimException( rc); + } + if (nodeToReuse == null) + { + newNode = new DOMNode( pNode, m_db); + } + else + { + newNode = nodeToReuse; + newNode.setNodePtr( pNode, m_db); + } + + return( newNode); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_createChildElement( + ulong pNode, + ulong pDb, + uint uiChildElementNameId, + int bFirstChild, + ref ulong ppNode); + +//----------------------------------------------------------------------------- +// deleteNode +//----------------------------------------------------------------------------- + + /// + /// Removes this node as well as all of it's descendants from the database. + /// + public void deleteNode() + { + RCODE rc; + + if ((rc = xflaim_DOMNode_deleteNode( m_pNode, m_db.getDb())) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_deleteNode( + ulong pNode, + ulong pDb); + +//----------------------------------------------------------------------------- +// deleteChildren +//----------------------------------------------------------------------------- + + /// + /// Removes the children of this node from the database. + /// + public void deleteChildren() + { + RCODE rc; + + if ((rc = xflaim_DOMNode_deleteChildren( m_pNode, m_db.getDb())) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_deleteChildren( + ulong pNode, + ulong pDb); + +//----------------------------------------------------------------------------- +// getNodeType +//----------------------------------------------------------------------------- + + /// + /// Returns the type of node. + /// + /// Type of node. + public eDomNodeType getNodeType() + { + return( xflaim_DOMNode_getNodeType( m_pNode)); + } + + [DllImport("xflaim")] + private static extern eDomNodeType xflaim_DOMNode_getNodeType( + ulong pNode); + +//----------------------------------------------------------------------------- +// isDataLocalToNode +//----------------------------------------------------------------------------- + + /// + /// Determine if data for the current node is associated with the node, or + /// with a child node. Element nodes may not have data associated with them, + /// but with child data nodes instead. + /// + /// + /// Returns true if this node's data is associated with it, false otherwise. + /// + public bool isDataLocalToNode() + { + RCODE rc; + int bLocal; + + if ((rc = xflaim_DOMNode_isDataLocalToNode( m_pNode, m_db.getDb(), out bLocal)) != 0) + { + throw new XFlaimException( rc); + } + return( bLocal != 0 ? true : false); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_isDataLocalToNode( + ulong pNode, + ulong pDb, + out int pbLocal); + +//----------------------------------------------------------------------------- +// createAttribute +//----------------------------------------------------------------------------- + + /// + /// Creates a new attribute node for this node. Note that only element + /// nodes are allowed to have attributes. + /// + /// + /// The dictionary tag number that represents the attribute name. This name ID + /// must exist in the dictionary before it can be used here. The value + /// may be one of the predefined ones, or it may be created by calling + /// . + /// + /// + /// An existing object can optionally be passed in, and + /// it will be reused instead of a new object being allocated. + /// + /// + /// Returns a object. + /// + public DOMNode createAttribute( + uint uiAttrNameId, + DOMNode nodeToReuse) + { + RCODE rc; + DOMNode newNode; + ulong pNode = (nodeToReuse != null) ? nodeToReuse.getNode() : 0; + + if ((rc = xflaim_DOMNode_createAttribute( m_pNode, m_db.getDb(), + uiAttrNameId, ref pNode)) != 0) + { + throw new XFlaimException( rc); + } + if (nodeToReuse == null) + { + newNode = new DOMNode( pNode, m_db); + } + else + { + newNode = nodeToReuse; + newNode.setNodePtr( pNode, m_db); + } + + return( newNode); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_createAttribute( + ulong pNode, + ulong pDb, + uint uiAttrNameId, + ref ulong ppNode); + +//----------------------------------------------------------------------------- +// getFirstAttribute +//----------------------------------------------------------------------------- + + /// + /// Retrieves the first attribute node associated with the current node. + /// + /// + /// An existing object can optionally be passed in, and + /// it will be reused instead of a new object being allocated. + /// + /// + /// Returns a object. + /// + public DOMNode getFirstAttribute( + DOMNode nodeToReuse) + { + RCODE rc; + DOMNode newNode; + ulong pNode = (nodeToReuse != null) ? nodeToReuse.getNode() : 0; + + if ((rc = xflaim_DOMNode_getFirstAttribute( m_pNode, m_db.getDb(), + ref pNode)) != 0) + { + throw new XFlaimException( rc); + } + if (nodeToReuse == null) + { + newNode = new DOMNode( pNode, m_db); + } + else + { + newNode = nodeToReuse; + newNode.setNodePtr( pNode, m_db); + } + + return( newNode); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_getFirstAttribute( + ulong pNode, + ulong pDb, + ref ulong ppNode); + +//----------------------------------------------------------------------------- +// getLastAttribute +//----------------------------------------------------------------------------- + + /// + /// Retrieves the last attribute node associated with the current node. + /// + /// + /// An existing object can optionally be passed in, and + /// it will be reused instead of a new object being allocated. + /// + /// + /// Returns a object. + /// + public DOMNode getLastAttribute( + DOMNode nodeToReuse) + { + RCODE rc; + DOMNode newNode; + ulong pNode = (nodeToReuse != null) ? nodeToReuse.getNode() : 0; + + if ((rc = xflaim_DOMNode_getLastAttribute( m_pNode, m_db.getDb(), + ref pNode)) != 0) + { + throw new XFlaimException( rc); + } + if (nodeToReuse == null) + { + newNode = new DOMNode( pNode, m_db); + } + else + { + newNode = nodeToReuse; + newNode.setNodePtr( pNode, m_db); + } + + return( newNode); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_getLastAttribute( + ulong pNode, + ulong pDb, + ref ulong ppNode); + +//----------------------------------------------------------------------------- +// getAttribute +//----------------------------------------------------------------------------- + + /// + /// Retrieves the requested attribute node associated with this node. + /// + /// + /// The dictionary tag number of the requested attribute. The name id must + /// exist in the dictionary before it can be used here. The name id may be + /// one of the predefined ones, or it may be created with + /// . + /// + /// + /// An existing object can optionally be passed in, and + /// it will be reused instead of a new object being allocated. + /// + /// + /// Returns a object. + /// + public DOMNode getAttribute( + uint uiAttrNameId, + DOMNode nodeToReuse) + { + RCODE rc; + DOMNode newNode; + ulong pNode = (nodeToReuse != null) ? nodeToReuse.getNode() : 0; + + if ((rc = xflaim_DOMNode_getAttribute( m_pNode, m_db.getDb(), + uiAttrNameId, ref pNode)) != 0) + { + throw new XFlaimException( rc); + } + if (nodeToReuse == null) + { + newNode = new DOMNode( pNode, m_db); + } + else + { + newNode = nodeToReuse; + newNode.setNodePtr( pNode, m_db); + } + + return( newNode); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_getAttribute( + ulong pNode, + ulong pDb, + uint uiAttrNameId, + ref ulong ppNode); + +//----------------------------------------------------------------------------- +// deleteAttribute +//----------------------------------------------------------------------------- + + /// + /// Deletes the specified attribute node associated with this node. + /// + /// + /// The dictionary tag number of the attribute to delete. The name id must + /// exist in the dictionary before it can be used here. The name id may be + /// one of the predefined ones, or it may be created with + /// . + /// + public void deleteAttribute( + uint uiAttrNameId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_deleteAttribute( m_pNode, m_db.getDb(), + uiAttrNameId)) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_deleteAttribute( + ulong pNode, + ulong pDb, + uint uiAttrNameId); + +//----------------------------------------------------------------------------- +// hasAttribute +//----------------------------------------------------------------------------- + + /// + /// Determines if the specified attribute exists for this node. + /// + /// + /// The dictionary tag number of the attribute to check. The name id must + /// exist in the dictionary before it can be used here. The name id may be + /// one of the predefined ones, or it may be created with + /// . + /// + /// + /// Returns true if the attribute exists, false otherwise. + /// + public bool hasAttribute( + uint uiAttrNameId) + { + RCODE rc; + int bHasAttr; + + if ((rc = xflaim_DOMNode_hasAttribute( m_pNode, m_db.getDb(), + uiAttrNameId, out bHasAttr)) != 0) + { + throw new XFlaimException( rc); + } + return( bHasAttr != 0 ? true : false); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_hasAttribute( + ulong pNode, + ulong pDb, + uint uiAttrNameId, + out int pbHasAttr); + +//----------------------------------------------------------------------------- +// hasAttributes +//----------------------------------------------------------------------------- + + /// + /// Determines if the node has any attributes. + /// + /// + /// Returns true if the node has attributes, false otherwise. + /// + public bool hasAttributes() + { + RCODE rc; + int bHasAttrs; + + if ((rc = xflaim_DOMNode_hasAttributes( m_pNode, m_db.getDb(), + out bHasAttrs)) != 0) + { + throw new XFlaimException( rc); + } + return( bHasAttrs != 0 ? true : false); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_hasAttributes( + ulong pNode, + ulong pDb, + out int pbHasAttrs); + +//----------------------------------------------------------------------------- +// hasNextSibling +//----------------------------------------------------------------------------- + + /// + /// Determines if the node has a next sibling. + /// + /// + /// Returns true if the node has a next sibling false otherwise. + /// + public bool hasNextSibling() + { + RCODE rc; + int bHasNextSibling; + + if ((rc = xflaim_DOMNode_hasNextSibling( m_pNode, m_db.getDb(), + out bHasNextSibling)) != 0) + { + throw new XFlaimException( rc); + } + return( bHasNextSibling != 0 ? true : false); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_hasNextSibling( + ulong pNode, + ulong pDb, + out int pbHasNextSibling); + +//----------------------------------------------------------------------------- +// hasPreviousSibling +//----------------------------------------------------------------------------- + + /// + /// Determines if the node has a previous sibling. + /// + /// + /// Returns true if the node has a previous sibling false otherwise. + /// + public bool hasPreviousSibling() + { + RCODE rc; + int bHasPreviousSibling; + + if ((rc = xflaim_DOMNode_hasPreviousSibling( m_pNode, m_db.getDb(), + out bHasPreviousSibling)) != 0) + { + throw new XFlaimException( rc); + } + return( bHasPreviousSibling != 0 ? true : false); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_hasPreviousSibling( + ulong pNode, + ulong pDb, + out int pbHasPreviousSibling); + +//----------------------------------------------------------------------------- +// hasChildren +//----------------------------------------------------------------------------- + + /// + /// Determines if the node has child nodes. + /// + /// + /// Returns true if the node has child nodes, false otherwise. + /// + public bool hasChildren() + { + RCODE rc; + int bHasChildren; + + if ((rc = xflaim_DOMNode_hasChildren( m_pNode, m_db.getDb(), + out bHasChildren)) != 0) + { + throw new XFlaimException( rc); + } + return( bHasChildren != 0 ? true : false); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_hasChildren( + ulong pNode, + ulong pDb, + out int pbHasChildren); + +//----------------------------------------------------------------------------- +// isNamespaceDecl +//----------------------------------------------------------------------------- + + /// + /// Determines if the node is a namespace declaration. + /// + /// + /// Returns true if the node is a namespace declaration, false otherwise. + /// + public bool isNamespaceDecl() + { + RCODE rc; + int bIsNamespaceDecl; + + if ((rc = xflaim_DOMNode_isNamespaceDecl( m_pNode, m_db.getDb(), + out bIsNamespaceDecl)) != 0) + { + throw new XFlaimException( rc); + } + return( bIsNamespaceDecl != 0 ? true : false); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_isNamespaceDecl( + ulong pNode, + ulong pDb, + out int pbIsNamespaceDecl); + +//----------------------------------------------------------------------------- +// getParentId +//----------------------------------------------------------------------------- + + /// + /// Gets the parent node ID for this node. + /// + /// + /// Returns the parent node ID of this node. + /// + public ulong getParentId() + { + RCODE rc; + ulong ulParentId; + + if ((rc = xflaim_DOMNode_getParentId( m_pNode, m_db.getDb(), + out ulParentId)) != 0) + { + throw new XFlaimException( rc); + } + return( ulParentId); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_getParentId( + ulong pNode, + ulong pDb, + out ulong pulParentId); + +//----------------------------------------------------------------------------- +// getNodeId +//----------------------------------------------------------------------------- + + /// + /// Gets the node ID for this node. + /// + /// + /// Returns the node ID of this node. + /// + public ulong getNodeId() + { + RCODE rc; + ulong ulNodeId; + + if ((rc = xflaim_DOMNode_getNodeId( m_pNode, m_db.getDb(), + out ulNodeId)) != 0) + { + throw new XFlaimException( rc); + } + return( ulNodeId); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_getNodeId( + ulong pNode, + ulong pDb, + out ulong pulNodeId); + +//----------------------------------------------------------------------------- +// getDocumentId +//----------------------------------------------------------------------------- + + /// + /// Gets the document ID for this node. + /// + /// + /// Returns the document ID of this node. + /// + public ulong getDocumentId() + { + RCODE rc; + ulong ulDocumentId; + + if ((rc = xflaim_DOMNode_getDocumentId( m_pNode, m_db.getDb(), + out ulDocumentId)) != 0) + { + throw new XFlaimException( rc); + } + return( ulDocumentId); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_getDocumentId( + ulong pNode, + ulong pDb, + out ulong pulDocumentId); + +//----------------------------------------------------------------------------- +// getPrevSibId +//----------------------------------------------------------------------------- + + /// + /// Gets the node ID of the previous sibling for this node. + /// + /// + /// Returns the node ID of the previous sibling for this node. + /// + public ulong getPrevSibId() + { + RCODE rc; + ulong ulPrevSibId; + + if ((rc = xflaim_DOMNode_getPrevSibId( m_pNode, m_db.getDb(), + out ulPrevSibId)) != 0) + { + throw new XFlaimException( rc); + } + return( ulPrevSibId); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_getPrevSibId( + ulong pNode, + ulong pDb, + out ulong pulPrevSibId); + +//----------------------------------------------------------------------------- +// getNextSibId +//----------------------------------------------------------------------------- + + /// + /// Gets the node ID of the next sibling for this node. + /// + /// + /// Returns the node ID of the next sibling for this node. + /// + public ulong getNextSibId() + { + RCODE rc; + ulong ulNextSibId; + + if ((rc = xflaim_DOMNode_getNextSibId( m_pNode, m_db.getDb(), + out ulNextSibId)) != 0) + { + throw new XFlaimException( rc); + } + return( ulNextSibId); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_getNextSibId( + ulong pNode, + ulong pDb, + out ulong pulNextSibId); + +//----------------------------------------------------------------------------- +// getFirstChildId +//----------------------------------------------------------------------------- + + /// + /// Gets the node ID of the first child for this node. + /// + /// + /// Returns the node ID of the first child for this node. + /// + public ulong getFirstChildId() + { + RCODE rc; + ulong ulFirstChildId; + + if ((rc = xflaim_DOMNode_getFirstChildId( m_pNode, m_db.getDb(), + out ulFirstChildId)) != 0) + { + throw new XFlaimException( rc); + } + return( ulFirstChildId); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_getFirstChildId( + ulong pNode, + ulong pDb, + out ulong pulFirstChildId); + +//----------------------------------------------------------------------------- +// getLastChildId +//----------------------------------------------------------------------------- + + /// + /// Gets the node ID of the last child for this node. + /// + /// + /// Returns the node ID of the last child for this node. + /// + public ulong getLastChildId() + { + RCODE rc; + ulong ulLastChildId; + + if ((rc = xflaim_DOMNode_getLastChildId( m_pNode, m_db.getDb(), + out ulLastChildId)) != 0) + { + throw new XFlaimException( rc); + } + return( ulLastChildId); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_getLastChildId( + ulong pNode, + ulong pDb, + out ulong pulLastChildId); + +//----------------------------------------------------------------------------- +// getNameId +//----------------------------------------------------------------------------- + + /// + /// Gets the name ID of this node. + /// + /// + /// Returns the name ID of this node. + /// + public uint getNameId() + { + RCODE rc; + uint uiNameId; + + if ((rc = xflaim_DOMNode_getNameId( m_pNode, m_db.getDb(), + out uiNameId)) != 0) + { + throw new XFlaimException( rc); + } + return( uiNameId); + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_getNameId( + ulong pNode, + ulong pDb, + out uint puiNameId); + +//----------------------------------------------------------------------------- +// setULong +//----------------------------------------------------------------------------- + + /// + /// Sets the value of the node to an unsigned long integer. + /// + /// + /// Value to set into the node. + /// + public void setULong( + ulong ulValue) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setULong( m_pNode, m_db.getDb(), + ulValue, 0)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value of the node to an unsigned long integer. + /// + /// + /// Value to set into the node. + /// + /// + /// Encryption definition to use to encrypt the value. An + /// encryption id of zero means that the value should not be + /// encrypted. + /// + public void setULong( + ulong ulValue, + uint uiEncId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setULong( m_pNode, m_db.getDb(), + ulValue, uiEncId)) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_setULong( + ulong pNode, + ulong pDb, + ulong ulValue, + uint uiEncId); + +//----------------------------------------------------------------------------- +// setAttributeValueULong +//----------------------------------------------------------------------------- + + /// + /// Sets the value for the specified attribute of the node to an unsigned long integer. + /// + /// + /// Name id of attribute whose value is to be set. + /// + /// + /// Value to set into the attribute. + /// + public void setAttributeValueULong( + uint uiAttrNameId, + ulong ulValue) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setAttributeValueULong( m_pNode, m_db.getDb(), + uiAttrNameId, ulValue, 0)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value for the specified attribute of the node to an unsigned long integer. + /// + /// + /// Name id of attribute whose value is to be set. + /// + /// + /// Value to set into the attribute. + /// + /// + /// Encryption definition to use to encrypt the value. An + /// encryption id of zero means that the value should not be + /// encrypted. + /// + public void setAttributeValueULong( + uint uiAttrNameId, + ulong ulValue, + uint uiEncId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setAttributeValueULong( m_pNode, m_db.getDb(), + uiAttrNameId, ulValue, uiEncId)) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_setAttributeValueULong( + ulong pNode, + ulong pDb, + uint uiAttrNameId, + ulong ulValue, + uint uiEncId); + +//----------------------------------------------------------------------------- +// setLong +//----------------------------------------------------------------------------- + + /// + /// Sets the value of the node to a signed long integer. + /// + /// + /// Value to set into the node. + /// + public void setLong( + long lValue) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setLong( m_pNode, m_db.getDb(), + lValue, 0)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value of the node to a signed long integer. + /// + /// + /// Value to set into the node. + /// + /// + /// Encryption definition to use to encrypt the value. An + /// encryption id of zero means that the value should not be + /// encrypted. + /// + public void setLong( + long lValue, + uint uiEncId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setLong( m_pNode, m_db.getDb(), + lValue, uiEncId)) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_setLong( + ulong pNode, + ulong pDb, + long lValue, + uint uiEncId); + +//----------------------------------------------------------------------------- +// setAttributeValueLong +//----------------------------------------------------------------------------- + + /// + /// Sets the value for the specified attribute of the node to a signed long integer. + /// + /// + /// Name id of attribute whose value is to be set. + /// + /// + /// Value to set into the attribute. + /// + public void setAttributeValueLong( + uint uiAttrNameId, + long lValue) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setAttributeValueLong( m_pNode, m_db.getDb(), + uiAttrNameId, lValue, 0)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value for the specified attribute of the node to a signed long integer. + /// + /// + /// Name id of attribute whose value is to be set. + /// + /// + /// Value to set into the attribute. + /// + /// + /// Encryption definition to use to encrypt the value. An + /// encryption id of zero means that the value should not be + /// encrypted. + /// + public void setAttributeValueLong( + uint uiAttrNameId, + long lValue, + uint uiEncId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setAttributeValueLong( m_pNode, m_db.getDb(), + uiAttrNameId, lValue, uiEncId)) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_setAttributeValueLong( + ulong pNode, + ulong pDb, + uint uiAttrNameId, + long lValue, + uint uiEncId); + +//----------------------------------------------------------------------------- +// setUInt +//----------------------------------------------------------------------------- + + /// + /// Sets the value of the node to an unsigned integer. + /// + /// + /// Value to set into the node. + /// + public void setUInt( + uint uiValue) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setUInt( m_pNode, m_db.getDb(), + uiValue, 0)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value of the node to an unsigned integer. + /// + /// + /// Value to set into the node. + /// + /// + /// Encryption definition to use to encrypt the value. An + /// encryption id of zero means that the value should not be + /// encrypted. + /// + public void setUInt( + uint uiValue, + uint uiEncId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setUInt( m_pNode, m_db.getDb(), + uiValue, uiEncId)) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_setUInt( + ulong pNode, + ulong pDb, + uint uiValue, + uint uiEncId); + +//----------------------------------------------------------------------------- +// setAttributeValueUInt +//----------------------------------------------------------------------------- + + /// + /// Sets the value for the specified attribute of the node to an unsigned integer. + /// + /// + /// Name id of attribute whose value is to be set. + /// + /// + /// Value to set into the attribute. + /// + public void setAttributeValueUInt( + uint uiAttrNameId, + uint uiValue) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setAttributeValueUInt( m_pNode, m_db.getDb(), + uiAttrNameId, uiValue, 0)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value for the specified attribute of the node to an unsigned integer. + /// + /// + /// Name id of attribute whose value is to be set. + /// + /// + /// Value to set into the attribute. + /// + /// + /// Encryption definition to use to encrypt the value. An + /// encryption id of zero means that the value should not be + /// encrypted. + /// + public void setAttributeValueUInt( + uint uiAttrNameId, + uint uiValue, + uint uiEncId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setAttributeValueUInt( m_pNode, m_db.getDb(), + uiAttrNameId, uiValue, uiEncId)) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_setAttributeValueUInt( + ulong pNode, + ulong pDb, + uint uiAttrNameId, + uint uiValue, + uint uiEncId); + +//----------------------------------------------------------------------------- +// setInt +//----------------------------------------------------------------------------- + + /// + /// Sets the value of the node to a signed integer. + /// + /// + /// Value to set into the node. + /// + public void setInt( + int iValue) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setInt( m_pNode, m_db.getDb(), + iValue, 0)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value of the node to a signed integer. + /// + /// + /// Value to set into the node. + /// + /// + /// Encryption definition to use to encrypt the value. An + /// encryption id of zero means that the value should not be + /// encrypted. + /// + public void setInt( + int iValue, + uint uiEncId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setInt( m_pNode, m_db.getDb(), + iValue, uiEncId)) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_setInt( + ulong pNode, + ulong pDb, + int iValue, + uint uiEncId); + +//----------------------------------------------------------------------------- +// setAttributeValueInt +//----------------------------------------------------------------------------- + + /// + /// Sets the value for the specified attribute of the node to a signed integer. + /// + /// + /// Name id of attribute whose value is to be set. + /// + /// + /// Value to set into the attribute. + /// + public void setAttributeValueInt( + uint uiAttrNameId, + int iValue) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setAttributeValueInt( m_pNode, m_db.getDb(), + uiAttrNameId, iValue, 0)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value for the specified attribute of the node to a signed integer. + /// + /// + /// Name id of attribute whose value is to be set. + /// + /// + /// Value to set into the attribute. + /// + /// + /// Encryption definition to use to encrypt the value. An + /// encryption id of zero means that the value should not be + /// encrypted. + /// + public void setAttributeValueInt( + uint uiAttrNameId, + int iValue, + uint uiEncId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setAttributeValueInt( m_pNode, m_db.getDb(), + uiAttrNameId, iValue, uiEncId)) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_setAttributeValueInt( + ulong pNode, + ulong pDb, + uint uiAttrNameId, + int iValue, + uint uiEncId); + +//----------------------------------------------------------------------------- +// setString +//----------------------------------------------------------------------------- + + /// + /// Sets the value for the node to a string. + /// + /// + /// Value to set into the node. + /// + public void setString( + string sValue) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setString( m_pNode, m_db.getDb(), + sValue, 1, 0)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value for the node to a string. + /// + /// + /// Value to set into the node. + /// + /// + /// Specifies whether sValue is the last text to be appended to this + /// node. If false, then another call to setString is expected, and + /// the new text will be appended to the text currently stored in this + /// node. If true, then no more text is expected and another call to + /// setString will overwrite the what is currently stored in this node. + /// + public void setString( + string sValue, + bool bLast) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setString( m_pNode, m_db.getDb(), + sValue, (int)(bLast ? 1 : 0), 0)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value for the node to a string. + /// + /// + /// Value to set into the node. + /// + /// + /// Encryption definition to use to encrypt the value. An + /// encryption id of zero means that the value should not be + /// encrypted. + /// + public void setString( + string sValue, + uint uiEncId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setString( m_pNode, m_db.getDb(), + sValue, 1, uiEncId)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value for the node to a string. + /// + /// + /// Value to set into the node. + /// + /// + /// Specifies whether sValue is the last text to be appended to this + /// node. If false, then another call to setString is expected, and + /// the new text will be appended to the text currently stored in this + /// node. If true, then no more text is expected and another call to + /// setString will overwrite the what is currently stored in this node. + /// + /// + /// Encryption definition to use to encrypt the value. An + /// encryption id of zero means that the value should not be + /// encrypted. + /// + public void setString( + string sValue, + bool bLast, + uint uiEncId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setString( m_pNode, m_db.getDb(), + sValue, (int)(bLast ? 1 : 0), uiEncId)) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_setString( + ulong pNode, + ulong pDb, + [MarshalAs(UnmanagedType.LPWStr), In] + string sValue, + int bLast, + uint uiEncId); + +//----------------------------------------------------------------------------- +// setAttributeValueString +//----------------------------------------------------------------------------- + + /// + /// Sets the value for the specified attribute of the node to a string + /// + /// + /// Name id of attribute whose value is to be set. + /// + /// + /// Value to set into the attribute. + /// + public void setAttributeValueString( + uint uiAttrNameId, + string sValue) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setAttributeValueString( m_pNode, m_db.getDb(), + uiAttrNameId, sValue, 0)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value for the specified attribute of the node to a string. + /// + /// + /// Name id of attribute whose value is to be set. + /// + /// + /// Value to set into the attribute. + /// + /// + /// Encryption definition to use to encrypt the value. An + /// encryption id of zero means that the value should not be + /// encrypted. + /// + public void setAttributeValueString( + uint uiAttrNameId, + string sValue, + uint uiEncId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setAttributeValueString( m_pNode, m_db.getDb(), + uiAttrNameId, sValue, uiEncId)) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_setAttributeValueString( + ulong pNode, + ulong pDb, + uint uiAttrNameId, + [MarshalAs(UnmanagedType.LPWStr), In] + string sValue, + uint uiEncId); + +//----------------------------------------------------------------------------- +// setBinary +//----------------------------------------------------------------------------- + + /// + /// Sets the value for the node to a byte array of binary data. + /// + /// + /// Value to set into the node. + /// + public void setBinary( + byte [] ucValue) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setBinary( m_pNode, m_db.getDb(), + ucValue, (uint)ucValue.Length, 1, 0)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value for the node to a byte array of binary data. + /// + /// + /// Value to set into the node. + /// + /// + /// Specifies whether ucValue is the last text to be appended to this + /// node. If false, then another call to setBinary is expected, and + /// the new text will be appended to the text currently stored in this + /// node. If true, then no more text is expected and another call to + /// setBinary will overwrite the what is currently stored in this node. + /// + public void setBinary( + byte [] ucValue, + bool bLast) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setBinary( m_pNode, m_db.getDb(), + ucValue, (uint)ucValue.Length, (int)(bLast ? 1 : 0), 0)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value for the node to a byte array of binary data. + /// + /// + /// Value to set into the node. + /// + /// + /// Encryption definition to use to encrypt the value. An + /// encryption id of zero means that the value should not be + /// encrypted. + /// + public void setBinary( + byte [] ucValue, + uint uiEncId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setBinary( m_pNode, m_db.getDb(), + ucValue, (uint)ucValue.Length, 1, uiEncId)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value for the node to a byte array of binary data. + /// + /// + /// Value to set into the node. + /// + /// + /// Specifies whether ucValue is the last text to be appended to this + /// node. If false, then another call to setBinary is expected, and + /// the new text will be appended to the text currently stored in this + /// node. If true, then no more text is expected and another call to + /// setBinary will overwrite the what is currently stored in this node. + /// + /// + /// Encryption definition to use to encrypt the value. An + /// encryption id of zero means that the value should not be + /// encrypted. + /// + public void setBinary( + byte [] ucValue, + bool bLast, + uint uiEncId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setBinary( m_pNode, m_db.getDb(), + ucValue, (uint)ucValue.Length, (int)(bLast ? 1 : 0), uiEncId)) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_setBinary( + ulong pNode, + ulong pDb, + [MarshalAs(UnmanagedType.LPArray), In] + byte [] ucValue, + uint uiLen, + int bLast, + uint uiEncId); + +//----------------------------------------------------------------------------- +// setAttributeValueBinary +//----------------------------------------------------------------------------- + + /// + /// Sets the value for the specified attribute of the node to a + /// byte array of binary data. + /// + /// + /// Name id of attribute whose value is to be set. + /// + /// + /// Value to set into the attribute. + /// + public void setAttributeValueBinary( + uint uiAttrNameId, + byte [] ucValue) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setAttributeValueBinary( m_pNode, m_db.getDb(), + uiAttrNameId, ucValue, (uint)ucValue.Length, 0)) != 0) + { + throw new XFlaimException( rc); + } + } + + /// + /// Sets the value for the specified attribute of the node to a + /// byte array of binary data. + /// + /// + /// Name id of attribute whose value is to be set. + /// + /// + /// Value to set into the attribute. + /// + /// + /// Encryption definition to use to encrypt the value. An + /// encryption id of zero means that the value should not be + /// encrypted. + /// + public void setAttributeValueBinary( + uint uiAttrNameId, + byte [] ucValue, + uint uiEncId) + { + RCODE rc; + + if ((rc = xflaim_DOMNode_setAttributeValueBinary( m_pNode, m_db.getDb(), + uiAttrNameId, ucValue, (uint)ucValue.Length, uiEncId)) != 0) + { + throw new XFlaimException( rc); + } + } + + [DllImport("xflaim")] + private static extern RCODE xflaim_DOMNode_setAttributeValueBinary( + ulong pNode, + ulong pDb, + uint uiAttrNameId, + [MarshalAs(UnmanagedType.LPWStr), In] + byte [] ucValue, + uint uiLen, + uint uiEncId); + } }