1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ :
3 * This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef mozStorageSQLFunctions_h
8 #define mozStorageSQLFunctions_h
17 * Registers the functions declared here with the specified database.
20 * The database we'll be registering the functions with.
21 * @return the SQLite status code indicating success or failure.
23 int registerFunctions(sqlite3
* aDB
);
25 ////////////////////////////////////////////////////////////////////////////////
26 //// Predefined Functions
29 * Overridden function to perform the SQL functions UPPER and LOWER. These
30 * support unicode, which the default implementations do not do.
33 * The sqlite_context that this function is being called on.
35 * The number of arguments the function is being called with.
37 * An array of the arguments the functions is being called with.
39 void caseFunction(sqlite3_context
* aCtx
, int aArgc
, sqlite3_value
** aArgv
);
42 * Overridden function to perform the SQL function LIKE. This supports unicode,
43 * which the default implementation does not do.
46 * The sqlite_context that this function is being called on.
48 * The number of arguments the function is being called with.
50 * An array of the arguments the functions is being called with.
52 void likeFunction(sqlite3_context
* aCtx
, int aArgc
, sqlite3_value
** aArgv
);
55 * An implementation of the Levenshtein Edit Distance algorithm for use in
59 * The sqlite_context that this function is being called on.
61 * The number of arguments the function is being called with.
63 * An array of the arguments the functions is being called with.
65 void levenshteinDistanceFunction(sqlite3_context
* aCtx
, int aArgc
,
66 sqlite3_value
** aArgv
);
69 * An alternative string length function that uses XPCOM string classes for
70 * string length calculation.
73 * The sqlite_context that this function is being called on.
75 * The number of arguments the function is being called with.
77 * An array of the arguments the functions is being called with.
79 void utf16LengthFunction(sqlite3_context
* aCtx
, int aArgc
,
80 sqlite3_value
** aArgv
);
82 } // namespace storage
83 } // namespace mozilla
85 #endif // mozStorageSQLFunctions_h