aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/third_party.md1
-rw-r--r--objectivec/GPBMessage.h11
-rw-r--r--src/google/protobuf/compiler/mock_code_generator.cc8
3 files changed, 15 insertions, 5 deletions
diff --git a/docs/third_party.md b/docs/third_party.md
index 8ec551db..161bc3ca 100644
--- a/docs/third_party.md
+++ b/docs/third_party.md
@@ -83,6 +83,7 @@ These are projects we know about implementing Protocol Buffers for other program
* Scala: https://github.com/SandroGrzicic/ScalaBuff
* Scala: http://trueaccord.github.io/ScalaPB/
* Swift: https://github.com/alexeyxo/protobuf-swift
+* Swift: https://github.com/apple/swift-protobuf/
* Vala: https://launchpad.net/protobuf-vala
* Visual Basic: http://code.google.com/p/protobuf-net/
diff --git a/objectivec/GPBMessage.h b/objectivec/GPBMessage.h
index 0cb74f9f..c07ec888 100644
--- a/objectivec/GPBMessage.h
+++ b/objectivec/GPBMessage.h
@@ -65,9 +65,18 @@ CF_EXTERN_C_END
/**
* Base class that each generated message subclasses from.
+ *
+ * @note While the class support NSSecureCoding, if the message has any
+ * extensions, they will end up reloaded in @c unknownFields as there is
+ * no way for the @c NSCoding plumbing to pass through a
+ * @c GPBExtensionRegistry. To support extensions, instead of passing the
+ * calls off to the Message, simple store the result of @c data, and then
+ * when loading, fetch the data and use
+ * @c +parseFromData:extensionRegistry:error: to provide an extension
+ * registry.
**/
@interface GPBMessage : NSObject<NSSecureCoding, NSCopying>
-
+
// If you add an instance method/property to this class that may conflict with
// fields declared in protos, you need to update objective_helpers.cc. The main
// cases are methods that take no arguments, or setFoo:/hasFoo: type methods.
diff --git a/src/google/protobuf/compiler/mock_code_generator.cc b/src/google/protobuf/compiler/mock_code_generator.cc
index 82bb3427..1cc932dd 100644
--- a/src/google/protobuf/compiler/mock_code_generator.cc
+++ b/src/google/protobuf/compiler/mock_code_generator.cc
@@ -61,7 +61,7 @@ namespace compiler {
// comma-separated string.
string CommaSeparatedList(const vector<const FileDescriptor*> all_files) {
vector<string> names;
- for (int i = 0; i < all_files.size(); i++) {
+ for (size_t i = 0; i < all_files.size(); i++) {
names.push_back(all_files[i]->name());
}
return Join(names, ",");
@@ -97,7 +97,7 @@ void MockCodeGenerator::ExpectGenerated(
while (!lines.empty() && lines.back().empty()) {
lines.pop_back();
}
- for (int i = 0; i < lines.size(); i++) {
+ for (size_t i = 0; i < lines.size(); i++) {
lines[i] += "\n";
}
@@ -114,7 +114,7 @@ void MockCodeGenerator::ExpectGenerated(
EXPECT_EQ(kFirstInsertionPoint, lines[1 + insertion_list.size()]);
EXPECT_EQ(kSecondInsertionPoint, lines[2 + insertion_list.size() * 2]);
- for (int i = 0; i < insertion_list.size(); i++) {
+ for (size_t i = 0; i < insertion_list.size(); i++) {
EXPECT_EQ(GetOutputFileContent(insertion_list[i], "first_insert",
file, file, first_message_name),
lines[1 + i]);
@@ -170,7 +170,7 @@ bool MockCodeGenerator::Generate(
SplitStringUsing(StripPrefixString(parameter, "insert="),
",", &insert_into);
- for (int i = 0; i < insert_into.size(); i++) {
+ for (size_t i = 0; i < insert_into.size(); i++) {
{
google::protobuf::scoped_ptr<io::ZeroCopyOutputStream> output(context->OpenForInsert(
GetOutputFileName(insert_into[i], file), kFirstInsertionPointName));