about summary refs log tree commit diff stats
path: root/vendor/godobuf/addons/protobuf
ModeNameSize
-rw-r--r--parser.gd85197log stats plain blame
-rw-r--r--plugin.cfg162log stats plain blame
-rw-r--r--protobuf_cmdln.gd2592log stats plain blame
-rw-r--r--protobuf_core.gd21379log stats plain blame
-rw-r--r--protobuf_util.gd1924log stats plain blame
} /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#ifndef PROGRESS_H_A34EF856
#define PROGRESS_H_A34EF856

#include <string>

namespace cadence {
  namespace generator {

    class progress {
      private:
        std::string message;
        int total;
        int cur = 0;
        int lprint = 0;

      public:
        progress(std::string message, int total) : message(message), total(total)
        {
          std::cout << message << "   0%" << std::flush;
        }

        void update(int val)
        {
          if (val <= total)
          {
            cur = val;
          } else {
            cur = total;
          }

          int pp = cur * 100 / total;
          if (pp != lprint)
          {
            lprint = pp;

            std::cout << "\b\b\b\b" << std::right;
            std::cout.width(3);
            std::cout << pp << "%" << std::flush;
          }
        }

        void update()
        {
          update(cur+1);
        }

        ~progress()
        {
          std::cout << "\b\b\b\b100%" << std::endl;
        }
    };

  };
};

#endif /* end of include guard: PROGRESS_H_A34EF856 */