Main Page | Class Hierarchy | Compound List | File List | Compound Members

BxBinxSchema.h

00001 /********************************************************************
00002  * Binx
00003  * $Id: BxBinxSchema_8h-source.html,v 1.1.1.1 2006/04/19 14:19:02 edikt2 Exp $
00004  *
00005  * BinX schema definitions
00006  *
00007  *
00008  * edikt::BinX
00009  * www.edikt.org
00010  * support@edikt.org
00011  *
00012  * Copyright (c) 2005 The University of Edinburgh.
00013  *
00014  ********************************************************************/
00015 
00016 #ifndef BXBINXSCHEMA_H
00017 #define BXBINXSCHEMA_H
00018 
00019 #include "BxObject.h"
00020 
00021 // set compiler to use integers for enum.
00022 // will be used as indexes of an array.
00023 enum BxBinxTagNumber
00024 {
00025     BX_TAG_NULL = 0,     //added to start from 0
00026     BX_TAG_ROOT,
00027     BX_TAG_PARAMETERS,
00028     BX_TAG_DEFINITIONS,
00029     BX_TAG_DATASET,
00030     BX_TAG_DEFINETYPE,
00031     BX_TAG_USETYPE,
00032     BX_TAG_STRUCT,
00033     BX_TAG_UNION,
00034     BX_TAG_ARRAY,
00035     BX_TAG_ARRAYFIXED,
00036     BX_TAG_ARRAYVARIABLE,
00037     BX_TAG_ARRAYSTREAMED,
00038     BX_TAG_ARRAYDATA,   //for implicit array data
00039     BX_TAG_DIMENSION,
00040     BX_TAG_DIMVARIABLE,    //obsolete
00041     BX_TAG_DIMSTREAMED,    //obsolete
00042     BX_TAG_VARRAYSIZE,          //for arrayVariable only
00043     BX_TAG_DATATYPE,    //STARTS A DATATYPE SECTION
00044     BX_TAG_BIT1,           //not currently supported
00045     BX_TAG_BYTE8,
00046     BX_TAG_CHARACTER8,
00047     BX_TAG_UNICODE16,
00048     BX_TAG_UNICODE32,
00049     BX_TAG_ENUM32,         //not used by new schema
00050     BX_TAG_SHORT16,
00051     BX_TAG_INTEGER32,
00052     BX_TAG_LONG64,
00053     BX_TAG_UNSIGNEDBYTE8,   //added in new schema
00054     BX_TAG_UNSIGNEDSHORT16,
00055     BX_TAG_UNSIGNEDINTEGER32,
00056     BX_TAG_UNSIGNEDLONG64,
00057     BX_TAG_FLOAT32,
00058     BX_TAG_DOUBLE64,
00059     BX_TAG_EXTENDED80,
00060     BX_TAG_EXTENDED96,
00061     BX_TAG_QUADRUPLE128,
00062     BX_TAG_VOID0,
00063     BX_TAG_DISCRIMINANT,
00064     BX_TAG_VAL, //<enum-32,...<val...
00065     BX_TAG_CASE,    //<union,...<case...
00066     BX_TAG_DEFINETYPE_SYN,  //synonyms, kept here to enlarge the array
00067     BX_TAG_USETYPE_SYN,     //so that BX_TAG_END reflect the last element in array
00068     BX_TAG_DATASET_FILE, //both <dataset> and <file> ok for this version
00069     BX_TAG_SYN1,    //synonym space reservation
00070     BX_TAG_SYN2,
00071     BX_TAG_SYN3,
00072     BX_TAG_SYN4,
00073     BX_TAG_SYN5,
00074     BX_TAG_SYN6,
00075     BX_TAG_SYN7,
00076     BX_TAG_SYN8,
00077     BX_TAG_SYN9,
00078     BX_TAG_DATABINX,
00079     BX_TAG_STRING,  //added for databinx
00080     BX_TAG_END  //not used, mark the end of the list
00081 };
00082 
00083 struct BxBinxTagTable
00084 {
00085     BxBinxTagNumber number_;
00086     char* name_;
00087 };
00088 
00107 class BxBinxSchema : public BxObject
00108 {
00109 public:
00110         // The default constructor
00111     BxBinxSchema();
00112 
00113         // The destructor
00114     virtual ~BxBinxSchema() {}
00115 
00116     static BxBinxTagNumber search(const char* const tag);
00117     static const char* searchTagByDataClass(int dataclass);
00118 
00119     static const BxBinxTagTable tags[];     //element tags
00120 
00121     static const char* xmlHeader;  //<?xml version=...
00122     static const char* binxNameSpace;      //namespace for binx
00123     static const char* databinxNameSpace;  //namespace for databinx
00124 
00125     static const char* attrTypeName;     //attribute typeName="..."
00126     static const char* attrVarName;      //varName="..."
00127     static const char* attrTestValue;    //testValue="..."
00128     static const char* attrIndexFrom;    //<dim indexFrom="..."
00129     static const char* attrIndexTo;      //<dim indexTo="..."
00130     static const char* attrCount;        //<dim count="..."
00131     static const char* attrIndex;        //<dim index="0"  for implicit XML
00132     static const char* attrName;         //<val name="...", <dim name="d1">
00133     static const char* attrValue;        //<val value="0"
00134     static const char* attrSrc;          //<file src="..."
00135     static const char* attrByteOrder;    //byteOrder="bigEndian | littleEndian"
00136     static const char* attrBitOrder;     //bitOrder
00137     static const char* attrBlockSize;    //blockSize
00138     static const char* attrDim;          //dim="..."
00139     static const char* attrIgnore;       //ignore="true"
00140     static const char* attrKey;          //key="primaryKey"
00141     static const char* attrInfo;         //info
00142     static const char* attrOffset;       //offset="1002"
00143     static const char* attrDiscriminantValue; //<case discriminantValue="1"
00144     static const char* attrXref;           //<dim href="binx_file"
00145     static const char* attrType;           //<array type="Variable"
00146     static const char* attrSize;       //<string size="10"
00147     static const char* attrDelim;      //<string delim="\n"
00148     static const char* attrSizeType;   //<string sizeType="byte-8"
00149     
00150     static const char* valBigEndian;       //value of attribute byteOrder="bigEndian"
00151     static const char* valLittleEndian;    //byteOrder="littleEndian"
00152     static const char* valFixed;           //type="Fixed", "fixed", "FIXED"
00153     static const char* valVariable;        //type="Variable"
00154     static const char* valStreamed;        //type="Streamed"
00155 };
00156 
00157 #endif

Generated on Fri May 6 13:36:17 2005 for edikt::BinX by doxygen 1.3.3