Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Firefox/intl/locale/   (Firefox Browser Version 153.0.1©)  Datei vom 27.6.2026 mit Größe 2 kB image not shown  

Quelle  AppCollator.cpp

  Sprache: C
 

/* 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/. */


#include "mozilla/intl/AppCollator.h"
#include "mozilla/intl/LocaleService.h"
#include "nsString.h"

extern "C" {
void mozilla_app_collator_glue_initialize(const nsACString* locale);
int mozilla_app_collator_glue_install_sqlite3_collation_callbacks(sqlite3* aDB);
int32_t mozilla_app_collator_compare_utf8(const char* left, size_t left_len,
                                          const char* right, size_t right_len);
int32_t mozilla_app_collator_compare_utf16(const char16_t* left,
                                           size_t left_len,
                                           const char16_t* right,
                                           size_t right_len);
int32_t mozilla_app_collator_compare_base_utf8(const char* left,
                                               size_t left_len,
                                               const char* right,
                                               size_t right_len);
int32_t mozilla_app_collator_compare_base_utf16(const char16_t* left,
                                                size_t left_len,
                                                const char16_t* right,
                                                size_t right_len);
}

using namespace mozilla::intl;

// static
void AppCollator::Initialize() {
  nsAutoCStringN<32> appLocale;
  mozilla::intl::LocaleService::GetInstance()->GetAppLocaleAsBCP47(appLocale);
  mozilla_app_collator_glue_initialize(&appLocale);
}

// static
int AppCollator::InstallCallbacks(sqlite3* aDB) {
  return mozilla_app_collator_glue_install_sqlite3_collation_callbacks(aDB);
}

// static
int32_t AppCollator::Compare(mozilla::Span<const char> aLeft,
                             mozilla::Span<const char> aRight) {
  return mozilla_app_collator_compare_utf8(aLeft.Elements(), aLeft.Length(),
                                           aRight.Elements(), aRight.Length());
}

// static
int32_t AppCollator::Compare(mozilla::Span<const char16_t> aLeft,
                             mozilla::Span<const char16_t> aRight) {
  return mozilla_app_collator_compare_utf16(aLeft.Elements(), aLeft.Length(),
                                            aRight.Elements(), aRight.Length());
}

// static
int32_t AppCollator::CompareBase(mozilla::Span<const char> aLeft,
                                 mozilla::Span<const char> aRight) {
  return mozilla_app_collator_compare_base_utf8(
      aLeft.Elements(), aLeft.Length(), aRight.Elements(), aRight.Length());
}

// static
int32_t AppCollator::CompareBase(mozilla::Span<const char16_t> aLeft,
                                 mozilla::Span<const char16_t> aRight) {
  return mozilla_app_collator_compare_base_utf16(
      aLeft.Elements(), aLeft.Length(), aRight.Elements(), aRight.Length());
}

Messung V0.5 in Prozent
C=91 H=95 G=92

¤ Dauer der Verarbeitung: 0.16 Sekunden  (vorverarbeitet am  2026-08-25) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.