michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: #include "nsIFile.idl" michael@0: michael@0: // Note that the PrefixSet name is historical and we do properly support michael@0: // duplicated values, so it's really a Prefix Trie. michael@0: // All methods are thread-safe. michael@0: [scriptable, uuid(3d8579f0-75fa-4e00-ba41-38661d5b5d17)] michael@0: interface nsIUrlClassifierPrefixSet : nsISupports michael@0: { michael@0: // Initialize the PrefixSet. Give it a name for memory reporting. michael@0: void init(in ACString aName); michael@0: // Fills the PrefixSet with the given array of prefixes. michael@0: // Can send an empty Array to clear the tree. michael@0: // Requires array to be sorted. michael@0: void setPrefixes([const, array, size_is(aLength)] in unsigned long aPrefixes, michael@0: in unsigned long aLength); michael@0: void getPrefixes(out unsigned long aCount, michael@0: [array, size_is(aCount), retval] out unsigned long aPrefixes); michael@0: // Do a lookup in the PrefixSet, return whether the value is present. michael@0: boolean contains(in unsigned long aPrefix); michael@0: boolean isEmpty(); michael@0: void loadFromFile(in nsIFile aFile); michael@0: void storeToFile(in nsIFile aFile); michael@0: };