示例#1
0
        // record format :
        //    1 type (0 = raw no meta data, 1 = bson meta, 2 = json meta)
        //    4 byte meta/data length,
        //    n byte meta serialized data if exists
        //    m byte data (if meta exists then m is in meta.dataLength)

        /// <summary>
        /// View data storage mode (no splits, bson save)
        /// </summary>
        /// <param name="filename"></param>
        public StorageFile(string filename)
        {
            _viewmode   = true;
            _saveFormat = SF_FORMAT.BSON;
            // add version number
            _fileheader[5] = (byte)_CurrentVersion;
            Initialize(filename, false);
        }
示例#2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="filename"></param>
 /// <param name="format"></param>
 /// <param name="StorageOnlyMode">= true -> don't create mgrec files (used for backup and replication mode)</param>
 public StorageFile(string filename, SF_FORMAT format, bool StorageOnlyMode)
 {
     _saveFormat = format;
     if (StorageOnlyMode)
     {
         _viewmode = true;                  // no file splits
     }
     // add version number
     _fileheader[5] = (byte)_CurrentVersion;
     Initialize(filename, StorageOnlyMode);
 }