Quellcode-Bibliothek SharedJSONHandler.h
Sprache: C
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ /* 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/. */
// Base class of all principal JSON parse handlers. class PrincipalJSONHandlerShared : public JS::JSONParseHandler { public: // Common handlers for inner objects.
// NOTE: propertyName and stringValue are partial overloads. // Subclasses should put the following: // * `using PrincipalJSONHandlerShared::propertyName` // * `using PrincipalJSONHandlerShared::stringValue` virtualbool propertyName(const char16_t* name, size_t length) override {
NS_WARNING("Principal JSON shouldn't use non-ASCII");
SetErrorState(); returnfalse;
};
protected: // Set to the error state for the above handlers. virtualvoid SetErrorState() = 0;
public:
RefPtr<BasePrincipal> mPrincipal;
};
// Base class shared between PrincipalJSONHandler and // SubsumedPrincipalJSONHandler. // This implements the common code for them, absorbing the difference about // whether it can contain ExpandedPrincipal or not. template <typename HandlerTypesT> class ContainerPrincipalJSONHandler : public PrincipalJSONHandlerShared { using State = typename HandlerTypesT::State; using InnerHandlerT = typename HandlerTypesT::InnerHandlerT; static constexpr bool CanContainExpandedPrincipal =
HandlerTypesT::CanContainExpandedPrincipal;
¤ 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.0.22Bemerkung:
(vorverarbeitet)
¤
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 ist noch experimentell.