Creation + Parsing error for repeated primitive types
GoogleCodeExporter opened this issue · 1 comments
GoogleCodeExporter commented
Hi,
The generatation of classes does not work if primitive type is repeated
instead of a message type.
message AddressBook {
repeated string person = 1;
}
Code generated:
<?php
class AddressBook extends PBMessage
{
var $wired_type = PBMessage::WIRED_STRING;
public function __construct($reader=null)
{
parent::__construct($reader);
$this->fields["1"] = "PBString";
$this->values["1"] = array();
}
function person($offset)
{
return $this->_get_arr_value("1", $offset);
}
function add_person()
{
return $this->_add_arr_value("1");
}
function person_size()
{
return $this->_get_arr_size("1");
}
}
?>
I can generate a person, but there is no way for me to set any data in it,
as no message object is returned.
Serializing that object will then fail.
I also suspect the same problem when parsing a file having the same kind of
definitions.
Original issue reported on code.google.com by adsen...@blue.lu
on 20 Jan 2009 at 5:38
GoogleCodeExporter commented
Fixed it with the revision 15 - r15 - look at the folder primitive_rep in the
example
folder.
Original comment by kordu...@googlemail.com
on 20 Jan 2009 at 7:22
- Changed state: Fixed