diff options
author | vadim-xd <vadim-xd@yandex-team.com> | 2024-10-29 23:26:02 +0300 |
---|---|---|
committer | vadim-xd <vadim-xd@yandex-team.com> | 2024-10-29 23:37:18 +0300 |
commit | c0831b65c047f0894f63562b9da3024dfa779baf (patch) | |
tree | 81aded4973d6396774de89e8c5bc0796307628d5 /contrib/libs/protoc | |
parent | fa653f89746744964114f44dce53c0f6ffb6deba (diff) | |
download | ydb-c0831b65c047f0894f63562b9da3024dfa779baf.tar.gz |
[protobuf] Restore methods with std::string_view
commit_hash:abb56697e948fac46777acec62a62b40767ea74d
Diffstat (limited to 'contrib/libs/protoc')
-rw-r--r-- | contrib/libs/protoc/src/google/protobuf/compiler/cpp/field_generators/string_field.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/field_generators/string_field.cc b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/field_generators/string_field.cc index 11b5b83ea6..0da0e56609 100644 --- a/contrib/libs/protoc/src/google/protobuf/compiler/cpp/field_generators/string_field.cc +++ b/contrib/libs/protoc/src/google/protobuf/compiler/cpp/field_generators/string_field.cc @@ -781,11 +781,19 @@ void RepeatedString::GenerateAccessorDeclarations(io::Printer* p) const { $DEPRECATED$ void $set_name$(int index, TProtoStringType&& value); $DEPRECATED$ void $set_name$(int index, const char* value); $DEPRECATED$ void $set_name$(int index, const $byte$* value, std::size_t size); + $DEPRECATED$ void $set_name$(int index, y_absl::string_view value); + $DEPRECATED$ void $set_name$(int index, std::string&& value) { + return $set_name$(index, TProtoStringType(std::move(value))); + } $DEPRECATED$ TProtoStringType* $add_name$(); $DEPRECATED$ void $add_name$(const TProtoStringType& value); $DEPRECATED$ void $add_name$(TProtoStringType&& value); $DEPRECATED$ void $add_name$(const char* value); $DEPRECATED$ void $add_name$(const $byte$* value, std::size_t size); + $DEPRECATED$ void $add_name$(y_absl::string_view value); + $DEPRECATED$ void $add_name$(std::string&& value) { + return $add_name$(TProtoStringType(std::move(value))); + } $DEPRECATED$ const $pb$::RepeatedPtrField<TProtoStringType>& $name$() const; $DEPRECATED$ $pb$::RepeatedPtrField<TProtoStringType>* $mutable_name$(); @@ -850,6 +858,11 @@ void RepeatedString::GenerateInlineAccessorDefinitions(io::Printer* p) const { $annotate_set$; // @@protoc_insertion_point(field_set_pointer:$pkg.Msg.field$) } + inline void $Msg$::set_$name$(int index, y_absl::string_view value) { + $field_$.Mutable(index)->assign(value.data(), value.size()); + $annotate_set$; + // @@protoc_insertion_point(field_set_string_piece:$pkg.Msg.field$) + } inline TProtoStringType* $Msg$::_internal_add_$name$() { return $field_$.Add(); } inline void $Msg$::add_$name$(const TProtoStringType& value) { $field_$.Add()->assign(value); @@ -872,6 +885,11 @@ void RepeatedString::GenerateInlineAccessorDefinitions(io::Printer* p) const { $annotate_add$; // @@protoc_insertion_point(field_add_pointer:$pkg.Msg.field$) } + inline void $Msg$::add_$name$(y_absl::string_view value) { + $field_$.Add()->assign(value.data(), value.size()); + $annotate_add$; + // @@protoc_insertion_point(field_add_string_piece:$pkg.Msg.field$) + } inline const ::$proto_ns$::RepeatedPtrField<TProtoStringType>& $Msg$::$name$() const { $annotate_list$; |