localshred/protobuf — pull request #56 by localshred (2013-01-28 18:53:18+00:00)
Title: Underscore and references

Hi guys,

I may very well be doing something wrong here so forgive the lack of nomenclature and possible obvious errors. I'm looking at someone else's .proto that has a number of message definitions inside a 'parent' message definition, and one of the childen is referencing the other. The message 'name' contains an underscore and the reference also has the underscore.

When using rprotoc, the output defines a class with the underscore, but the reference has the underscore replaced.

Here is the example I've created:
```

message CMsgClientConnectionStats {
message Stats_UDP {
}

message Stats_VConn {
optional uint32 connections_udp = 1;
optional uint32 connections_tcp = 2;
optional .CMsgClientConnectionStats.Stats_UDP stats_udp = 3;
}

optional .CMsgClientConnectionStats.Stats_VConn stats_vconn = 2;
}

```

Here is the output, note the class reference, not declaration.
```
##
# This file is auto-generated. DO NOT EDIT!
#
require 'protobuf/message'

##
# Message Classes
#
class CMsgClientConnectionStats < ::Protobuf::Message
class Stats_UDP < ::Protobuf::Message; end
class Stats_VConn < ::Protobuf::Message; end
end

##
# Message Fields
#
class CMsgClientConnectionStats
class Stats_UDP
end

class Stats_VConn
optional ::Protobuf::Field::Uint32Field, :connections_udp, 1
optional ::Protobuf::Field::Uint32Field, :connections_tcp, 2
optional ::CMsgClientConnectionStats::StatsUDP, :stats_udp, 3
end

optional ::CMsgClientConnectionStats::StatsVConn, :stats_vconn, 2
end

```

```
~/Projects/protobuf % rprotoc --version
libprotoc 2.4.1
```