10 using google::protobuf::FileDescriptorProto;
24 if (filename.substr(filename.size() - 11) ==
".protodevel") {
26 return filename.substr(0, filename.size() - 11);
29 return filename.substr(0, filename.size() - 6);
39 virtual bool GenerateAll(
const std::vector<const FileDescriptor*>& files,
40 const string& parameter,
42 string*
error)
const {
43 for (
int i = 0;
i < files.size();
i++) {
44 for (
auto file : files) {
46 (new_pool_.FindFileByName(file->name()) ==
nullptr);
47 for (
int j = 0; j < file->dependency_count(); j++) {
48 can_generate &= (new_pool_.FindFileByName(
49 file->dependency(j)->name()) !=
nullptr);
51 for (
int j = 0; j < file->public_dependency_count(); j++) {
52 can_generate &= (new_pool_.FindFileByName(
53 file->public_dependency(j)->name()) !=
nullptr);
55 for (
int j = 0; j < file->weak_dependency_count(); j++) {
56 can_generate &= (new_pool_.FindFileByName(
57 file->weak_dependency(j)->name()) !=
nullptr);
70 const string& parameter,
72 string*
error)
const {
75 SchemaGroupStripper::StripFile(file, &new_file);
80 string filename = file->
name();
83 std::vector<std::pair<string,string>> option_pairs;
86 std::unique_ptr<google::protobuf::io::ZeroCopyOutputStream>
output(
87 context->
Open(basename +
".proto"));
88 string content = new_pool_.BuildFile(new_file)->DebugString();
90 printer.
WriteRaw(content.c_str(), content.size());
100 int main(
int argc,
char* argv[]) {