OLD | NEW |
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 2338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2349 // defined in multiple parent scopes, we only want to find "Bar.baz" in the | 2349 // defined in multiple parent scopes, we only want to find "Bar.baz" in the |
2350 // innermost one. E.g., the following should produce an error: | 2350 // innermost one. E.g., the following should produce an error: |
2351 // message Bar { message Baz {} } | 2351 // message Bar { message Baz {} } |
2352 // message Foo { | 2352 // message Foo { |
2353 // message Bar { | 2353 // message Bar { |
2354 // } | 2354 // } |
2355 // optional Bar.Baz baz = 1; | 2355 // optional Bar.Baz baz = 1; |
2356 // } | 2356 // } |
2357 // So, we look for just "Foo" first, then look for "Bar.baz" within it if | 2357 // So, we look for just "Foo" first, then look for "Bar.baz" within it if |
2358 // found. | 2358 // found. |
2359 int name_dot_pos = name.find_first_of('.'); | 2359 string::size_type name_dot_pos = name.find_first_of('.'); |
2360 string first_part_of_name; | 2360 string first_part_of_name; |
2361 if (name_dot_pos == string::npos) { | 2361 if (name_dot_pos == string::npos) { |
2362 first_part_of_name = name; | 2362 first_part_of_name = name; |
2363 } else { | 2363 } else { |
2364 first_part_of_name = name.substr(0, name_dot_pos); | 2364 first_part_of_name = name.substr(0, name_dot_pos); |
2365 } | 2365 } |
2366 | 2366 |
2367 string scope_to_try(relative_to); | 2367 string scope_to_try(relative_to); |
2368 | 2368 |
2369 while (true) { | 2369 while (true) { |
(...skipping 2118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4488 break; | 4488 break; |
4489 | 4489 |
4490 default: | 4490 default: |
4491 GOOGLE_LOG(FATAL) << "Invalid wire type for CPPTYPE_UINT64: " << type; | 4491 GOOGLE_LOG(FATAL) << "Invalid wire type for CPPTYPE_UINT64: " << type; |
4492 break; | 4492 break; |
4493 } | 4493 } |
4494 } | 4494 } |
4495 | 4495 |
4496 } // namespace protobuf | 4496 } // namespace protobuf |
4497 } // namespace google | 4497 } // namespace google |
OLD | NEW |