compiler/cpp/src/generate/t_html_generator.cc
/**
 * Generates code for an enumerated type.
 *
 * @param tenum The enumeration
 */
Generates code for an enumerated type.
@param tenum The enumeration
Generates code for an enumerated type . @param tenum The enumeration
void t_html_generator::generate_enum(t_enum* tenum) {
  string name = tenum->get_name();
  f_out_ << "<div class=\"definition\">";
  f_out_ << "<h3 id=\"Enum_" << name << "\">Enumeration: " << name
   << "</h3>" << endl;
  print_doc(tenum);
  vector<t_enum_value*> values = tenum->get_constants();
  vector<t_enum_value*>::iterator val_iter;
  f_out_ << "<br/><table class=\"table-bordered table-striped table-condensed\">" << endl;
  for (val_iter = values.begin(); val_iter != values.end(); ++val_iter) {
    f_out_ << "<tr><td><code>";
    f_out_ << (*val_iter)->get_name();
    f_out_ << "</code></td><td><code>";
    f_out_ << (*val_iter)->get_value();
    f_out_ << "</code></td><td>" << endl;
    print_doc((*val_iter));
    f_out_ << "</td></tr>" << endl;
  }
  f_out_ << "</table></div>" << endl;
}
void t_html_generator :: generate_enum ( t_enum * tenum ) { string name = tenum -> get_name ( ) ; f_out_ << " \" \" " ; f_out_ << " \" " << name << " \" " << name << " " << endl ; print_doc ( tenum ) ; vector < t_enum_value * > values = tenum -> get_constants ( ) ; vector < t_enum_value * > :: iterator val_iter ; f_out_ << " \" \" " << endl ; for ( val_iter = values . begin ( ) ; val_iter != values . end ( ) ; ++ val_iter ) { f_out_ << " " ; f_out_ << ( * val_iter ) -> get_name ( ) ; f_out_ << " " ; f_out_ << ( * val_iter ) -> get_value ( ) ; f_out_ << " " << endl ; print_doc ( ( * val_iter ) ) ; f_out_ << " " << endl ; } f_out_ << " " << endl ; }
Generates code for an enumerated type.
Generates code for an enumerated type .