Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(464)

Side by Side Diff: third_party/protobuf/src/google/protobuf/compiler/command_line_interface.cc

Issue 11012009: Protobuf: Cherry-pick upstream r427. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Protocol Buffers - Google's data interchange format 1 // Protocol Buffers - Google's data interchange format
2 // Copyright 2008 Google Inc. All rights reserved. 2 // Copyright 2008 Google Inc. All rights reserved.
3 // http://code.google.com/p/protobuf/ 3 // http://code.google.com/p/protobuf/
4 // 4 //
5 // Redistribution and use in source and binary forms, with or without 5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are 6 // modification, are permitted provided that the following conditions are
7 // met: 7 // met:
8 // 8 //
9 // * Redistributions of source code must retain the above copyright 9 // * Redistributions of source code must retain the above copyright
10 // notice, this list of conditions and the following disclaimer. 10 // notice, this list of conditions and the following disclaimer.
(...skipping 872 matching lines...) Expand 10 before | Expand all | Expand 10 after
883 // Java's -classpath (and some other languages) delimits path components 883 // Java's -classpath (and some other languages) delimits path components
884 // with colons. Let's accept that syntax too just to make things more 884 // with colons. Let's accept that syntax too just to make things more
885 // intuitive. 885 // intuitive.
886 vector<string> parts; 886 vector<string> parts;
887 SplitStringUsing(value, kPathSeparator, &parts); 887 SplitStringUsing(value, kPathSeparator, &parts);
888 888
889 for (int i = 0; i < parts.size(); i++) { 889 for (int i = 0; i < parts.size(); i++) {
890 string virtual_path; 890 string virtual_path;
891 string disk_path; 891 string disk_path;
892 892
893 int equals_pos = parts[i].find_first_of('='); 893 string::size_type equals_pos = parts[i].find_first_of('=');
894 if (equals_pos == string::npos) { 894 if (equals_pos == string::npos) {
895 virtual_path = ""; 895 virtual_path = "";
896 disk_path = parts[i]; 896 disk_path = parts[i];
897 } else { 897 } else {
898 virtual_path = parts[i].substr(0, equals_pos); 898 virtual_path = parts[i].substr(0, equals_pos);
899 disk_path = parts[i].substr(equals_pos + 1); 899 disk_path = parts[i].substr(equals_pos + 1);
900 } 900 }
901 901
902 if (disk_path.empty()) { 902 if (disk_path.empty()) {
903 cerr << "--proto_path passed empty directory name. (Use \".\" for " 903 cerr << "--proto_path passed empty directory name. (Use \".\" for "
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1348 } 1348 }
1349 1349
1350 // Add this file. 1350 // Add this file.
1351 file->CopyTo(output->Add()); 1351 file->CopyTo(output->Add());
1352 } 1352 }
1353 1353
1354 1354
1355 } // namespace compiler 1355 } // namespace compiler
1356 } // namespace protobuf 1356 } // namespace protobuf
1357 } // namespace google 1357 } // namespace google
OLDNEW
« no previous file with comments | « third_party/protobuf/README.chromium ('k') | third_party/protobuf/src/google/protobuf/descriptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698