Bugfixes and missing functionality.

STUVL::getLength, STUTL::getLength, list->vector, getTaggedListLength
This commit is contained in:
JoelKatz
2012-03-15 11:46:43 -07:00
parent 47e1f5a1d4
commit 672b976eb6
5 changed files with 74 additions and 18 deletions

View File

@@ -83,10 +83,15 @@ STUVariableLength* STUVariableLength::construct(SerializerIterator& u)
return new STUVariableLength(u.getVL());
}
int STUVariableLength::getLength() const
{
return Serializer::encodeLengthLength(value.size()) + value.size();
}
std::string STUTaggedList::getText() const
{
std::string ret;
for(std::list<TaggedListItem>::const_iterator it=value.begin(); it!=value.end(); ++it)
for(std::vector<TaggedListItem>::const_iterator it=value.begin(); it!=value.end(); ++it)
{
ret+=boost::lexical_cast<std::string>(it->first);
ret+=",";
@@ -99,3 +104,10 @@ STUTaggedList* STUTaggedList::construct(SerializerIterator& u)
{
return new STUTaggedList(u.getTaggedList());
}
int STUTaggedList::getLength() const
{
int ret=Serializer::getTaggedListLength(value);
if(ret<0) throw(0);
return ret;
}