I am using the protocol buffer text format. I need information about the 
line and column number of a message that was already parsed. For example, I 
have a protocol buffer message definition in the .proto file:
package ExamplePackage;
message ExampleMessage
    required string first = 1;
    required string second = 2;
and a message of type ExampleMessage containing data:
first: "FirstData"
second: "SecondData"
The data is stored in a protocol buffer text format file, so the text 
format parser can get information about the line/column of the data 
("first" -> (line = 1/ column = 1) and "second" -> (line = 2/ column = 1) 
during parsing.
Now I am wondering if I can access the information on line/column after 
parsing. Something like (C++):
ExamplePackage::ExampleMessage MyMessage;
google::protobuf::TextFormat::ParseFromString(fileStream, &MyMessage);
lineOfFirst = MyMessage.first().*getLine*();
lineOfSecond = MyMessage.second().*getLine*();
->lineOfFirst should be 1 now and lineOfSecond should be 2.
As the methods "getLine"/"getColumn" do not exist, I am wondering if there 
any possibility to get line/column after parsing a text format file?

Thanks for your help in advance.


You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To view this discussion on the web visit 
To post to this group, send email to protobuf@googlegroups.com.
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to