rtXmlKeyArray.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C) 2008 by Objective Systems, Inc.
00003  *
00004  * This software is furnished under a license and may be used and copied
00005  * only in accordance with the terms of such license and with the
00006  * inclusion of the above copyright notice. This software or any other
00007  * copies thereof may not be provided or otherwise made available to any
00008  * other person. No title to and ownership of the software is hereby
00009  * transferred.
00010  *
00011  * The information in this software is subject to change without notice
00012  * and should not be construed as a commitment by Objective Systems, Inc.
00013  *
00014  * PROPRIETARY NOTICE
00015  *
00016  * This software is an unpublished work subject to a confidentiality agreement
00017  * and is protected by copyright and trade secret law.  Unauthorized copying,
00018  * redistribution or other use of this work is prohibited.
00019  *
00020  * The above notice of copyright on this source code product does not indicate
00021  * any actual or intended publication of such source code.
00022  *
00023  *****************************************************************************/
00027 #ifndef _RTXMLKEYARRAY_H_
00028 #define _RTXMLKEYARRAY_H_
00029 
00030 #include "rtxsrc/rtxContext.h"
00031 #include "rtxmlsrc/rtXmlExternDefs.h"
00032 
00033 #ifdef __cplusplus
00034 extern "C" {
00035 #endif
00036 
00037 typedef enum {
00038    OSXSDString, OSXSDDecimal,
00039    OSXSDInt, OSXSDUInt
00040 } OSXSDFieldDataType;
00041 
00042 typedef struct {
00043   OSINT8 tag;
00044   OSINT8 subTag;
00045   OSUINT16 dummy; /* alignment */
00046   
00047   union {
00048      OSINT32 int32;
00049      OSUINT32 uint32;
00050      const OSOCTET* pValue;
00051   } u;
00052 } OSXSDKeyRecord;
00053 
00054 typedef struct {
00055    OSUINT32        capacity;       /* Current size of the array buffer */
00056    OSUINT32        count;          /* Number of keys in array          */
00057    OSUINT32        nmFields;       /* Number of fields in key          */
00058    OSUINT32        curField;       /* Expected field number            */
00059    OSXSDKeyRecord* data;           /* The actual pointer values        */
00060    const char* name;               /* Constrain name                   */
00061    OSBOOL          keyConstraint;  /* Key or unique constraint         */
00062    OSINT8          duplicateField; /* Index of duplicated field        */
00063    OSINT8          absentField;    /* Index of absent field            */
00064 } OSXSDKeyArray;
00065 
00066 
00067 EXTERNXML int rtXmlKeyArrayInit 
00068 (OSCTXT* pctxt, OSXSDKeyArray* pArray, OSUINT32 nmFields, OSBOOL key,
00069  const char* name);
00070 
00071 EXTERNXML void rtXmlKeyArrayFree 
00072 (OSCTXT* pctxt, OSXSDKeyArray* pArray);
00073 
00074 
00075 EXTERNXML void rtXmlKeyArraySetString 
00076 (OSXSDKeyArray* pArray, const OSUTF8CHAR* pValue, OSUINT32 fldNum);
00077 
00078 EXTERNXML void rtXmlKeyArraySetInt 
00079 (OSXSDKeyArray* pArray, OSINT32 value, OSUINT32 fldNum);
00080 
00081 EXTERNXML void rtXmlKeyArraySetUInt 
00082 (OSXSDKeyArray* pArray, OSUINT32 value, OSUINT32 fldNum);
00083 
00084 EXTERNXML void rtXmlKeyArraySetDecimal 
00085 (OSXSDKeyArray* pArray, const OSREAL* value, OSUINT32 fldNum);
00086 
00087 
00088 EXTERNXML int rtXmlKeyArrayAdd 
00089 (OSCTXT* pctxt, OSXSDKeyArray* pArray);
00090 
00091 EXTERNXML int rtXmlKeyArrayContains 
00092 (OSCTXT* pctxt, OSXSDKeyArray* pArray);
00093 
00094 #ifdef __cplusplus
00095 }
00096 #endif
00097 
00098 #endif