Go to the documentation of this file.
49 namespace annotation_test_util {
82 DescriptorCapturingGenerator capturing_generator(file);
88 const char* argv[] = {
"protoc", proto_path.c_str(),
89 plugin_specific_args.c_str(), capture_out.c_str(),
92 return cli->
Run(5, argv) == 0;
99 return info->ParseFromZeroCopyStream(&
input);
104 const std::vector<int>&
path,
105 std::vector<const GeneratedCodeInfo::Annotation*>* annotations) {
113 for (; node <
path.size(); ++node) {
114 if (annotation->
path(node) !=
path[node]) {
118 if (node ==
path.size()) {
119 annotations->push_back(annotation);
126 const std::vector<int>&
path) {
127 std::vector<const GeneratedCodeInfo::Annotation*> annotations;
129 if (annotations.empty()) {
132 return annotations[0];
137 const std::vector<const GeneratedCodeInfo::Annotation*>& annotations,
139 for (std::vector<const GeneratedCodeInfo::Annotation*>::const_iterator
140 i = annotations.begin(),
141 e = annotations.end();
149 if (file_content.substr(
begin,
end -
begin) == expected_text) {
159 std::vector<const GeneratedCodeInfo::Annotation*> annotations;
160 annotations.push_back(annotation);
static bool SetContents(const string &name, const string &contents, bool)
void RegisterGenerator(const std::string &flag_name, CodeGenerator *generator, const std::string &help_text)
::PROTOBUF_NAMESPACE_ID::int32 begin() const
void AddFile(const std::string &filename, const std::string &data)
GLsizei const GLchar *const * string
const std::string & source_file() const
void FindAnnotationsOnPath(const GeneratedCodeInfo &info, const std::string &source_file, const std::vector< int > &path, std::vector< const GeneratedCodeInfo::Annotation * > *annotations)
void SetInputsAreProtoPathRelative(bool)
int Run(int argc, const char *const argv[])
int annotation_size() const
static size_t begin(const upb_table *t)
const PROTOBUF_NAMESPACE_ID::GeneratedCodeInfo_Annotation & annotation(int index) const
bool AtLeastOneAnnotationMatchesSubstring(const std::string &file_content, const std::vector< const GeneratedCodeInfo::Annotation * > &annotations, const std::string &expected_text)
static bool GetContents(const string &name, string *output, bool)
GLsizei const GLchar ** path
::PROTOBUF_NAMESPACE_ID::int32 path(int index) const
bool RunProtoCompiler(const std::string &filename, const std::string &plugin_specific_args, CommandLineInterface *cli, FileDescriptorProto *file)
void CopyTo(FileDescriptorProto *proto) const
const GeneratedCodeInfo::Annotation * FindAnnotationOnPath(const GeneratedCodeInfo &info, const std::string &source_file, const std::vector< int > &path)
#define GOOGLE_CHECK_OK(A)
bool DecodeMetadata(const std::string &path, GeneratedCodeInfo *info)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
::PROTOBUF_NAMESPACE_ID::int32 end() const
FileDescriptorProto * file_
bool AnnotationMatchesSubstring(const std::string &file_content, const GeneratedCodeInfo::Annotation *annotation, const std::string &expected_text)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:47