package ccnop const headerFileTpl = `// Code generated by protoc-gen-validate // source: {{ .InputPath }} // DO NOT EDIT!!! #pragma once #include #include "validate/validate.h" #include "{{ output .File ".h" }}" {{ range .Package.ProtoName.Split }} namespace {{ . }} { {{- end }} using std::string; {{ range .AllMessages }} extern inline bool Validate(__attribute__((unused)) const {{ class . }}& m, __attribute__((unused)) pgv::ValidationMsg* err) { return true; } {{ end }} {{ range .Package.ProtoName.Split -}} } // namespace {{ end }} #define X_{{ .Package.ProtoName.ScreamingSnakeCase }}_{{ .File.InputPath.BaseName | screaming_snake_case }}(X) \ {{ range .AllMessages -}} {{- if not (ignored .) -}} X({{class . }}) \ {{ end -}} {{ end }} ` const moduleFileTpl = `// Code generated by protoc-gen-validate // source: {{ .InputPath }} // DO NOT EDIT!!! #include "{{ output .File ".validate.h" }}" namespace pgv { namespace validate { using std::string; {{ range .AllMessages }} {{- if not (ignored .) -}} {{- if not (disabled .) -}} pgv::Validator<{{ class . }}> {{ staticVarName . }}(static_cast({{ package .}}::Validate)); {{- end -}} {{ end }} {{ end }} } // namespace validate } // namespace pgv `