folly/folly/json/json_patch.cpp

/*
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <folly/json/json_patch.h>

#include <glog/logging.h>

#include <folly/container/Enumerate.h>

namespace folly {

// JSON patch operation names
constexpr StringPiece kOperationTest =;
constexpr StringPiece kOperationRemove =;
constexpr StringPiece kOperationAdd =;
constexpr StringPiece kOperationReplace =;
constexpr StringPiece kOperationMove =;
constexpr StringPiece kOperationCopy =;
// field tags in JSON patch
constexpr StringPiece kOpTag =;
constexpr StringPiece kValueTag =;
constexpr StringPiece kPathTag =;
constexpr StringPiece kFromTag =;

// static
Expected<json_patch, json_patch::parse_error> json_patch::try_parse(
    dynamic const& obj) noexcept {}

std::vector<json_patch::patch_operation> const& json_patch::ops() const {}

namespace {

// clang-format off
Expected<Unit, json_patch::patch_application_error_code>
// clang-format on
do_remove(dynamic::resolved_json_pointer<dynamic>& ptr) {}

// clang-format off
Expected<Unit, json_patch::patch_application_error_code>
// clang-format on
do_add(
    dynamic::resolved_json_pointer<dynamic>& ptr,
    const dynamic& value,
    const std::string& last_token) {}
} // namespace

// clang-format off
Expected<Unit, json_patch::patch_application_error>
// clang-format on
json_patch::apply(dynamic& obj) const {}

} // namespace folly