summaryrefslogtreecommitdiff
path: root/android/sqlite3_android.cpp
diff options
context:
space:
mode:
authorDaisuke Miyakawa <dmiyakawa@google.com>2010-03-17 10:32:46 +0900
committerDaisuke Miyakawa <dmiyakawa@google.com>2010-03-17 10:34:38 +0900
commit560b951f6455f0ad091213f217895109b4ccb19f (patch)
tree7a5ad053b9176213477923c660e3747260c6d050 /android/sqlite3_android.cpp
parent76b3da43e488769ceaae0698e5e23cfde84b4ce2 (diff)
Remove getPhoneticallySortableString() and its SQLite variant, both of which are now obsolete because we already have icu's collator.
Remain getNormalizedString() but remove SQLite variant since the C function is used internally. Change-Id: If1e4b8388087b78e0f6418ac3c7be4c23f67ee0e
Diffstat (limited to 'android/sqlite3_android.cpp')
-rw-r--r--android/sqlite3_android.cpp60
1 files changed, 0 insertions, 60 deletions
diff --git a/android/sqlite3_android.cpp b/android/sqlite3_android.cpp
index a23d802..a937573 100644
--- a/android/sqlite3_android.cpp
+++ b/android/sqlite3_android.cpp
@@ -30,7 +30,6 @@
#include "sqlite3_android.h"
#include "PhoneNumberUtils.h"
#include "PhonebookIndex.h"
-#include "PhoneticStringUtils.h"
#define ENABLE_ANDROID_LOG 0
#define SMALL_BUFFER_SIZE 10
@@ -121,45 +120,6 @@ static void get_phonebook_index(
sqlite3_result_text(context, (const char*)out, outlen, SQLITE_TRANSIENT);
}
-static void get_phonetically_sortable_string(
- sqlite3_context * context, int argc, sqlite3_value ** argv)
-{
- if (argc != 1) {
- sqlite3_result_null(context);
- return;
- }
- char const * src = (char const *)sqlite3_value_text(argv[0]);
- char * ret;
- size_t len;
-
- if (!android::GetPhoneticallySortableString(src, &ret, &len)) {
- // Put this text at the end of a list.
- sqlite3_result_text(context, "\xF0\x9F\xBF\xBD", -1, SQLITE_STATIC);
- // sqlite3_result_null(context);
- } else {
- sqlite3_result_text(context, ret, len, free);
- }
-}
-
-static void get_normalized_string(
- sqlite3_context * context, int argc, sqlite3_value ** argv)
-{
- if (argc != 1) {
- sqlite3_result_null(context);
- return;
- }
- char const * src = (char const *)sqlite3_value_text(argv[0]);
- char * ret;
- size_t len;
-
- if (!android::GetNormalizedString(src, &ret, &len)) {
- // Probably broken string. Return 0 length string.
- sqlite3_result_text(context, "", -1, SQLITE_STATIC);
- } else {
- sqlite3_result_text(context, ret, len, free);
- }
-}
-
static void phone_numbers_equal(sqlite3_context * context, int argc, sqlite3_value ** argv)
{
if (argc != 2 && argc != 3) {
@@ -568,26 +528,6 @@ extern "C" int register_android_functions(sqlite3 * handle, int utf16Storage)
}
#endif
- // Register the GET_PHONETICALLY_SORTABLE_STRING function
- err = sqlite3_create_function(handle,
- "GET_PHONETICALLY_SORTABLE_STRING",
- 1, SQLITE_UTF8, NULL,
- get_phonetically_sortable_string,
- NULL, NULL);
- if (err != SQLITE_OK) {
- return err;
- }
-
- // Register the GET_NORMALIZED_STRING function
- err = sqlite3_create_function(handle,
- "GET_NORMALIZED_STRING",
- 1, SQLITE_UTF8, NULL,
- get_normalized_string,
- NULL, NULL);
- if (err != SQLITE_OK) {
- return err;
- }
-
// Register the GET_PHONEBOOK_INDEX function
err = sqlite3_create_function(handle,
"GET_PHONEBOOK_INDEX",