Beispiel #1
0
        /// <summary>
        /// Standardowy konstruktor
        /// </summary>
        /// <param name="workingDirPath">Ścieżka do słownika (istniejącego albo do utworzenia)</param>
        /// <param name="mode">Tryb pracy</param>
        /// <param name="idAllocator">Alokator ID nowo dodawanych do słownika tokenów</param>
        public IxFwdDistDiskDict(string workingDirPath, IxDictionaryMode mode, IIxDictionaryIdAllocator idAllocator)
            : base(idAllocator)
        {
            this.workingDirPath = Misc.provideEndBackslash(workingDirPath);
            Misc.provideDirectory(this.workingDirPath);

            this.mode = mode;

            initDictionaries();
        }
Beispiel #2
0
        /// <summary>
        /// Standardowy konstruktor.
        /// </summary>
        /// <param name="workingDirPath">Ścieżka do katalogu słownika (w trybie CREATE musi być pusty albo nie istnieć)</param>
        /// <param name="mode">Tryb pracy słownika</param>
        /// <param name="idAllocator">Alokator identyfikatorów dla nowo dodawanych tokenów</param>
        public IxStdFwdDiskDict(string workingDirPath, IxDictionaryMode mode, IIxDictionaryIdAllocator idAllocator)
        {
            this.workingDirPath = Misc.provideEndBackslash(workingDirPath);
            Misc.provideDirectory(this.workingDirPath);

            dictionaryFilePath = this.workingDirPath + "dictionary.dat";
            dictionaryTmpFilePath = this.workingDirPath + "dictionary.tmp";
            indexFilePath = this.workingDirPath + "dictionary.idx";
            indexTmpFilePath = this.workingDirPath + "dictionary.idx.tmp";

            this.mode = mode;
            this.idAllocator = idAllocator;

            cacheDictionary = new Dictionary<string, uint>(StringComparer.Ordinal);

            openDictionaryAndIndex();

            if (mode == IxDictionaryMode.READ)
            {
                IndexEntry entry;

                while ((entry = readIndex(indexFileBR)) != null)
                {
                    indexCache.add(entry);
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// Standardowy konstruktor
        /// </summary>
        /// <param name="workingDirPath">Ścieżka do katalogu plików danych słownika</param>
        /// <param name="mode">Tryb pracy słownika</param>
        public IxStdBkdDiskDict(string workingDirPath, IxDictionaryMode mode)
        {
            this.workingDirPath = Misc.provideEndBackslash(workingDirPath);
            Misc.provideDirectory(this.workingDirPath);

            this.mode = mode;

            openFiles();
        }