Permalink
Browse files

distinguish binary from string in cl generator

  • Loading branch information...
lisp committed Jul 27, 2010
1 parent fc5c131 commit 69e1ab848287c19efcdddfca9c4d4de6c34209f4
Showing with 7 additions and 1 deletion.
  1. +7 −1 compiler/cpp/src/generate/t_cl_generator.cc
@@ -322,8 +322,14 @@ void t_cl_generator::generate_cl_struct_internal(std::ofstream& out, t_struct* t
}
out << "(" << prefix((*m_iter)->get_name()) << " " <<
( (NULL != value) ? render_const_value(type, value) : "nil" ) <<
- " :type " << typespec((*m_iter)->get_type()) <<
" :id " << (*m_iter)->get_key();
+ if ( type->is_base_type() && "string" == typespec(type) )
+ if ( ((t_base_type*)type)->is_binary() )
+ out << " :type binary";
+ else
+ out << " :type string";
+ else
+ out << " :type " << typespec(type);
if ( (*m_iter)->get_req() == t_field::T_OPTIONAL ) {
out << " :optional t";
}

0 comments on commit 69e1ab8

Please sign in to comment.