Path: blob/master/Utilities/cmcppdap/src/null_json_serializer.h
3153 views
// Copyright 2020 Google LLC1//2// Licensed under the Apache License, Version 2.0 (the "License");3// you may not use this file except in compliance with the License.4// You may obtain a copy of the License at5//6// https://www.apache.org/licenses/LICENSE-2.07//8// Unless required by applicable law or agreed to in writing, software9// distributed under the License is distributed on an "AS IS" BASIS,10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.11// See the License for the specific language governing permissions and12// limitations under the License.1314#ifndef dap_null_json_serializer_h15#define dap_null_json_serializer_h1617#include "dap/protocol.h"18#include "dap/serialization.h"19#include "dap/types.h"2021namespace dap {22namespace json {2324struct NullDeserializer : public dap::Deserializer {25static NullDeserializer instance;2627bool deserialize(dap::boolean*) const override { return false; }28bool deserialize(dap::integer*) const override { return false; }29bool deserialize(dap::number*) const override { return false; }30bool deserialize(dap::string*) const override { return false; }31bool deserialize(dap::object*) const override { return false; }32bool deserialize(dap::any*) const override { return false; }33size_t count() const override { return 0; }34bool array(const std::function<bool(dap::Deserializer*)>&) const override {35return false;36}37bool field(const std::string&,38const std::function<bool(dap::Deserializer*)>&) const override {39return false;40}41};4243} // namespace json44} // namespace dap4546#endif // dap_null_json_serializer_h474849