| Index: third_party/protobuf/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs
|
| diff --git a/third_party/protobuf/python/google/protobuf/pyext/python_protobuf.cc b/third_party/protobuf/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs
|
| similarity index 60%
|
| copy from third_party/protobuf/python/google/protobuf/pyext/python_protobuf.cc
|
| copy to third_party/protobuf/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs
|
| index 1b1ab5d1dc7f4bf986884718c67d69a460232ada..e547d834986de8d80703504469e9c39b3d8ae93d 100644
|
| --- a/third_party/protobuf/python/google/protobuf/pyext/python_protobuf.cc
|
| +++ b/third_party/protobuf/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs
|
| @@ -1,6 +1,7 @@
|
| +#region Copyright notice and license
|
| // Protocol Buffers - Google's data interchange format
|
| // Copyright 2008 Google Inc. All rights reserved.
|
| -// http://code.google.com/p/protobuf/
|
| +// https://developers.google.com/protocol-buffers/
|
| //
|
| // Redistribution and use in source and binary forms, with or without
|
| // modification, are permitted provided that the following conditions are
|
| @@ -27,37 +28,41 @@
|
| // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
| // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
| // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
| +#endregion
|
|
|
| -// Author: qrczak@google.com (Marcin Kowalczyk)
|
| +namespace Google.Protobuf.Reflection
|
| +{
|
| + /// <summary>
|
| + /// Represents a package in the symbol table. We use PackageDescriptors
|
| + /// just as placeholders so that someone cannot define, say, a message type
|
| + /// that has the same name as an existing package.
|
| + /// </summary>
|
| + internal sealed class PackageDescriptor : IDescriptor
|
| + {
|
| + private readonly string name;
|
| + private readonly string fullName;
|
| + private readonly FileDescriptor file;
|
|
|
| -#include <google/protobuf/pyext/python_protobuf.h>
|
| + internal PackageDescriptor(string name, string fullName, FileDescriptor file)
|
| + {
|
| + this.file = file;
|
| + this.fullName = fullName;
|
| + this.name = name;
|
| + }
|
|
|
| -namespace google {
|
| -namespace protobuf {
|
| -namespace python {
|
| + public string Name
|
| + {
|
| + get { return name; }
|
| + }
|
|
|
| -static const Message* GetCProtoInsidePyProtoStub(PyObject* msg) {
|
| - return NULL;
|
| -}
|
| -static Message* MutableCProtoInsidePyProtoStub(PyObject* msg) {
|
| - return NULL;
|
| -}
|
| + public string FullName
|
| + {
|
| + get { return fullName; }
|
| + }
|
|
|
| -// This is initialized with a default, stub implementation.
|
| -// If python-google.protobuf.cc is loaded, the function pointer is overridden
|
| -// with a full implementation.
|
| -const Message* (*GetCProtoInsidePyProtoPtr)(PyObject* msg) =
|
| - GetCProtoInsidePyProtoStub;
|
| -Message* (*MutableCProtoInsidePyProtoPtr)(PyObject* msg) =
|
| - MutableCProtoInsidePyProtoStub;
|
| -
|
| -const Message* GetCProtoInsidePyProto(PyObject* msg) {
|
| - return GetCProtoInsidePyProtoPtr(msg);
|
| -}
|
| -Message* MutableCProtoInsidePyProto(PyObject* msg) {
|
| - return MutableCProtoInsidePyProtoPtr(msg);
|
| -}
|
| -
|
| -} // namespace python
|
| -} // namespace protobuf
|
| -} // namespace google
|
| + public FileDescriptor File
|
| + {
|
| + get { return file; }
|
| + }
|
| + }
|
| +}
|
|
|