Пример #1
0
        public override void write(CCodeWriter writer)
        {
            if (name != null)
            {
                writer.write_string("typedef ");
            }
            writer.write_string("enum ");
            writer.write_begin_block();
            bool first = true;

            foreach (CCodeEnumValue value in values)
            {
                if (!first)
                {
                    writer.write_string(",");
                    writer.write_newline();
                }
                writer.write_indent();
                value.write(writer);
                first = false;
            }
            if (!first)
            {
                writer.write_newline();
            }
            writer.write_end_block();
            if (name != null)
            {
                writer.write_string(" ");
                writer.write_string(name);
            }
            if (modifiers.HasFlag(CCodeModifiers.DEPRECATED))
            {
                writer.write_string(" G_GNUC_DEPRECATED");
            }
            writer.write_string(";");
            writer.write_newline();
        }