| @@ -6681,7 +6681,7 @@ const char * Chuck_Type::c_name() · 6680 unmodified lines |
| 6681 | 6681 | |
| 6682 | 6682 | //----------------------------------------------------------------------------- |
| 6683 | 6683 | // name: apropos() |
| 6684 | | −// desc: dump info to string; added 1.4.1.0 (ge) |
| 6684 | +// desc: generate info; output to console | added 1.4.1.0 (ge) |
| 6685 | 6685 | // portions of this adapted from ckdoc -- thanks be to Spencer Salazar |
| 6686 | 6686 | //----------------------------------------------------------------------------- |
| 6687 | 6687 | void Chuck_Type::apropos( std::string & output ) |
| @@ -6754,7 +6754,7 @@ void Chuck_Type::apropos( std::string & output ) · 66 unmodified lines |
| 6754 | 6754 | |
| 6755 | 6755 | //----------------------------------------------------------------------------- |
| 6756 | 6756 | // name: apropos() |
| 6757 | | −// desc: dump info to console |
| 6757 | +// desc: generate info; output to console | added 1.4.1.0 (ge) |
| 6758 | 6758 | //----------------------------------------------------------------------------- |
| 6759 | 6759 | void Chuck_Type::apropos() |
| 6760 | 6760 | { |
| @@ -6769,11 +6769,15 @@ void Chuck_Type::apropos() · 8 unmodified lines |
| 6769 | 6769 | |
| 6770 | 6770 | |
| 6771 | 6771 | |
| 6772 | +//----------------------------------------------------------------------------- |
| 6772 | 6773 | // comparer |
| 6774 | +//----------------------------------------------------------------------------- |
| 6773 | 6775 | static bool comp_func( Chuck_Func * a, Chuck_Func * b ) |
| 6774 | 6776 | { return a->name < b->name; } |
| 6775 | 6777 | |
| 6778 | +//----------------------------------------------------------------------------- |
| 6776 | 6779 | // comparer |
| 6780 | +//----------------------------------------------------------------------------- |
| 6777 | 6781 | static bool comp_value( Chuck_Value * a, Chuck_Value * b ) |
| 6778 | 6782 | { |
| 6779 | 6783 | string lowerA = a->name;; |
| @@ -6788,7 +6792,9 @@ static bool comp_value( Chuck_Value * a, Chuck_Value * b ) · 8 unmodified lines |
| 6788 | 6792 | else return a->name > b->name; |
| 6789 | 6793 | } |
| 6790 | 6794 | |
| 6795 | +//----------------------------------------------------------------------------- |
| 6791 | 6796 | // capitalize first character |
| 6797 | +//----------------------------------------------------------------------------- |
| 6792 | 6798 | static string capitalize( const string & s ) |
| 6793 | 6799 | { |
| 6794 | 6800 | // copy |
| @@ -6805,7 +6811,7 @@ static string capitalize( const string & s ) · 10 unmodified lines |
| 6805 | 6811 | |
| 6806 | 6812 | //----------------------------------------------------------------------------- |
| 6807 | 6813 | // name: apropos_top() |
| 6808 | | −// desc: dump top level info; added 1.4.1.0 (ge) |
| 6814 | +// desc: output top level info; added 1.4.1.0 (ge) |
| 6809 | 6815 | //----------------------------------------------------------------------------- |
| 6810 | 6816 | void Chuck_Type::apropos_top( std::string & output, const std::string & PREFIX ) |
| 6811 | 6817 | { |
| @@ -6899,7 +6905,8 @@ void apropos_func_arg( std::ostringstream & sout, a_Arg_List arg ) · 87 unmodified lines |
| 6899 | 6905 | // name: apropos_func() |
| 6900 | 6906 | // desc: helper function for outputing function |
| 6901 | 6907 | //----------------------------------------------------------------------------- |
| 6902 | | −void apropos_func( std::ostringstream & sout, Chuck_Func * func, const std::string & PREFIX ) |
| 6908 | +void apropos_func( std::ostringstream & sout, Chuck_Func * func, |
| 6909 | + const std::string & PREFIX ) |
| 6903 | 6910 | { |
| 6904 | 6911 | // print line prefix, if any |
| 6905 | 6912 | sout << PREFIX; |
| @@ -6940,9 +6947,10 @@ void apropos_func( std::ostringstream & sout, Chuck_Func * func, const std::stri · 34 unmodified lines |
| 6940 | 6947 | |
| 6941 | 6948 | //----------------------------------------------------------------------------- |
| 6942 | 6949 | // name: apropos_funcs() |
| 6943 | | −// desc: dump info about funcs; added 1.4.1.0 (ge) |
| 6950 | +// desc: output info about funcs; added 1.4.1.0 (ge) |
| 6944 | 6951 | //----------------------------------------------------------------------------- |
| 6945 | | −void Chuck_Type::apropos_funcs( std::string & output, const std::string & PREFIX, t_CKBOOL inherited ) |
| 6952 | +void Chuck_Type::apropos_funcs( std::string & output, |
| 6953 | + const std::string & PREFIX, t_CKBOOL inherited ) |
| 6946 | 6954 | { |
| 6947 | 6955 | // make a string output stream |
| 6948 | 6956 | ostringstream sout; |
| @@ -7047,7 +7055,8 @@ void Chuck_Type::apropos_funcs( std::string & output, const std::string & PREFIX · 98 unmodified lines |
| 7047 | 7055 | // name: apropos_var() |
| 7048 | 7056 | // desc: helper function for outputing variable |
| 7049 | 7057 | //----------------------------------------------------------------------------- |
| 7050 | | −void apropos_var( std::ostringstream & sout, Chuck_Value * var, const std::string & PREFIX ) |
| 7058 | +void apropos_var( std::ostringstream & sout, Chuck_Value * var, |
| 7059 | + const std::string & PREFIX ) |
| 7051 | 7060 | { |
| 7052 | 7061 | // print line prefix, if any |
| 7053 | 7062 | sout << PREFIX; |
| @@ -7072,9 +7081,10 @@ void apropos_var( std::ostringstream & sout, Chuck_Value * var, const std::strin · 18 unmodified lines |
| 7072 | 7081 | |
| 7073 | 7082 | //----------------------------------------------------------------------------- |
| 7074 | 7083 | // name: apropos_vars() |
| 7075 | | −// desc: dump info about vars; added 1.4.1.0 (ge) |
| 7084 | +// desc: output info about vars; added 1.4.1.0 (ge) |
| 7076 | 7085 | //----------------------------------------------------------------------------- |
| 7077 | | −void Chuck_Type::apropos_vars( std::string & output, const std::string & PREFIX, t_CKBOOL inherited ) |
| 7086 | +void Chuck_Type::apropos_vars( std::string & output, const std::string & PREFIX, |
| 7087 | + t_CKBOOL inherited ) |
| 7078 | 7088 | { |
| 7079 | 7089 | // make a string output stream |
| 7080 | 7090 | ostringstream sout; |
| @@ -7166,3 +7176,31 @@ void Chuck_Type::apropos_vars( std::string & output, const std::string & PREFIX, · 85 unmodified lines |
| 7166 | 7176 | // output to string |
| 7167 | 7177 | output = sout.str(); |
| 7168 | 7178 | } |
| 7179 | + |
| 7180 | + |
| 7181 | + |
| 7182 | + |
| 7183 | +//----------------------------------------------------------------------------- |
| 7184 | +// name: dump() |
| 7185 | +// desc: generate object state; output to console | 1.4.1.1 (ge) |
| 7186 | +//----------------------------------------------------------------------------- |
| 7187 | +void Chuck_Type::dump( Chuck_Object * obj ) |
| 7188 | +{ |
| 7189 | + // the info |
| 7190 | + string output; |
| 7191 | + // get it |
| 7192 | + this->dump( obj, output ); |
| 7193 | + // print it |
| 7194 | + CK_STDCERR << output << CK_STDENDL; |
| 7195 | +} |
| 7196 | + |
| 7197 | + |
| 7198 | + |
| 7199 | + |
| 7200 | +//----------------------------------------------------------------------------- |
| 7201 | +// name: dump() |
| 7202 | +// desc: generate object state; output to string | 1.4.1.1 (ge) |
| 7203 | +//----------------------------------------------------------------------------- |
| 7204 | +void Chuck_Type::dump( Chuck_Object * obj, std::string & output ) |
| 7205 | +{ |
| 7206 | +} |