Exemple #1
0
        private string GetIndexFilePath(string bsname, IndexFileType fileType)
        {
            string filename;

            switch (fileType)
            {
            case IndexFileType.BlobIndex:
                filename = Path.Combine(IndexDirectory, Core.BackupBlobIndexFile);
                break;

            case IndexFileType.BackupSet:
                filename = Path.Combine(IndexDirectory, "backupstores", bsname);
                break;

            case IndexFileType.SettingsFile:
                filename = Path.Combine(IndexDirectory, Core.SettingsFilename);
                break;

            case IndexFileType.EncryptorKeyFile:
                filename = Path.Combine(IndexDirectory, "keyfile");
                break;

            default:
                throw new ArgumentException("Unknown IndexFileType");
            }
            return(filename);
        }
Exemple #2
0
 internal DbfTableParametersReadOnly(DbfTableParameters parameters)
 {
     encoding        = parameters.encoding;
     openMemo        = parameters.openMemo;
     strictHeader    = parameters.strictHeader;
     tableType       = parameters.tableType;
     memoType        = parameters.memoType;
     indexType       = parameters.indexType;
     memoTerminators = parameters.memoTerminators;
     openMode        = parameters.openMode;
 }
Exemple #3
0
        public DbfTableParameters(DbfTableOpenMode?openmode = null, Encoding encoding     = null, bool?openMemo           = null, StrictHeader?strictHeader = null,
                                  DbfTableType?tableType    = null, MemoFileType?memoType = null, IndexFileType?indexType = null)
        {
            _encoding        = null;
            _openMemo        = false;
            _strictHeader    = 0;
            _tableType       = 0;
            _memoType        = 0;
            _indexType       = 0;
            _memoTerminators = 0;
            _openMode        = 0;

            //

            this.encoding     = encoding;                                       // null value mean "ReadDbfHeader_Encoding(_header.codepageCode)" will work
            this.openMemo     = openMemo ?? defaultOpenMemo;
            this.strictHeader = strictHeader ?? defaultStrictHeader;
            this.tableType    = tableType ?? defaultTableType;
            this.memoType     = memoType ?? defaultMemoType;
            this.indexType    = indexType ?? defaultIndexType;

            this.memoTerminators = defaultMemoTerminators;
            this.openMode        = openmode ?? defaultOpenMode;
        }
Exemple #4
0
 public Task StoreIndexFileAsync(string bsname, IndexFileType fileType, byte[] data)
 {
     return(StoreFileAsync(GetIndexFilePath(bsname, fileType), data, fileType == IndexFileType.EncryptorKeyFile));
 }
Exemple #5
0
 public Task <byte[]> LoadIndexFileAsync(string bsname, IndexFileType fileType)
 {
     return(LoadFileAsync(GetIndexFilePath(bsname, fileType), fileType == IndexFileType.EncryptorKeyFile));
 }
Exemple #6
0
 public Task <bool> IndexFileExistsAsync(string bsname, IndexFileType fileType)
 {
     return(FileExistsAsync(GetIndexFilePath(bsname, fileType)));
 }