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