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

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


#ifndef mozilla_widget_GSettings_h
#define mozilla_widget_GSettings_h

#include "nsStringFwd.h"
#include "mozilla/RefPtr.h"
#include "mozilla/Maybe.h"
#include "nsTArrayForwardDeclare.h"

using GSettings = struct _GSettings;
using GVariant = struct _GVariant;

namespace mozilla::widget::GSettings {

class Collection {
 public:
  explicit Collection(const nsCString& aSchema);
  ~Collection();

  explicit operator bool() const { return !!mSettings; }

  Collection(const Collection&) = delete;

  bool SetString(const nsCString& aKey, const nsCString& aValue);
  bool GetString(const nsCString& aKey, nsACString& aResult) const;
  bool GetStringList(const nsCString& aKey, nsTArray<nsCString>& aResult) const;

  Maybe<bool> GetBoolean(const nsCString&) const;
  Maybe<int32_t> GetInt(const nsCString&) const;

 private:
  RefPtr<GVariant> GetValue(const nsCString&) const;
  bool HasKey(const nsCString&) const;

  RefPtr<::GSettings> mSettings;
  char** mKeys = nullptr;
};

inline bool GetString(const nsCString& aSchema, const nsCString& aKey,
                      nsACString& aResult) {
  Collection collection(aSchema);
  return collection && collection.GetString(aKey, aResult);
}

inline Maybe<bool> GetBoolean(const nsCString& aSchema, const nsCString& aKey) {
  Collection collection(aSchema);
  if (!collection) {
    return {};
  }
  return collection.GetBoolean(aKey);
}

inline Maybe<int32_t> GetInt(const nsCString& aSchema, const nsCString& aKey) {
  Collection collection(aSchema);
  if (!collection) {
    return {};
  }
  return collection.GetInt(aKey);
}

}  // namespace mozilla::widget::GSettings

#endif

Messung V0.5 in Prozent
C=98 H=100 G=98

¤ Dauer der Verarbeitung: 0.10 Sekunden  (vorverarbeitet am  2026-09-29) ¤

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