On Sat, Sep 7, 2013 at 9:53 AM,  <[email protected]> wrote:
> Introduce StrIter_Starts_With_UTF8

> Project: http://git-wip-us.apache.org/repos/asf/lucy/repo
> Commit: http://git-wip-us.apache.org/repos/asf/lucy/commit/e1d95d20
> Tree: http://git-wip-us.apache.org/repos/asf/lucy/tree/e1d95d20
> Diff: http://git-wip-us.apache.org/repos/asf/lucy/diff/e1d95d20

> +    /** Test whether the content after the iterator starts with the passed-in
> +     * string.
> +     */
> +    bool
> +    Starts_With_UTF8(StringIterator *self, const char *prefix, size_t size);
> +

There are several C helper methods and functions that accept UTF-8 bytes and a
length instead of a CharBuf or Obj -- e.g. Hash_Fetch_Str.  The naming
convention we've used for them thus far has been to append "_str"/"_Str" to
the name, but now that we have a class named "String", that's unclear.

Using "_UTF8" instead of "_Str", as you've done in this commit, is perfect.
Here's are some others that could stand to use that new naming convention as
well (though not all may survive the current refactoring):

  Str_new_steal_str               Str_new_steal_utf8
  Str_new_steal_from_trusted_str  Str_new_steal_trusted_utf8
  Str_init_steal_trusted_str      Str_init_steal_trusted_utf8
  Str_Mimic_Str                   Str_Mimic_UTF8
  Str_Starts_With_Str             Str_Starts_With_UTF8
  Str_Ends_With_Str               Str_Ends_With_UTF8
  Str_Find_Str                    Str_Find_UTF8
  Str_Equals_Str                  Str_Equals_UTF8
  ...
  Hash_Fetch_Str                  Hash_Fetch_UTF8
  Hash_Store_Str                  Hash_Store_UTF8
  Hash_Delete_Str                 Hash_Delete_UTF8
  ...

(: Perhaps you already planned this. :)

Marvin Humphrey

Reply via email to