Eine aufbereitete Darstellung der Quelle

 
     
 
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung


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
CHZG
1009910099

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.1Angebot  (Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-11-25) ¤

*Eine klare Vorstellung vom Zielzustand







                                                                                                                                                                                                                                                                                                                                                                                                     

 

Neuigkeiten

Aktuelles
Motto des Tages

letze Version des Elbe Quellennavigators


letze Version des Demonstrationsprogramms Goedel
letze Version des Bille Abgleichprogramms
Version

Jenseits des Üblichen ....

Besucher

Besucher

Statistik
#Sources=1,189,130
#Domains=945,869