// Copyright 2022 The Abseil Authors // // 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 // // https://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. #ifndef ABSL_STRINGS_INTERNAL_CORD_DATA_EDGE_H_ #define ABSL_STRINGS_INTERNAL_CORD_DATA_EDGE_H_ #include <cassert> #include <cstddef> #include "absl/base/config.h" #include "absl/strings/internal/cord_internal.h" #include "absl/strings/internal/cord_rep_flat.h" #include "absl/strings/string_view.h" namespace absl { ABSL_NAMESPACE_BEGIN namespace cord_internal { // Returns true if the provided rep is a FLAT, EXTERNAL or a SUBSTRING node // holding a FLAT or EXTERNAL child rep. Requires `rep != nullptr`. inline bool IsDataEdge(const CordRep* edge) { … } // Returns the `absl::string_view` data reference for the provided data edge. // Requires 'IsDataEdge(edge) == true`. inline absl::string_view EdgeData(const CordRep* edge) { … } } // namespace cord_internal ABSL_NAMESPACE_END } // namespace absl #endif // ABSL_STRINGS_INTERNAL_CORD_DATA_EDGE_H_