[OSM-dev] PBF: add a "package" keyword to the .proto for CPP namespace

Chris Browet cbro at semperpax.com
Tue Nov 16 16:52:10 GMT 2010


Hi,

Would it be possible to add a "package zzz;" to the .proto files, as in
google examples?
In CPP, that will generate a namespace named zzz, which would avoid class
name clashing (mind you, I happen to already have Node, Way and Relation
classes in Merkaartor).

I'm not really sure if there would be much repercussions to this but if I
understand google's doc, "option java_package" would take precedence for
java classes, anyway...

Quoting:

> The .proto file starts with a package declaration, which helps to prevent
> naming conflicts between different projects. In Java, the package name is
> used as the Java package unless you have explicitly specified a
> java_package, as we have here. Even if you do provide a java_package, you
> should still define a normal package as well to avoid name collisions in the
> Protocol Buffers name space as well as in non-Java languages.
>

- Chris -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/dev/attachments/20101116/e3af7416/attachment.html>


More information about the dev mailing list