ruby-changes:48140
From: sonots <ko1@a...>
Date: Sat, 21 Oct 2017 19:33:29 +0900 (JST)
Subject: [ruby-changes:48140] sonots:r60254 (trunk): * string.c (deleted_prefix_length, deleted_suffix_length):
sonots 2017-10-21 19:33:25 +0900 (Sat, 21 Oct 2017) New Revision: 60254 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60254 Log: * string.c (deleted_prefix_length, deleted_suffix_length): Add doxygen comment. Modified files: trunk/string.c Index: string.c =================================================================== --- string.c (revision 60253) +++ string.c (revision 60254) @@ -8293,6 +8293,11 @@ chompped_length(VALUE str, VALUE rs) https://github.com/ruby/ruby/blob/trunk/string.c#L8293 return len; } +/*! + * Returns the seperator for arguments of rb_str_chomp. + * + * @return returns rb_ps ($/) as default, the default value of rb_ps ($/) is "\n". + */ static VALUE chomp_rs(int argc, const VALUE *argv) { @@ -9273,6 +9278,15 @@ rb_str_end_with(int argc, VALUE *argv, V https://github.com/ruby/ruby/blob/trunk/string.c#L9278 return Qfalse; } +/*! + * Returns the length of the <i>prefix</i> to be deleted in the given <i>str</i>, + * returning 0 if <i>str</i> does not start with the <i>prefix</i>. + * + * @param str the target + * @param prefix the prefix + * @retval 0 if the given <i>str</i> does not start with the given <i>prefix</i> + * @retval Positive-Integer otherwise + */ static long deleted_prefix_length(VALUE str, VALUE prefix) { @@ -9339,6 +9353,15 @@ rb_str_delete_prefix(VALUE str, VALUE pr https://github.com/ruby/ruby/blob/trunk/string.c#L9353 return rb_str_subseq(str, prefixlen, RSTRING_LEN(str) - prefixlen); } +/*! + * Returns the length of the <i>suffix</i> to be deleted in the given <i>str</i>, + * returning 0 if <i>str</i> does not end with the <i>suffix</i>. + * + * @param str the target + * @param suffix the suffix + * @retval 0 if the given <i>str</i> does not end with the given suffix</i> + * @retval Positive-Integer otherwise + */ static long deleted_suffix_length(VALUE str, VALUE suffix) { -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/