Ответ 1
import "myproject/base.proto";
Документы: http://developers.google.com/protocol-buffers/docs/proto#other
Я хотел бы включить файл определения протокола в другой файл протокола. Например:
// base.proto:
message P_EndPoint {
required int32 id = 1;
required string host = 2;
required int32 port = 3;
}
Затем в другом файле:
communication.proto:
// somehow include `base.proto'
// ...
message P_CommunicationProtocol {
required CP_MessageType type = 1;
optional int32 id = 2;
optional P_EndPoint identity = 3;
repeated P_EndPoint others = 4;
}
// ...
(Примечание: developers.google.com недоступен в моей локали)
import "myproject/base.proto";
Документы: http://developers.google.com/protocol-buffers/docs/proto#other