1 // Protocol Buffers - Google's data interchange format 2 // Copyright 2008-2024 Google Inc. All rights reserved. 3 // 4 // Use of this source code is governed by a BSD-style 5 // license that can be found in the LICENSE file or at 6 // https://developers.google.com/open-source/licenses/bsd 7 8 #ifndef GOOGLE_PROTOBUF_COMPILER_CODE_GENERATOR_LITE_H__ 9 #define GOOGLE_PROTOBUF_COMPILER_CODE_GENERATOR_LITE_H__ 10 11 #include <string> 12 #include <utility> 13 #include <vector> 14 15 #include "absl/strings/string_view.h" 16 17 // Must be included last. 18 #include "google/protobuf/port_def.inc" 19 20 namespace google { 21 namespace protobuf { 22 namespace compiler { 23 24 // Several code generators treat the parameter argument as holding a 25 // list of options separated by commas. This helper function parses 26 // a set of comma-delimited name/value pairs: e.g., 27 // "foo=bar,baz,moo=corge" 28 // parses to the pairs: 29 // ("foo", "bar"), ("baz", ""), ("moo", "corge") 30 PROTOC_EXPORT void ParseGeneratorParameter( 31 absl::string_view, std::vector<std::pair<std::string, std::string> >*); 32 33 // Strips ".proto" or ".protodevel" from the end of a filename. 34 PROTOC_EXPORT std::string StripProto(absl::string_view filename); 35 36 // Returns true if the proto path corresponds to a known feature file. 37 PROTOC_EXPORT bool IsKnownFeatureProto(absl::string_view filename); 38 39 } // namespace compiler 40 } // namespace protobuf 41 } // namespace google 42 43 #include "google/protobuf/port_undef.inc" 44 45 #endif // GOOGLE_PROTOBUF_COMPILER_CODE_GENERATOR_LITE_H__ 46