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 1 kB image not shown  

Quelle  nsLanguageAtomService.h

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


/*
 * The nsILanguageAtomService provides a mapping from languages or charsets
 * to language groups, and access to the system locale language.
 */


#ifndef nsLanguageAtomService_h_
#define nsLanguageAtomService_h_

#include "mozilla/NotNull.h"
#include "mozilla/RefPtr.h"
#include "mozilla/RWLock.h"
#include "mozilla/StaticPtr.h"
#include "nsAtomHashKeys.h"
#include "nsTHashMap.h"

namespace mozilla {
class Encoding;
}

class nsLanguageAtomService final {
  using Encoding = mozilla::Encoding;
  template <typename T>
  using NotNull = mozilla::NotNull<T>;

 public:
  static nsLanguageAtomService* GetService();

  static void Shutdown();

  nsStaticAtom* LookupLanguage(const nsACString& aLanguage);
  nsAtom* GetLocaleLanguage();

  // Returns the language group that the specified language is a part of,
  // using a cache to avoid repeatedly doing full lookups.
  nsStaticAtom* GetLanguageGroup(nsAtom* aLanguage);

 private:
  // The core implementation of lang-tag to language-group lookup. (Now used
  // only internally by GetLanguageGroup.)
  nsStaticAtom* GetUncachedLanguageGroup(nsAtom* aLanguage) const;

  static mozilla::StaticAutoPtr<nsLanguageAtomService> sLangAtomService;

  nsTHashMap<RefPtr<nsAtom>, nsStaticAtom*> mLangToGroup MOZ_GUARDED_BY(mLock);
  RefPtr<nsAtom> mLocaleLanguage MOZ_GUARDED_BY(mLock);

  mozilla::RWLock mLock{"LanguageAtomService"};
};

#endif

Messung V0.5 in Prozent
C=86 H=100 G=93

¤ 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.