lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [11/24] Rename CharBuf to String (cnick Str)
Date Sun, 01 Sep 2013 20:16:59 GMT
http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Highlight/Highlighter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Highlight/Highlighter.c b/core/Lucy/Highlight/Highlighter.c
index db26eab..69229e7 100644
--- a/core/Lucy/Highlight/Highlighter.c
+++ b/core/Lucy/Highlight/Highlighter.c
@@ -33,18 +33,18 @@ const uint32_t ELLIPSIS_CODE_POINT = 0x2026;
  * increment the refcount of the supplied encode_buf and call encode_entities.
  * Either way, the caller takes responsibility for one refcount.
  *
- * The point of this routine is to minimize CharBuf object creation when
+ * The point of this routine is to minimize String object creation when
  * possible.
  */
-static CharBuf*
-S_do_encode(Highlighter *self, CharBuf *text, CharBuf **encode_buf);
+static String*
+S_do_encode(Highlighter *self, String *text, String **encode_buf);
 
 // Place HTML entity encoded version of [text] into [encoded].
-static CharBuf*
-S_encode_entities(CharBuf *text, CharBuf *encoded);
+static String*
+S_encode_entities(String *text, String *encoded);
 
 Highlighter*
-Highlighter_new(Searcher *searcher, Obj *query, const CharBuf *field,
+Highlighter_new(Searcher *searcher, Obj *query, const String *field,
                 uint32_t excerpt_length) {
     Highlighter *self = (Highlighter*)VTable_Make_Obj(HIGHLIGHTER);
     return Highlighter_init(self, searcher, query, field, excerpt_length);
@@ -52,16 +52,16 @@ Highlighter_new(Searcher *searcher, Obj *query, const CharBuf *field,
 
 Highlighter*
 Highlighter_init(Highlighter *self, Searcher *searcher, Obj *query,
-                 const CharBuf *field, uint32_t excerpt_length) {
+                 const String *field, uint32_t excerpt_length) {
     HighlighterIVARS *const ivars = Highlighter_IVARS(self);
     ivars->query          = Searcher_Glean_Query(searcher, query);
     ivars->searcher       = (Searcher*)INCREF(searcher);
-    ivars->field          = CB_Clone(field);
+    ivars->field          = Str_Clone(field);
     ivars->excerpt_length = excerpt_length;
     ivars->slop           = excerpt_length / 3;
     ivars->window_width   = excerpt_length + (ivars->slop * 2);
-    ivars->pre_tag        = CB_new_from_trusted_utf8("<strong>", 8);
-    ivars->post_tag       = CB_new_from_trusted_utf8("</strong>", 9);
+    ivars->pre_tag        = Str_new_from_trusted_utf8("<strong>", 8);
+    ivars->post_tag       = Str_new_from_trusted_utf8("</strong>", 9);
     if (Query_Is_A(ivars->query, COMPILER)) {
         ivars->compiler = (Compiler*)INCREF(ivars->query);
     }
@@ -85,44 +85,44 @@ Highlighter_Destroy_IMP(Highlighter *self) {
     SUPER_DESTROY(self, HIGHLIGHTER);
 }
 
-CharBuf*
-Highlighter_Highlight_IMP(Highlighter *self, const CharBuf *text) {
+String*
+Highlighter_Highlight_IMP(Highlighter *self, const String *text) {
     HighlighterIVARS *const ivars = Highlighter_IVARS(self);
-    size_t size = CB_Get_Size(text)
-                  + CB_Get_Size(ivars->pre_tag)
-                  + CB_Get_Size(ivars->post_tag);
-    CharBuf *retval = CB_new(size);
-    CB_Cat(retval, ivars->pre_tag);
-    CB_Cat(retval, text);
-    CB_Cat(retval, ivars->post_tag);
+    size_t size = Str_Get_Size(text)
+                  + Str_Get_Size(ivars->pre_tag)
+                  + Str_Get_Size(ivars->post_tag);
+    String *retval = Str_new(size);
+    Str_Cat(retval, ivars->pre_tag);
+    Str_Cat(retval, text);
+    Str_Cat(retval, ivars->post_tag);
     return retval;
 }
 
 void
-Highlighter_Set_Pre_Tag_IMP(Highlighter *self, const CharBuf *pre_tag) {
+Highlighter_Set_Pre_Tag_IMP(Highlighter *self, const String *pre_tag) {
     HighlighterIVARS *const ivars = Highlighter_IVARS(self);
     DECREF(ivars->pre_tag);
-    ivars->pre_tag = CB_Clone(pre_tag);
+    ivars->pre_tag = Str_Clone(pre_tag);
 }
 
 void
-Highlighter_Set_Post_Tag_IMP(Highlighter *self, const CharBuf *post_tag) {
+Highlighter_Set_Post_Tag_IMP(Highlighter *self, const String *post_tag) {
     HighlighterIVARS *const ivars = Highlighter_IVARS(self);
     DECREF(ivars->post_tag);
-    ivars->post_tag = CB_Clone(post_tag);
+    ivars->post_tag = Str_Clone(post_tag);
 }
 
-CharBuf*
+String*
 Highlighter_Get_Pre_Tag_IMP(Highlighter *self) {
     return Highlighter_IVARS(self)->pre_tag;
 }
 
-CharBuf*
+String*
 Highlighter_Get_Post_Tag_IMP(Highlighter *self) {
     return Highlighter_IVARS(self)->post_tag;
 }
 
-CharBuf*
+String*
 Highlighter_Get_Field_IMP(Highlighter *self) {
     return Highlighter_IVARS(self)->field;
 }
@@ -147,24 +147,24 @@ Highlighter_Get_Excerpt_Length_IMP(Highlighter *self) {
     return Highlighter_IVARS(self)->excerpt_length;
 }
 
-CharBuf*
+String*
 Highlighter_Create_Excerpt_IMP(Highlighter *self, HitDoc *hit_doc) {
     HighlighterIVARS *const ivars = Highlighter_IVARS(self);
     StackString *field_val
         = (StackString*)HitDoc_Extract(hit_doc, ivars->field,
                                          (ViewCharBuf*)SStr_BLANK());
 
-    if (!field_val || !Obj_Is_A((Obj*)field_val, CHARBUF)) {
+    if (!field_val || !Obj_Is_A((Obj*)field_val, STRING)) {
         return NULL;
     }
     else if (!SStr_Get_Size(field_val)) {
         // Empty string yields empty string.
-        return CB_new(0);
+        return Str_new(0);
     }
     else {
-        StackString *fragment = SSTR_WRAP((CharBuf*)field_val);
-        CharBuf *raw_excerpt = CB_new(ivars->excerpt_length + 10);
-        CharBuf *highlighted = CB_new((ivars->excerpt_length * 3) / 2);
+        StackString *fragment = SSTR_WRAP((String*)field_val);
+        String *raw_excerpt = Str_new(ivars->excerpt_length + 10);
+        String *highlighted = Str_new((ivars->excerpt_length * 3) / 2);
         DocVector *doc_vec
             = Searcher_Fetch_Doc_Vec(ivars->searcher,
                                      HitDoc_Get_Doc_ID(hit_doc));
@@ -176,14 +176,14 @@ Highlighter_Create_Excerpt_IMP(Highlighter *self, HitDoc *hit_doc) {
         HeatMap *heat_map
             = HeatMap_new(score_spans, (ivars->excerpt_length * 2) / 3);
         int32_t top
-            = Highlighter_Find_Best_Fragment(self, (CharBuf*)field_val,
+            = Highlighter_Find_Best_Fragment(self, (String*)field_val,
                                              (ViewCharBuf*)fragment, heat_map);
         VArray *sentences
-            = Highlighter_Find_Sentences(self, (CharBuf*)field_val, 0,
+            = Highlighter_Find_Sentences(self, (String*)field_val, 0,
                                          top + ivars->window_width);
 
-        top = Highlighter_Raw_Excerpt(self, (CharBuf*)field_val,
-                                      (CharBuf*)fragment, raw_excerpt, top,
+        top = Highlighter_Raw_Excerpt(self, (String*)field_val,
+                                      (String*)fragment, raw_excerpt, top,
                                       heat_map, sentences);
         Highlighter_Highlight_Excerpt(self, score_spans, raw_excerpt,
                                       highlighted, top);
@@ -215,7 +215,7 @@ S_hottest(HeatMap *heat_map) {
 
 int32_t
 Highlighter_Find_Best_Fragment_IMP(Highlighter *self,
-                                   const CharBuf *field_val,
+                                   const String *field_val,
                                    ViewCharBuf *fragment, HeatMap *heat_map) {
     HighlighterIVARS *const ivars = Highlighter_IVARS(self);
 
@@ -226,14 +226,14 @@ Highlighter_Find_Best_Fragment_IMP(Highlighter *self,
         // If the beginning of the string falls within the window centered
         // around the hottest point in the field, start the fragment at the
         // beginning.
-        ViewCB_Assign(fragment, (CharBuf*)field_val);
+        ViewCB_Assign(fragment, (String*)field_val);
         int32_t top = ViewCB_Trim_Top(fragment);
         ViewCB_Truncate(fragment, ivars->window_width);
         return top;
     }
     else {
         int32_t top = best_location - ivars->slop;
-        ViewCB_Assign(fragment, (CharBuf*)field_val);
+        ViewCB_Assign(fragment, (String*)field_val);
         ViewCB_Nip(fragment, top);
         top += ViewCB_Trim_Top(fragment);
         int32_t chars_left = ViewCB_Truncate(fragment, ivars->excerpt_length);
@@ -241,7 +241,7 @@ Highlighter_Find_Best_Fragment_IMP(Highlighter *self,
 
         if (!overrun) {
             // We've found an acceptable window.
-            ViewCB_Assign(fragment, (CharBuf*)field_val);
+            ViewCB_Assign(fragment, (String*)field_val);
             ViewCB_Nip(fragment, top);
             top += ViewCB_Trim_Top(fragment);
             ViewCB_Truncate(fragment, ivars->window_width);
@@ -250,13 +250,13 @@ Highlighter_Find_Best_Fragment_IMP(Highlighter *self,
         else if (overrun > top) {
             // The field is very short, so make the whole field the
             // "fragment".
-            ViewCB_Assign(fragment, (CharBuf*)field_val);
+            ViewCB_Assign(fragment, (String*)field_val);
             return ViewCB_Trim_Top(fragment);
         }
         else {
             // The fragment is too close to the end, so slide it back.
             top -= overrun;
-            ViewCB_Assign(fragment, (CharBuf*)field_val);
+            ViewCB_Assign(fragment, (String*)field_val);
             ViewCB_Nip(fragment, top);
             top += ViewCB_Trim_Top(fragment);
             ViewCB_Truncate(fragment, ivars->excerpt_length);
@@ -291,8 +291,8 @@ S_has_heat(HeatMap *heat_map, int32_t offset, int32_t length) {
 }
 
 int32_t
-Highlighter_Raw_Excerpt_IMP(Highlighter *self, const CharBuf *field_val,
-                            const CharBuf *fragment, CharBuf *raw_excerpt,
+Highlighter_Raw_Excerpt_IMP(Highlighter *self, const String *field_val,
+                            const String *fragment, String *raw_excerpt,
                             int32_t top, HeatMap *heat_map,
                             VArray *sentences) {
     HighlighterIVARS *const ivars = Highlighter_IVARS(self);
@@ -300,7 +300,7 @@ Highlighter_Raw_Excerpt_IMP(Highlighter *self, const CharBuf *field_val,
     bool     found_ending_edge   = false;
     int32_t  start = top;
     int32_t  end   = 0;
-    double   field_len = CB_Length(field_val);
+    double   field_len = Str_Length(field_val);
     uint32_t min_len = field_len < ivars->excerpt_length * 0.6666
                        ? (uint32_t)field_len
                        : (uint32_t)(ivars->excerpt_length * 0.6666);
@@ -359,7 +359,7 @@ Highlighter_Raw_Excerpt_IMP(Highlighter *self, const CharBuf *field_val,
                     break;
                 }
                 else {
-                    StackString *temp = SSTR_WRAP((CharBuf*)start_trimmed);
+                    StackString *temp = SSTR_WRAP((String*)start_trimmed);
                     SStr_Nip(temp, chars_left);
                     SStr_Trim_Tail(temp);
                     if (SStr_Get_Size(temp) == 0) {
@@ -377,7 +377,7 @@ Highlighter_Raw_Excerpt_IMP(Highlighter *self, const CharBuf *field_val,
                                : (int32_t)ivars->excerpt_length;
     if (!this_excerpt_len) { return start; }
 
-    StackString *substring = SSTR_WRAP((CharBuf*)field_val);
+    StackString *substring = SSTR_WRAP((String*)field_val);
 
     if (found_starting_edge) {
         SStr_Nip(substring, start);
@@ -423,7 +423,7 @@ Highlighter_Raw_Excerpt_IMP(Highlighter *self, const CharBuf *field_val,
         if (SStr_Get_Size(substring) == 0) {
             // Word is longer than excerpt_length. Reset to original position
             // truncating the word.
-            SStr_Assign(substring, (CharBuf*)field_val);
+            SStr_Assign(substring, (String*)field_val);
             start            = orig_start;
             this_excerpt_len = orig_len;
             int32_t diff = this_excerpt_len - ivars->excerpt_length;
@@ -444,7 +444,7 @@ Highlighter_Raw_Excerpt_IMP(Highlighter *self, const CharBuf *field_val,
     }
     else {
         // Remember original excerpt
-        StackString *orig_substring = SSTR_WRAP((CharBuf*)substring);
+        StackString *orig_substring = SSTR_WRAP((String*)substring);
         // Check for prepended ellipsis
         uint32_t min_size = found_starting_edge ? 0 : 4;
 
@@ -475,22 +475,22 @@ Highlighter_Raw_Excerpt_IMP(Highlighter *self, const CharBuf *field_val,
         if (SStr_Get_Size(substring) == min_size) {
             // Word is longer than excerpt_length. Reset to original excerpt
             // truncating the word.
-            SStr_Assign(substring, (CharBuf*)orig_substring);
+            SStr_Assign(substring, (String*)orig_substring);
             SStr_Chop(substring, 1);
         }
     }
 
     if (!found_starting_edge) {
-        CB_Cat_Char(raw_excerpt, ELLIPSIS_CODE_POINT);
-        CB_Cat_Char(raw_excerpt, ' ');
+        Str_Cat_Char(raw_excerpt, ELLIPSIS_CODE_POINT);
+        Str_Cat_Char(raw_excerpt, ' ');
         const size_t ELLIPSIS_LEN = 2; // Unicode ellipsis plus a space.
         start -= ELLIPSIS_LEN;
     }
 
-    CB_Cat(raw_excerpt, (CharBuf*)substring);
+    Str_Cat(raw_excerpt, (String*)substring);
 
     if (!found_ending_edge) {
-        CB_Cat_Char(raw_excerpt, ELLIPSIS_CODE_POINT);
+        Str_Cat_Char(raw_excerpt, ELLIPSIS_CODE_POINT);
     }
 
     return start;
@@ -498,13 +498,13 @@ Highlighter_Raw_Excerpt_IMP(Highlighter *self, const CharBuf *field_val,
 
 void
 Highlighter_Highlight_Excerpt_IMP(Highlighter *self, VArray *spans,
-                                  CharBuf *raw_excerpt, CharBuf *highlighted,
+                                  String *raw_excerpt, String *highlighted,
                                   int32_t top) {
     int32_t        hl_start        = 0;
     int32_t        hl_end          = 0;
     StackString *temp            = SSTR_WRAP(raw_excerpt);
-    CharBuf       *encode_buf      = NULL;
-    int32_t        raw_excerpt_end = top + CB_Length(raw_excerpt);
+    String        *encode_buf      = NULL;
+    int32_t        raw_excerpt_end = top + Str_Length(raw_excerpt);
 
     for (uint32_t i = 0, max = VA_Get_Size(spans); i < max; i++) {
         Span *span = (Span*)VA_Fetch(spans, i);
@@ -525,26 +525,26 @@ Highlighter_Highlight_Excerpt_IMP(Highlighter *self, VArray *spans,
                 }
             }
             else {
-                CharBuf *encoded;
+                String *encoded;
 
                 if (hl_start < hl_end) {
                     // Highlight previous section
                     int32_t highlighted_len = hl_end - hl_start;
-                    StackString *to_cat = SSTR_WRAP((CharBuf*)temp);
+                    StackString *to_cat = SSTR_WRAP((String*)temp);
                     SStr_Truncate(to_cat, highlighted_len);
-                    encoded = S_do_encode(self, (CharBuf*)to_cat, &encode_buf);
-                    CharBuf *hl_frag = Highlighter_Highlight(self, encoded);
-                    CB_Cat(highlighted, hl_frag);
+                    encoded = S_do_encode(self, (String*)to_cat, &encode_buf);
+                    String *hl_frag = Highlighter_Highlight(self, encoded);
+                    Str_Cat(highlighted, hl_frag);
                     SStr_Nip(temp, highlighted_len);
                     DECREF(hl_frag);
                     DECREF(encoded);
                 }
 
                 int32_t non_highlighted_len = relative_start - hl_end;
-                StackString *to_cat = SSTR_WRAP((CharBuf*)temp);
+                StackString *to_cat = SSTR_WRAP((String*)temp);
                 SStr_Truncate(to_cat, non_highlighted_len);
-                encoded = S_do_encode(self, (CharBuf*)to_cat, &encode_buf);
-                CB_Cat(highlighted, (CharBuf*)encoded);
+                encoded = S_do_encode(self, (String*)to_cat, &encode_buf);
+                Str_Cat(highlighted, (String*)encoded);
                 SStr_Nip(temp, non_highlighted_len);
                 DECREF(encoded);
 
@@ -557,11 +557,11 @@ Highlighter_Highlight_Excerpt_IMP(Highlighter *self, VArray *spans,
     if (hl_start < hl_end) {
         // Highlight final section
         int32_t highlighted_len = hl_end - hl_start;
-        StackString *to_cat = SSTR_WRAP((CharBuf*)temp);
+        StackString *to_cat = SSTR_WRAP((String*)temp);
         SStr_Truncate(to_cat, highlighted_len);
-        CharBuf *encoded = S_do_encode(self, (CharBuf*)to_cat, &encode_buf);
-        CharBuf *hl_frag = Highlighter_Highlight(self, encoded);
-        CB_Cat(highlighted, hl_frag);
+        String *encoded = S_do_encode(self, (String*)to_cat, &encode_buf);
+        String *hl_frag = Highlighter_Highlight(self, encoded);
+        Str_Cat(highlighted, hl_frag);
         SStr_Nip(temp, highlighted_len);
         DECREF(hl_frag);
         DECREF(encoded);
@@ -569,8 +569,8 @@ Highlighter_Highlight_Excerpt_IMP(Highlighter *self, VArray *spans,
 
     // Last text, beyond last highlight span.
     if (SStr_Get_Size(temp)) {
-        CharBuf *encoded = S_do_encode(self, (CharBuf*)temp, &encode_buf);
-        CB_Cat(highlighted, encoded);
+        String *encoded = S_do_encode(self, (String*)temp, &encode_buf);
+        Str_Cat(highlighted, encoded);
         DECREF(encoded);
     }
 
@@ -596,7 +596,7 @@ S_close_sentence(VArray *sentences, Span **sentence_ptr,
 }
 
 VArray*
-Highlighter_Find_Sentences_IMP(Highlighter *self, CharBuf *text,
+Highlighter_Find_Sentences_IMP(Highlighter *self, String *text,
                                int32_t offset, int32_t length) {
     /* When [sentence] is NULL, that means a sentence start has not yet been
      * found.  When it is a Span object, we have a start, but we haven't found
@@ -676,15 +676,15 @@ Highlighter_Find_Sentences_IMP(Highlighter *self, CharBuf *text,
     return sentences;
 }
 
-CharBuf*
-Highlighter_Encode_IMP(Highlighter *self, CharBuf *text) {
-    CharBuf *encoded = CB_new(0);
+String*
+Highlighter_Encode_IMP(Highlighter *self, String *text) {
+    String *encoded = Str_new(0);
     UNUSED_VAR(self);
     return S_encode_entities(text, encoded);
 }
 
-static CharBuf*
-S_do_encode(Highlighter *self, CharBuf *text, CharBuf **encode_buf) {
+static String*
+S_do_encode(Highlighter *self, String *text, String **encode_buf) {
     VTable *vtable = Highlighter_Get_VTable(self);
     Highlighter_Encode_t my_meth
         = (Highlighter_Encode_t)METHOD_PTR(vtable, LUCY_Highlighter_Encode);
@@ -695,14 +695,14 @@ S_do_encode(Highlighter *self, CharBuf *text, CharBuf **encode_buf) {
         return my_meth(self, text);
     }
     else {
-        if (*encode_buf == NULL) { *encode_buf = CB_new(0); }
+        if (*encode_buf == NULL) { *encode_buf = Str_new(0); }
         (void)S_encode_entities(text, *encode_buf);
-        return (CharBuf*)INCREF(*encode_buf);
+        return (String*)INCREF(*encode_buf);
     }
 }
 
-static CharBuf*
-S_encode_entities(CharBuf *text, CharBuf *encoded) {
+static String*
+S_encode_entities(String *text, String *encoded) {
     StackString *temp = SSTR_WRAP(text);
     size_t space = 0;
     const int MAX_ENTITY_BYTES = 9; // &#dddddd;
@@ -724,29 +724,29 @@ S_encode_entities(CharBuf *text, CharBuf *encoded) {
         }
     }
 
-    CB_Grow(encoded, space);
-    CB_Set_Size(encoded, 0);
+    Str_Grow(encoded, space);
+    Str_Set_Size(encoded, 0);
     SStr_Assign(temp, text);
     while (0 != (code_point = SStr_Nibble(temp))) {
         if (code_point > 127
             || (!isgraph(code_point) && !isspace(code_point))
            ) {
-            CB_catf(encoded, "&#%u32;", code_point);
+            Str_catf(encoded, "&#%u32;", code_point);
         }
         else if (code_point == '<') {
-            CB_Cat_Trusted_Str(encoded, "&lt;", 4);
+            Str_Cat_Trusted_Str(encoded, "&lt;", 4);
         }
         else if (code_point == '>') {
-            CB_Cat_Trusted_Str(encoded, "&gt;", 4);
+            Str_Cat_Trusted_Str(encoded, "&gt;", 4);
         }
         else if (code_point == '&') {
-            CB_Cat_Trusted_Str(encoded, "&amp;", 5);
+            Str_Cat_Trusted_Str(encoded, "&amp;", 5);
         }
         else if (code_point == '"') {
-            CB_Cat_Trusted_Str(encoded, "&quot;", 6);
+            Str_Cat_Trusted_Str(encoded, "&quot;", 6);
         }
         else {
-            CB_Cat_Char(encoded, code_point);
+            Str_Cat_Char(encoded, code_point);
         }
     }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Highlight/Highlighter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Highlight/Highlighter.cfh b/core/Lucy/Highlight/Highlighter.cfh
index c4eaad0..64c5aa2 100644
--- a/core/Lucy/Highlight/Highlighter.cfh
+++ b/core/Lucy/Highlight/Highlighter.cfh
@@ -27,16 +27,16 @@ public class Lucy::Highlight::Highlighter inherits Clownfish::Obj {
 
     Searcher   *searcher;
     Query      *query;
-    CharBuf    *field;
+    String     *field;
     uint32_t    excerpt_length;
     uint32_t    window_width;
     uint32_t    slop;
-    CharBuf    *pre_tag;
-    CharBuf    *post_tag;
+    String     *pre_tag;
+    String     *post_tag;
     Compiler   *compiler;
 
     inert incremented Highlighter*
-    new(Searcher *searcher, Obj *query, const CharBuf *field,
+    new(Searcher *searcher, Obj *query, const String *field,
         uint32_t excerpt_length = 200);
 
     /**
@@ -51,12 +51,12 @@ public class Lucy::Highlight::Highlighter inherits Clownfish::Obj {
      */
     public inert Highlighter*
     init(Highlighter *self, Searcher *searcher, Obj *query,
-         const CharBuf *field, uint32_t excerpt_length = 200);
+         const String *field, uint32_t excerpt_length = 200);
 
     /** Take a HitDoc object and return a highlighted excerpt as a string if
      * the HitDoc has a value for the specified <code>field</code>.
      */
-    public incremented CharBuf*
+    public incremented String*
     Create_Excerpt(Highlighter *self, HitDoc *hit_doc);
 
     /** Encode text with HTML entities. This method is called internally by
@@ -64,8 +64,8 @@ public class Lucy::Highlight::Highlighter inherits Clownfish::Obj {
      * subclass can override this if the text should be encoded differently or
      * not at all.
      */
-    public incremented CharBuf*
-    Encode(Highlighter *self, CharBuf *text);
+    public incremented String*
+    Encode(Highlighter *self, String *text);
 
     /** Find sentence boundaries within the specified range, returning them as
      * an array of Spans.  The "offset" of each Span indicates the start of
@@ -81,39 +81,39 @@ public class Lucy::Highlight::Highlighter inherits Clownfish::Obj {
      * until the end of the string.
      */
     incremented VArray*
-    Find_Sentences(Highlighter *self, CharBuf *text, int32_t offset = 0,
+    Find_Sentences(Highlighter *self, String *text, int32_t offset = 0,
                    int32_t length = 0);
 
     /** Highlight a small section of text.  By default, prepends pre-tag and
      * appends post-tag.  This method is called internally by Create_Excerpt()
      * when assembling an excerpt.
      */
-    public incremented CharBuf*
-    Highlight(Highlighter *self, const CharBuf *text);
+    public incremented String*
+    Highlight(Highlighter *self, const String *text);
 
     /** Setter.  The default value is "<strong>".
      */
     public void
-    Set_Pre_Tag(Highlighter *self, const CharBuf *pre_tag);
+    Set_Pre_Tag(Highlighter *self, const String *pre_tag);
 
     /** Setter.  The default value is "</strong>".
      */
     public void
-    Set_Post_Tag(Highlighter *self, const CharBuf *post_tag);
+    Set_Post_Tag(Highlighter *self, const String *post_tag);
 
     /** Accessor.
      */
-    public CharBuf*
+    public String*
     Get_Pre_Tag(Highlighter *self);
 
     /** Accessor.
      */
-    public CharBuf*
+    public String*
     Get_Post_Tag(Highlighter *self);
 
     /** Accessor.
      */
-    public CharBuf*
+    public String*
     Get_Field(Highlighter *self);
 
     /** Accessor.
@@ -144,7 +144,7 @@ public class Lucy::Highlight::Highlighter inherits Clownfish::Obj {
      * (Helper function for Create_Excerpt only exposed for testing purposes.)
      */
     int32_t
-    Find_Best_Fragment(Highlighter *self, const CharBuf *field_val,
+    Find_Best_Fragment(Highlighter *self, const String *field_val,
                        ViewCharBuf *fragment, HeatMap *heat_map);
 
     /** Take the fragment and determine the best edges for it based on
@@ -154,8 +154,8 @@ public class Lucy::Highlight::Highlighter inherits Clownfish::Obj {
      * (Helper function for Create_Excerpt only exposed for testing purposes.)
      */
     int32_t
-    Raw_Excerpt(Highlighter *self, const CharBuf *field_val,
-                const CharBuf *fragment, CharBuf *raw_excerpt, int32_t top,
+    Raw_Excerpt(Highlighter *self, const String *field_val,
+                const String *fragment, String *raw_excerpt, int32_t top,
                 HeatMap *heat_map, VArray *sentences);
 
     /** Take the text in raw_excerpt, add highlight tags, encode, and place
@@ -164,8 +164,8 @@ public class Lucy::Highlight::Highlighter inherits Clownfish::Obj {
      * (Helper function for Create_Excerpt only exposed for testing purposes.)
      */
     void
-    Highlight_Excerpt(Highlighter *self, VArray *spans, CharBuf *raw_excerpt,
-                      CharBuf *highlighted, int32_t top);
+    Highlight_Excerpt(Highlighter *self, VArray *spans, String *raw_excerpt,
+                      String *highlighted, int32_t top);
 
     public void
     Destroy(Highlighter *self);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/BackgroundMerger.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/BackgroundMerger.c b/core/Lucy/Index/BackgroundMerger.c
index 31eba25..3e88c1e 100644
--- a/core/Lucy/Index/BackgroundMerger.c
+++ b/core/Lucy/Index/BackgroundMerger.c
@@ -37,7 +37,7 @@
 #include "Lucy/Util/IndexFileNames.h"
 #include "Lucy/Util/Json.h"
 
-// Verify a Folder or derive an FSFolder from a CharBuf path.
+// Verify a Folder or derive an FSFolder from a String path.
 static Folder*
 S_init_folder(Obj *index);
 
@@ -127,7 +127,7 @@ BGMerger_init(BackgroundMerger *self, Obj *index, IndexManager *manager) {
     VArray *fields = Schema_All_Fields(ivars->schema);
     ivars->segment = Seg_new(new_seg_num);
     for (uint32_t i = 0, max = VA_Get_Size(fields); i < max; i++) {
-        Seg_Add_Field(ivars->segment, (CharBuf*)VA_Fetch(fields, i));
+        Seg_Add_Field(ivars->segment, (String*)VA_Fetch(fields, i));
     }
     DECREF(fields);
 
@@ -182,8 +182,8 @@ S_init_folder(Obj *index) {
     if (Obj_Is_A(index, FOLDER)) {
         folder = (Folder*)INCREF(index);
     }
-    else if (Obj_Is_A(index, CHARBUF)) {
-        folder = (Folder*)FSFolder_new((CharBuf*)index);
+    else if (Obj_Is_A(index, STRING)) {
+        folder = (Folder*)FSFolder_new((String*)index);
     }
     else {
         THROW(ERR, "Invalid type for 'index': %o", Obj_Get_Class_Name(index));
@@ -229,7 +229,7 @@ S_maybe_merge(BackgroundMerger *self) {
     // Consolidate segments.
     for (uint32_t i = 0, max = num_to_merge; i < max; i++) {
         SegReader *seg_reader = (SegReader*)VA_Fetch(to_merge, i);
-        CharBuf   *seg_name   = SegReader_Get_Seg_Name(seg_reader);
+        String    *seg_name   = SegReader_Get_Seg_Name(seg_reader);
         int64_t    doc_count  = Seg_Get_Count(ivars->segment);
         Matcher *deletions
             = DelWriter_Seg_Deletions(ivars->del_writer, seg_reader);
@@ -262,13 +262,13 @@ S_merge_updated_deletions(BackgroundMerger *self) {
 
     for (uint32_t i = 0, max = VA_Get_Size(new_seg_readers); i < max; i++) {
         SegReader *seg_reader = (SegReader*)VA_Fetch(new_seg_readers, i);
-        CharBuf   *seg_name   = SegReader_Get_Seg_Name(seg_reader);
+        String    *seg_name   = SegReader_Get_Seg_Name(seg_reader);
         Hash_Store(new_segs, (Obj*)seg_name, INCREF(seg_reader));
     }
 
     for (uint32_t i = 0, max = VA_Get_Size(old_seg_readers); i < max; i++) {
         SegReader *seg_reader = (SegReader*)VA_Fetch(old_seg_readers, i);
-        CharBuf   *seg_name   = SegReader_Get_Seg_Name(seg_reader);
+        String    *seg_name   = SegReader_Get_Seg_Name(seg_reader);
 
         // If this segment was merged away...
         if (Hash_Fetch(ivars->doc_maps, (Obj*)seg_name)) {
@@ -315,7 +315,7 @@ S_merge_updated_deletions(BackgroundMerger *self) {
         int64_t  merge_seg_num = Seg_Get_Number(ivars->segment);
         uint32_t seg_tick      = INT32_MAX;
         int32_t  offset        = INT32_MAX;
-        CharBuf *seg_name      = NULL;
+        String *seg_name      = NULL;
         Matcher *deletions     = NULL;
 
         SegWriter_Prep_Seg_Dir(seg_writer);
@@ -413,20 +413,20 @@ BGMerger_Prepare_Commit_IMP(BackgroundMerger *self) {
         // Write temporary snapshot file.
         DECREF(ivars->snapfile);
         ivars->snapfile = IxManager_Make_Snapshot_Filename(ivars->manager);
-        CB_Cat_Trusted_Str(ivars->snapfile, ".temp", 5);
+        Str_Cat_Trusted_Str(ivars->snapfile, ".temp", 5);
         Folder_Delete(folder, ivars->snapfile);
         Snapshot_Write_File(snapshot, folder, ivars->snapfile);
 
         // Determine whether the index has been updated while this background
         // merge process was running.
 
-        CharBuf *start_snapfile
+        String *start_snapfile
             = Snapshot_Get_Path(PolyReader_Get_Snapshot(ivars->polyreader));
         Snapshot *latest_snapshot
             = Snapshot_Read_File(Snapshot_new(), ivars->folder, NULL);
-        CharBuf *latest_snapfile = Snapshot_Get_Path(latest_snapshot);
+        String *latest_snapfile = Snapshot_Get_Path(latest_snapshot);
         bool index_updated
-            = !CB_Equals(start_snapfile, (Obj*)latest_snapfile);
+            = !Str_Equals(start_snapfile, (Obj*)latest_snapfile);
 
         if (index_updated) {
             /* See if new deletions have been applied since this
@@ -442,8 +442,8 @@ BGMerger_Prepare_Commit_IMP(BackgroundMerger *self) {
             // we couldn't tell whether the deletion counts changed.)
             VArray *files = Snapshot_List(latest_snapshot);
             for (uint32_t i = 0, max = VA_Get_Size(files); i < max; i++) {
-                CharBuf *file = (CharBuf*)VA_Fetch(files, i);
-                if (CB_Starts_With_Str(file, "seg_", 4)) {
+                String *file = (String*)VA_Fetch(files, i);
+                if (Str_Starts_With_Str(file, "seg_", 4)) {
                     int64_t gen = (int64_t)IxFileNames_extract_gen(file);
                     if (gen > ivars->cutoff) {
                         Snapshot_Add_Entry(ivars->snapshot, file);
@@ -483,27 +483,27 @@ BGMerger_Commit_IMP(BackgroundMerger *self) {
 
     if (ivars->needs_commit) {
         bool success = false;
-        CharBuf *temp_snapfile = ivars->snapfile;
+        String *temp_snapfile = ivars->snapfile;
 
         // Rename temp snapshot file.
         size_t ext_len      = sizeof(".temp") - 1;
-        size_t snapfile_len = CB_Length(temp_snapfile);
+        size_t snapfile_len = Str_Length(temp_snapfile);
         if (snapfile_len <= ext_len) {
             THROW(ERR, "Invalid snapfile name: %o", temp_snapfile);
         }
-        ivars->snapfile = CB_SubString(temp_snapfile, 0,
+        ivars->snapfile = Str_SubString(temp_snapfile, 0,
                                        snapfile_len - ext_len);
         success = Folder_Hard_Link(ivars->folder, temp_snapfile,
                                    ivars->snapfile);
         Snapshot_Set_Path(ivars->snapshot, ivars->snapfile);
         if (!success) {
-            CharBuf *mess = CB_newf("Can't create hard link from %o to %o",
+            String *mess = Str_newf("Can't create hard link from %o to %o",
                                     temp_snapfile, ivars->snapfile);
             DECREF(temp_snapfile);
             Err_throw_mess(ERR, mess);
         }
         if (!Folder_Delete(ivars->folder, temp_snapfile)) {
-            CharBuf *mess = CB_newf("Can't delete %o", temp_snapfile);
+            String *mess = Str_newf("Can't delete %o", temp_snapfile);
             DECREF(temp_snapfile);
             Err_throw_mess(ERR, mess);
         }

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/BackgroundMerger.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/BackgroundMerger.cfh b/core/Lucy/Index/BackgroundMerger.cfh
index d25c3b4..a0936dd 100644
--- a/core/Lucy/Index/BackgroundMerger.cfh
+++ b/core/Lucy/Index/BackgroundMerger.cfh
@@ -40,7 +40,7 @@ public class Lucy::Index::BackgroundMerger cnick BGMerger
     FilePurger        *file_purger;
     Lock              *write_lock;
     Lock              *merge_lock;
-    CharBuf           *snapfile;
+    String            *snapfile;
     Hash              *doc_maps;
     int64_t            cutoff;
     bool               optimize;

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/BitVecDelDocs.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/BitVecDelDocs.c b/core/Lucy/Index/BitVecDelDocs.c
index 3c1aeff..45d414f 100644
--- a/core/Lucy/Index/BitVecDelDocs.c
+++ b/core/Lucy/Index/BitVecDelDocs.c
@@ -22,17 +22,17 @@
 #include "Lucy/Store/InStream.h"
 
 BitVecDelDocs*
-BitVecDelDocs_new(Folder *folder, const CharBuf *filename) {
+BitVecDelDocs_new(Folder *folder, const String *filename) {
     BitVecDelDocs *self = (BitVecDelDocs*)VTable_Make_Obj(BITVECDELDOCS);
     return BitVecDelDocs_init(self, folder, filename);
 }
 
 BitVecDelDocs*
 BitVecDelDocs_init(BitVecDelDocs *self, Folder *folder,
-                   const CharBuf *filename) {
+                   const String *filename) {
     BitVec_init((BitVector*)self, 0);
     BitVecDelDocsIVARS *const ivars = BitVecDelDocs_IVARS(self);
-    ivars->filename = CB_Clone(filename);
+    ivars->filename = Str_Clone(filename);
     ivars->instream = Folder_Open_In(folder, filename);
     if (!ivars->instream) {
         Err *error = (Err*)INCREF(Err_get_error());

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/BitVecDelDocs.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/BitVecDelDocs.cfh b/core/Lucy/Index/BitVecDelDocs.cfh
index 87f31ae..eb33b7a 100644
--- a/core/Lucy/Index/BitVecDelDocs.cfh
+++ b/core/Lucy/Index/BitVecDelDocs.cfh
@@ -19,13 +19,13 @@ parcel Lucy;
 class Lucy::Index::BitVecDelDocs inherits Lucy::Object::BitVector {
 
     InStream  *instream;
-    CharBuf   *filename;
+    String    *filename;
 
     inert incremented BitVecDelDocs*
-    new(Folder *folder, const CharBuf *filename);
+    new(Folder *folder, const String *filename);
 
     inert BitVecDelDocs*
-    init(BitVecDelDocs *self, Folder *folder, const CharBuf *filename);
+    init(BitVecDelDocs *self, Folder *folder, const String *filename);
 
     public void
     Destroy(BitVecDelDocs *self);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/DataWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DataWriter.c b/core/Lucy/Index/DataWriter.c
index 8f211f9..747dc89 100644
--- a/core/Lucy/Index/DataWriter.c
+++ b/core/Lucy/Index/DataWriter.c
@@ -92,7 +92,7 @@ Hash*
 DataWriter_Metadata_IMP(DataWriter *self) {
     Hash *metadata = Hash_new(0);
     Hash_Store_Str(metadata, "format", 6,
-                   (Obj*)CB_newf("%i32", DataWriter_Format(self)));
+                   (Obj*)Str_newf("%i32", DataWriter_Format(self)));
     return metadata;
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/DeletionsReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DeletionsReader.c b/core/Lucy/Index/DeletionsReader.c
index 37946f1..30b9f5f 100644
--- a/core/Lucy/Index/DeletionsReader.c
+++ b/core/Lucy/Index/DeletionsReader.c
@@ -158,8 +158,8 @@ DefDelReader_Read_Deletions_IMP(DefaultDeletionsReader *self) {
     DefaultDeletionsReaderIVARS *const ivars = DefDelReader_IVARS(self);
     VArray  *segments    = DefDelReader_Get_Segments(self);
     Segment *segment     = DefDelReader_Get_Segment(self);
-    CharBuf *my_seg_name = Seg_Get_Name(segment);
-    CharBuf *del_file    = NULL;
+    String *my_seg_name = Seg_Get_Name(segment);
+    String *del_file    = NULL;
     int32_t  del_count   = 0;
 
     // Start with deletions files in the most recently added segments and work
@@ -179,9 +179,9 @@ DefDelReader_Read_Deletions_IMP(DefaultDeletionsReader *self) {
                                  Hash_Fetch_Str(seg_files_data, "count", 5),
                                  OBJ);
                 del_count = (int32_t)Obj_To_I64(count);
-                del_file  = (CharBuf*)CERTIFY(
+                del_file  = (String*)CERTIFY(
                                 Hash_Fetch_Str(seg_files_data, "filename", 8),
-                                CHARBUF);
+                                STRING);
                 break;
             }
         }

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/DeletionsWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DeletionsWriter.c b/core/Lucy/Index/DeletionsWriter.c
index 39aa896..35a2a2e 100644
--- a/core/Lucy/Index/DeletionsWriter.c
+++ b/core/Lucy/Index/DeletionsWriter.c
@@ -130,11 +130,11 @@ DefDelWriter_Destroy_IMP(DefaultDeletionsWriter *self) {
     SUPER_DESTROY(self, DEFAULTDELETIONSWRITER);
 }
 
-static CharBuf*
+static String*
 S_del_filename(DefaultDeletionsWriter *self, SegReader *target_reader) {
     DefaultDeletionsWriterIVARS *const ivars = DefDelWriter_IVARS(self);
     Segment *target_seg = SegReader_Get_Segment(target_reader);
-    return CB_newf("%o/deletions-%o.bv", Seg_Get_Name(ivars->segment),
+    return Str_newf("%o/deletions-%o.bv", Seg_Get_Name(ivars->segment),
                    Seg_Get_Name(target_seg));
 }
 
@@ -151,7 +151,7 @@ DefDelWriter_Finish_IMP(DefaultDeletionsWriter *self) {
             double     used      = (doc_max + 1) / 8.0;
             uint32_t   byte_size = (uint32_t)ceil(used);
             uint32_t   new_max   = byte_size * 8 - 1;
-            CharBuf   *filename  = S_del_filename(self, seg_reader);
+            String    *filename  = S_del_filename(self, seg_reader);
             OutStream *outstream = Folder_Open_Out(folder, filename);
             if (!outstream) { RETHROW(INCREF(Err_get_error())); }
 
@@ -188,7 +188,7 @@ DefDelWriter_Metadata_IMP(DefaultDeletionsWriter *self) {
             Segment   *segment   = SegReader_Get_Segment(seg_reader);
             Hash      *mini_meta = Hash_new(2);
             Hash_Store_Str(mini_meta, "count", 5,
-                           (Obj*)CB_newf("%u32", (uint32_t)BitVec_Count(deldocs)));
+                           (Obj*)Str_newf("%u32", (uint32_t)BitVec_Count(deldocs)));
             Hash_Store_Str(mini_meta, "filename", 8,
                            (Obj*)S_del_filename(self, seg_reader));
             Hash_Store(files, (Obj*)Seg_Get_Name(segment), (Obj*)mini_meta);
@@ -211,7 +211,7 @@ DefDelWriter_Seg_Deletions_IMP(DefaultDeletionsWriter *self,
     DefaultDeletionsWriterIVARS *const ivars = DefDelWriter_IVARS(self);
     Matcher *deletions    = NULL;
     Segment *segment      = SegReader_Get_Segment(seg_reader);
-    CharBuf *seg_name     = Seg_Get_Name(segment);
+    String *seg_name     = Seg_Get_Name(segment);
     Integer32 *tick_obj   = (Integer32*)Hash_Fetch(ivars->name_to_tick,
                                                    (Obj*)seg_name);
     int32_t tick          = tick_obj ? Int32_Get_Value(tick_obj) : 0;
@@ -237,7 +237,7 @@ DefDelWriter_Seg_Deletions_IMP(DefaultDeletionsWriter *self,
 
 int32_t
 DefDelWriter_Seg_Del_Count_IMP(DefaultDeletionsWriter *self,
-                               const CharBuf *seg_name) {
+                               const String *seg_name) {
     DefaultDeletionsWriterIVARS *const ivars = DefDelWriter_IVARS(self);
     Integer32 *tick
         = (Integer32*)Hash_Fetch(ivars->name_to_tick, (Obj*)seg_name);
@@ -249,7 +249,7 @@ DefDelWriter_Seg_Del_Count_IMP(DefaultDeletionsWriter *self,
 
 void
 DefDelWriter_Delete_By_Term_IMP(DefaultDeletionsWriter *self,
-                                const CharBuf *field, Obj *term) {
+                                const String *field, Obj *term) {
     DefaultDeletionsWriterIVARS *const ivars = DefDelWriter_IVARS(self);
     for (uint32_t i = 0, max = VA_Get_Size(ivars->seg_readers); i < max; i++) {
         SegReader *seg_reader = (SegReader*)VA_Fetch(ivars->seg_readers, i);
@@ -350,7 +350,7 @@ DefDelWriter_Merge_Segment_IMP(DefaultDeletionsWriter *self,
         VArray *seg_readers = ivars->seg_readers;
         Hash   *files = (Hash*)Hash_Fetch_Str(del_meta, "files", 5);
         if (files) {
-            CharBuf *seg;
+            String *seg;
             Hash *mini_meta;
             Hash_Iterate(files);
             while (Hash_Next(files, (Obj**)&seg, (Obj**)&mini_meta)) {
@@ -362,10 +362,10 @@ DefDelWriter_Merge_Segment_IMP(DefaultDeletionsWriter *self,
                 for (uint32_t i = 0, max = VA_Get_Size(seg_readers); i < max; i++) {
                     SegReader *candidate
                         = (SegReader*)VA_Fetch(seg_readers, i);
-                    CharBuf *candidate_name
+                    String *candidate_name
                         = Seg_Get_Name(SegReader_Get_Segment(candidate));
 
-                    if (CB_Equals(seg, (Obj*)candidate_name)) {
+                    if (Str_Equals(seg, (Obj*)candidate_name)) {
                         /* If the count hasn't changed, we're about to
                          * merge away the most recent deletions file
                          * pointing at this target segment -- so force a

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/DeletionsWriter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DeletionsWriter.cfh b/core/Lucy/Index/DeletionsWriter.cfh
index 4af5848..1e60822 100644
--- a/core/Lucy/Index/DeletionsWriter.cfh
+++ b/core/Lucy/Index/DeletionsWriter.cfh
@@ -47,7 +47,7 @@ public abstract class Lucy::Index::DeletionsWriter cnick DelWriter
      * will be processed automatically (so don't pre-process it yourself).
      */
     public abstract void
-    Delete_By_Term(DeletionsWriter *self, const CharBuf *field, Obj *term);
+    Delete_By_Term(DeletionsWriter *self, const String *field, Obj *term);
 
     /** Delete all documents in the index that match <code>query</code>.
      *
@@ -92,7 +92,7 @@ public abstract class Lucy::Index::DeletionsWriter cnick DelWriter
      * @param seg_name The name of the segment.
      */
     public abstract int32_t
-    Seg_Del_Count(DeletionsWriter *self, const CharBuf *seg_name);
+    Seg_Del_Count(DeletionsWriter *self, const String *seg_name);
 }
 
 /** Implements DeletionsWriter using BitVector files.
@@ -124,7 +124,7 @@ class Lucy::Index::DefaultDeletionsWriter cnick DefDelWriter
          Segment *segment, PolyReader *polyreader);
 
     public void
-    Delete_By_Term(DefaultDeletionsWriter *self, const CharBuf *field,
+    Delete_By_Term(DefaultDeletionsWriter *self, const String *field,
                    Obj *term);
 
     public void
@@ -140,7 +140,7 @@ class Lucy::Index::DefaultDeletionsWriter cnick DefDelWriter
     Seg_Deletions(DefaultDeletionsWriter *self, SegReader *seg_reader);
 
     public int32_t
-    Seg_Del_Count(DefaultDeletionsWriter *self, const CharBuf *seg_name);
+    Seg_Del_Count(DefaultDeletionsWriter *self, const String *seg_name);
 
     public void
     Add_Segment(DefaultDeletionsWriter *self, SegReader *reader,

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/DocReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DocReader.c b/core/Lucy/Index/DocReader.c
index da09fc3..4fa87f8 100644
--- a/core/Lucy/Index/DocReader.c
+++ b/core/Lucy/Index/DocReader.c
@@ -142,9 +142,9 @@ DefDocReader_init(DefaultDocReader *self, Schema *schema, Folder *folder,
     metadata = (Hash*)Seg_Fetch_Metadata_Str(segment, "documents", 9);
 
     if (metadata) {
-        CharBuf *seg_name  = Seg_Get_Name(segment);
-        CharBuf *ix_file   = CB_newf("%o/documents.ix", seg_name);
-        CharBuf *dat_file  = CB_newf("%o/documents.dat", seg_name);
+        String *seg_name  = Seg_Get_Name(segment);
+        String *ix_file   = Str_newf("%o/documents.ix", seg_name);
+        String *dat_file  = Str_newf("%o/documents.dat", seg_name);
         Obj     *format    = Hash_Fetch_Str(metadata, "format", 6);
 
         // Check format.

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/DocVector.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DocVector.c b/core/Lucy/Index/DocVector.c
index 8f01ddf..3645bf7 100644
--- a/core/Lucy/Index/DocVector.c
+++ b/core/Lucy/Index/DocVector.c
@@ -30,7 +30,7 @@ S_extract_tv_cache(ByteBuf *field_buf);
 
 // Pull a TermVector object out from compressed positional data.
 static TermVector*
-S_extract_tv_from_tv_buf(const CharBuf *field, const CharBuf *term_text,
+S_extract_tv_from_tv_buf(const String *field, const String *term_text,
                          ByteBuf *tv_buf);
 
 DocVector*
@@ -71,14 +71,14 @@ DocVec_Destroy_IMP(DocVector *self) {
 }
 
 void
-DocVec_Add_Field_Buf_IMP(DocVector *self, const CharBuf *field,
+DocVec_Add_Field_Buf_IMP(DocVector *self, const String *field,
                          ByteBuf *field_buf) {
     DocVectorIVARS *const ivars = DocVec_IVARS(self);
     Hash_Store(ivars->field_bufs, (Obj*)field, INCREF(field_buf));
 }
 
 ByteBuf*
-DocVec_Field_Buf_IMP(DocVector *self, const CharBuf *field) {
+DocVec_Field_Buf_IMP(DocVector *self, const String *field) {
     DocVectorIVARS *const ivars = DocVec_IVARS(self);
     return (ByteBuf*)Hash_Fetch(ivars->field_bufs, (Obj*)field);
 }
@@ -90,8 +90,8 @@ DocVec_Field_Names_IMP(DocVector *self) {
 }
 
 TermVector*
-DocVec_Term_Vector_IMP(DocVector *self, const CharBuf *field,
-                       const CharBuf *term_text) {
+DocVec_Term_Vector_IMP(DocVector *self, const String *field,
+                       const String *term_text) {
     DocVectorIVARS *const ivars = DocVec_IVARS(self);
     Hash *field_vector = (Hash*)Hash_Fetch(ivars->field_vectors, (Obj*)field);
 
@@ -121,7 +121,7 @@ S_extract_tv_cache(ByteBuf *field_buf) {
     Hash    *tv_cache  = Hash_new(0);
     char    *tv_string = BB_Get_Buf(field_buf);
     int32_t  num_terms = NumUtil_decode_c32(&tv_string);
-    CharBuf *text      = CB_new(0);
+    String *text      = Str_new(0);
 
     // Read the number of highlightable terms in the field.
     for (int32_t i = 0; i < num_terms; i++) {
@@ -129,8 +129,8 @@ S_extract_tv_cache(ByteBuf *field_buf) {
         size_t   len     = NumUtil_decode_c32(&tv_string);
 
         // Decompress the term text.
-        CB_Set_Size(text, overlap);
-        CB_Cat_Trusted_Str(text, tv_string, len);
+        Str_Set_Size(text, overlap);
+        Str_Cat_Trusted_Str(text, tv_string, len);
         tv_string += len;
 
         // Get positions & offsets string.
@@ -154,7 +154,7 @@ S_extract_tv_cache(ByteBuf *field_buf) {
 }
 
 static TermVector*
-S_extract_tv_from_tv_buf(const CharBuf *field, const CharBuf *term_text,
+S_extract_tv_from_tv_buf(const String *field, const String *term_text,
                          ByteBuf *tv_buf) {
     TermVector *retval      = NULL;
     char       *posdata     = BB_Get_Buf(tv_buf);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/DocVector.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DocVector.cfh b/core/Lucy/Index/DocVector.cfh
index 39a666a..6217eec 100644
--- a/core/Lucy/Index/DocVector.cfh
+++ b/core/Lucy/Index/DocVector.cfh
@@ -34,18 +34,18 @@ class Lucy::Index::DocVector cnick DocVec
     init(DocVector *self);
 
     incremented TermVector*
-    Term_Vector(DocVector *self, const CharBuf *field, const CharBuf *term);
+    Term_Vector(DocVector *self, const String *field, const String *term);
 
     /** Add a compressed, encoded TermVector to the object.
      */
     void
-    Add_Field_Buf(DocVector *self, const CharBuf *field, ByteBuf *field_buf);
+    Add_Field_Buf(DocVector *self, const String *field, ByteBuf *field_buf);
 
     /** Return the compressed, encoded TermVector associated with a particular
      * field.
      */
     ByteBuf*
-    Field_Buf(DocVector *self, const CharBuf *field);
+    Field_Buf(DocVector *self, const String *field);
 
     public void
     Serialize(DocVector *self, OutStream *outstream);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/DocWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/DocWriter.c b/core/Lucy/Index/DocWriter.c
index f9b8496..1ebc1fd 100644
--- a/core/Lucy/Index/DocWriter.c
+++ b/core/Lucy/Index/DocWriter.c
@@ -63,14 +63,14 @@ S_lazy_init(DocWriter *self) {
     DocWriterIVARS *const ivars = DocWriter_IVARS(self);
     if (!ivars->dat_out) {
         Folder  *folder   = ivars->folder;
-        CharBuf *seg_name = Seg_Get_Name(ivars->segment);
+        String *seg_name = Seg_Get_Name(ivars->segment);
 
         // Get streams.
-        CharBuf *ix_file = CB_newf("%o/documents.ix", seg_name);
+        String *ix_file = Str_newf("%o/documents.ix", seg_name);
         ivars->ix_out = Folder_Open_Out(folder, ix_file);
         DECREF(ix_file);
         if (!ivars->ix_out) { RETHROW(INCREF(Err_get_error())); }
-        CharBuf *dat_file = CB_newf("%o/documents.dat", seg_name);
+        String *dat_file = Str_newf("%o/documents.dat", seg_name);
         ivars->dat_out = Folder_Open_Out(folder, dat_file);
         DECREF(dat_file);
         if (!ivars->dat_out) { RETHROW(INCREF(Err_get_error())); }
@@ -110,13 +110,13 @@ DocWriter_Add_Inverted_Doc_IMP(DocWriter *self, Inverter *inverter,
         // Only store fields marked as "stored".
         FieldType *type = Inverter_Get_Type(inverter);
         if (FType_Stored(type)) {
-            CharBuf *field = Inverter_Get_Field_Name(inverter);
+            String *field = Inverter_Get_Field_Name(inverter);
             Obj *value = Inverter_Get_Value(inverter);
             Freezer_serialize_charbuf(field, dat_out);
             switch (FType_Primitive_ID(type) & FType_PRIMITIVE_ID_MASK) {
                 case FType_TEXT: {
-                    uint8_t *buf  = CB_Get_Ptr8((CharBuf*)value);
-                    size_t   size = CB_Get_Size((CharBuf*)value);
+                    uint8_t *buf  = Str_Get_Ptr8((String*)value);
+                    size_t   size = Str_Get_Size((String*)value);
                     OutStream_Write_C32(dat_out, size);
                     OutStream_Write_Bytes(dat_out, buf, size);
                     break;

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/FilePurger.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/FilePurger.c b/core/Lucy/Index/FilePurger.c
index 74737bb..46957a9 100644
--- a/core/Lucy/Index/FilePurger.c
+++ b/core/Lucy/Index/FilePurger.c
@@ -95,7 +95,7 @@ FilePurger_Purge_IMP(FilePurger *self) {
         // get deleted after they've been emptied.
         VA_Sort(purgables, NULL, NULL);
         for (uint32_t i = VA_Get_Size(purgables); i--;) {
-            CharBuf *entry = (CharBuf*)VA_Fetch(purgables, i);
+            String *entry = (String*)VA_Fetch(purgables, i);
             if (Hash_Fetch(ivars->disallowed, (Obj*)entry)) { continue; }
             if (!Folder_Delete(folder, entry)) {
                 if (Folder_Exists(folder, entry)) {
@@ -112,7 +112,7 @@ FilePurger_Purge_IMP(FilePurger *self) {
                 // successfully deleted.
                 VArray *entries = Snapshot_List(snapshot);
                 for (uint32_t j = VA_Get_Size(entries); j--;) {
-                    CharBuf *entry = (CharBuf*)VA_Fetch(entries, j);
+                    String *entry = (String*)VA_Fetch(entries, j);
                     if (Hash_Fetch(failures, (Obj*)entry)) {
                         snapshot_has_failures = true;
                         break;
@@ -121,7 +121,7 @@ FilePurger_Purge_IMP(FilePurger *self) {
                 DECREF(entries);
             }
             if (!snapshot_has_failures) {
-                CharBuf *snapfile = Snapshot_Get_Path(snapshot);
+                String *snapfile = Snapshot_Get_Path(snapshot);
                 Folder_Delete(folder, snapfile);
             }
         }
@@ -153,7 +153,7 @@ S_zap_dead_merge(FilePurger *self, Hash *candidates) {
                        : NULL;
 
         if (cutoff) {
-            CharBuf *cutoff_seg = Seg_num_to_name(Obj_To_I64(cutoff));
+            String *cutoff_seg = Seg_num_to_name(Obj_To_I64(cutoff));
             if (Folder_Exists(ivars->folder, cutoff_seg)) {
                 StackString *merge_json = SSTR_WRAP_STR("merge.json", 10);
                 DirHandle *dh = Folder_Open_Dir(ivars->folder, cutoff_seg);
@@ -166,8 +166,8 @@ S_zap_dead_merge(FilePurger *self, Hash *candidates) {
                 Hash_Store(candidates, (Obj*)merge_json, (Obj*)CFISH_TRUE);
                 while (DH_Next(dh)) {
                     // TODO: recursively delete subdirs within seg dir.
-                    CharBuf *entry = DH_Get_Entry(dh);
-                    CharBuf *filepath = CB_newf("%o/%o", cutoff_seg, entry);
+                    String *entry = DH_Get_Entry(dh);
+                    String *filepath = Str_newf("%o/%o", cutoff_seg, entry);
                     Hash_Store(candidates, (Obj*)filepath, (Obj*)CFISH_TRUE);
                     DECREF(filepath);
                     DECREF(entry);
@@ -193,7 +193,7 @@ S_discover_unused(FilePurger *self, VArray **purgables_ptr,
     if (!dh) { RETHROW(INCREF(Err_get_error())); }
     VArray      *spared       = VA_new(1);
     VArray      *snapshots    = VA_new(1);
-    CharBuf     *snapfile     = NULL;
+    String      *snapfile     = NULL;
 
     // Start off with the list of files in the current snapshot.
     if (ivars->snapshot) {
@@ -208,10 +208,10 @@ S_discover_unused(FilePurger *self, VArray **purgables_ptr,
 
     Hash *candidates = Hash_new(64);
     while (DH_Next(dh)) {
-        CharBuf *entry = DH_Get_Entry(dh);
-        if (CB_Starts_With_Str(entry, "snapshot_", 9)
-            && CB_Ends_With_Str(entry, ".json", 5)
-            && (!snapfile || !CB_Equals(entry, (Obj*)snapfile))
+        String *entry = DH_Get_Entry(dh);
+        if (Str_Starts_With_Str(entry, "snapshot_", 9)
+            && Str_Ends_With_Str(entry, ".json", 5)
+            && (!snapfile || !Str_Equals(entry, (Obj*)snapfile))
         ) {
             Snapshot *snapshot
                 = Snapshot_Read_File(Snapshot_new(), folder, entry);
@@ -232,14 +232,14 @@ S_discover_unused(FilePurger *self, VArray **purgables_ptr,
                                     + VA_Get_Size(referenced)
                                     + 1;
                 VA_Grow(spared, new_size);
-                VA_Push(spared, (Obj*)CB_Clone(entry));
+                VA_Push(spared, (Obj*)Str_Clone(entry));
                 VA_Push_VArray(spared, referenced);
             }
             else {
                 // No one's using this snapshot, so all of its entries are
                 // candidates for deletion.
                 for (uint32_t i = 0, max = VA_Get_Size(referenced); i < max; i++) {
-                    CharBuf *file = (CharBuf*)VA_Fetch(referenced, i);
+                    String *file = (String*)VA_Fetch(referenced, i);
                     Hash_Store(candidates, (Obj*)file, (Obj*)CFISH_TRUE);
                 }
                 VA_Push(snapshots, INCREF(snapshot));
@@ -259,7 +259,7 @@ S_discover_unused(FilePurger *self, VArray **purgables_ptr,
 
     // Eliminate any current files from the list of files to be purged.
     for (uint32_t i = 0, max = VA_Get_Size(spared); i < max; i++) {
-        CharBuf *filename = (CharBuf*)VA_Fetch(spared, i);
+        String *filename = (String*)VA_Fetch(spared, i);
         DECREF(Hash_Delete(candidates, (Obj*)filename));
     }
 
@@ -275,12 +275,12 @@ static VArray*
 S_find_all_referenced(Folder *folder, VArray *entries) {
     Hash *uniqued = Hash_new(VA_Get_Size(entries));
     for (uint32_t i = 0, max = VA_Get_Size(entries); i < max; i++) {
-        CharBuf *entry = (CharBuf*)VA_Fetch(entries, i);
+        String *entry = (String*)VA_Fetch(entries, i);
         Hash_Store(uniqued, (Obj*)entry, (Obj*)CFISH_TRUE);
         if (Folder_Is_Directory(folder, entry)) {
             VArray *contents = Folder_List_R(folder, entry);
             for (uint32_t j = VA_Get_Size(contents); j--;) {
-                CharBuf *sub_entry = (CharBuf*)VA_Fetch(contents, j);
+                String *sub_entry = (String*)VA_Fetch(contents, j);
                 Hash_Store(uniqued, (Obj*)sub_entry, (Obj*)CFISH_TRUE);
             }
             DECREF(contents);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/HighlightReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/HighlightReader.c b/core/Lucy/Index/HighlightReader.c
index 4f1f3b6..b76f2cb 100644
--- a/core/Lucy/Index/HighlightReader.c
+++ b/core/Lucy/Index/HighlightReader.c
@@ -137,9 +137,9 @@ DefHLReader_init(DefaultHighlightReader *self, Schema *schema,
     }
 
     // Open instreams.
-    CharBuf *seg_name = Seg_Get_Name(segment);
-    CharBuf *ix_file  = CB_newf("%o/highlight.ix", seg_name);
-    CharBuf *dat_file = CB_newf("%o/highlight.dat", seg_name);
+    String *seg_name = Seg_Get_Name(segment);
+    String *ix_file  = Str_newf("%o/highlight.ix", seg_name);
+    String *dat_file = Str_newf("%o/highlight.dat", seg_name);
     if (Folder_Exists(folder, ix_file)) {
         ivars->ix_in = Folder_Open_In(folder, ix_file);
         if (!ivars->ix_in) {
@@ -200,7 +200,7 @@ DefHLReader_Fetch_Doc_Vec_IMP(DefaultHighlightReader *self, int32_t doc_id) {
 
     uint32_t num_fields = InStream_Read_C32(dat_in);
     while (num_fields--) {
-        CharBuf *field = Freezer_read_charbuf(dat_in);
+        String *field = Freezer_read_charbuf(dat_in);
         ByteBuf *field_buf = Freezer_read_bytebuf(dat_in);
         DocVec_Add_Field_Buf(doc_vec, field, field_buf);
         DECREF(field_buf);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/HighlightWriter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/HighlightWriter.c b/core/Lucy/Index/HighlightWriter.c
index cb588ea..fc89253 100644
--- a/core/Lucy/Index/HighlightWriter.c
+++ b/core/Lucy/Index/HighlightWriter.c
@@ -71,15 +71,15 @@ S_lazy_init(HighlightWriter *self) {
     if (!ivars->dat_out) {
         Segment  *segment  = ivars->segment;
         Folder   *folder   = ivars->folder;
-        CharBuf  *seg_name = Seg_Get_Name(segment);
+        String   *seg_name = Seg_Get_Name(segment);
 
         // Open outstreams.
-        CharBuf *ix_file = CB_newf("%o/highlight.ix", seg_name);
+        String *ix_file = Str_newf("%o/highlight.ix", seg_name);
         ivars->ix_out = Folder_Open_Out(folder, ix_file);
         DECREF(ix_file);
         if (!ivars->ix_out) { RETHROW(INCREF(Err_get_error())); }
 
-        CharBuf *dat_file = CB_newf("%o/highlight.dat", seg_name);
+        String *dat_file = Str_newf("%o/highlight.dat", seg_name);
         ivars->dat_out = Folder_Open_Out(folder, dat_file);
         DECREF(dat_file);
         if (!ivars->dat_out) { RETHROW(INCREF(Err_get_error())); }
@@ -127,7 +127,7 @@ HLWriter_Add_Inverted_Doc_IMP(HighlightWriter *self, Inverter *inverter,
         if (FType_Is_A(type, FULLTEXTTYPE)
             && FullTextType_Highlightable((FullTextType*)type)
            ) {
-            CharBuf   *field     = Inverter_Get_Field_Name(inverter);
+            String    *field     = Inverter_Get_Field_Name(inverter);
             Inversion *inversion = Inverter_Get_Inversion(inverter);
             ByteBuf   *tv_buf    = HLWriter_TV_Buf(self, inversion);
             Freezer_serialize_charbuf(field, dat_out);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/IndexManager.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/IndexManager.c b/core/Lucy/Index/IndexManager.c
index 5141713..e2a8009 100644
--- a/core/Lucy/Index/IndexManager.c
+++ b/core/Lucy/Index/IndexManager.c
@@ -32,18 +32,18 @@
 #include "Clownfish/Util/StringHelper.h"
 
 IndexManager*
-IxManager_new(const CharBuf *host, LockFactory *lock_factory) {
+IxManager_new(const String *host, LockFactory *lock_factory) {
     IndexManager *self = (IndexManager*)VTable_Make_Obj(INDEXMANAGER);
     return IxManager_init(self, host, lock_factory);
 }
 
 IndexManager*
-IxManager_init(IndexManager *self, const CharBuf *host,
+IxManager_init(IndexManager *self, const String *host,
                LockFactory *lock_factory) {
     IndexManagerIVARS *const ivars = IxManager_IVARS(self);
     ivars->host                = host
-                                ? CB_Clone(host)
-                                : CB_new_from_trusted_utf8("", 0);
+                                ? Str_Clone(host)
+                                : Str_new_from_trusted_utf8("", 0);
     ivars->lock_factory        = (LockFactory*)INCREF(lock_factory);
     ivars->folder              = NULL;
     ivars->write_lock_timeout  = 1000;
@@ -71,7 +71,7 @@ IxManager_Highest_Seg_Num_IMP(IndexManager *self, Snapshot *snapshot) {
     uint64_t highest_seg_num = 0;
     UNUSED_VAR(self);
     for (uint32_t i = 0, max = VA_Get_Size(files); i < max; i++) {
-        CharBuf *file = (CharBuf*)VA_Fetch(files, i);
+        String *file = (String*)VA_Fetch(files, i);
         if (Seg_valid_seg_name(file)) {
             uint64_t seg_num = IxFileNames_extract_gen(file);
             if (seg_num > highest_seg_num) { highest_seg_num = seg_num; }
@@ -81,7 +81,7 @@ IxManager_Highest_Seg_Num_IMP(IndexManager *self, Snapshot *snapshot) {
     return (int64_t)highest_seg_num;
 }
 
-CharBuf*
+String*
 IxManager_Make_Snapshot_Filename_IMP(IndexManager *self) {
     IndexManagerIVARS *const ivars = IxManager_IVARS(self);
     Folder *folder = (Folder*)CERTIFY(ivars->folder, FOLDER);
@@ -90,9 +90,9 @@ IxManager_Make_Snapshot_Filename_IMP(IndexManager *self) {
 
     if (!dh) { RETHROW(INCREF(Err_get_error())); }
     while (DH_Next(dh)) {
-        CharBuf *entry = DH_Get_Entry(dh);
-        if (CB_Starts_With_Str(entry, "snapshot_", 9)
-            && CB_Ends_With_Str(entry, ".json", 5)
+        String *entry = DH_Get_Entry(dh);
+        if (Str_Starts_With_Str(entry, "snapshot_", 9)
+            && Str_Ends_With_Str(entry, ".json", 5)
            ) {
             uint64_t gen = IxFileNames_extract_gen(entry);
             if (gen > max_gen) { max_gen = gen; }
@@ -104,7 +104,7 @@ IxManager_Make_Snapshot_Filename_IMP(IndexManager *self) {
     uint64_t new_gen = max_gen + 1;
     char  base36[StrHelp_MAX_BASE36_BYTES];
     StrHelp_to_base36(new_gen, &base36);
-    return CB_newf("snapshot_%s.json", &base36);
+    return Str_newf("snapshot_%s.json", &base36);
 }
 
 static int
@@ -171,7 +171,7 @@ IxManager_Recycle_IMP(IndexManager *self, PolyReader *reader,
     // Find segments where at least 10% of all docs have been deleted.
     for (uint32_t i = threshold; i < num_candidates; i++) {
         SegReader *seg_reader = (SegReader*)VA_Delete(candidates, i);
-        CharBuf   *seg_name   = SegReader_Get_Seg_Name(seg_reader);
+        String    *seg_name   = SegReader_Get_Seg_Name(seg_reader);
         double doc_max = SegReader_Doc_Max(seg_reader);
         double num_deletions = DelWriter_Seg_Del_Count(del_writer, seg_name);
         double del_proportion = num_deletions / doc_max;
@@ -235,7 +235,7 @@ IxManager_Make_Write_Lock_IMP(IndexManager *self) {
     IndexManagerIVARS *const ivars = IxManager_IVARS(self);
     StackString *write_lock_name = SSTR_WRAP_STR("write", 5);
     LockFactory *lock_factory = S_obtain_lock_factory(self);
-    return LockFact_Make_Lock(lock_factory, (CharBuf*)write_lock_name,
+    return LockFact_Make_Lock(lock_factory, (String*)write_lock_name,
                               ivars->write_lock_timeout,
                               ivars->write_lock_interval);
 }
@@ -245,7 +245,7 @@ IxManager_Make_Deletion_Lock_IMP(IndexManager *self) {
     IndexManagerIVARS *const ivars = IxManager_IVARS(self);
     StackString *lock_name = SSTR_WRAP_STR("deletion", 8);
     LockFactory *lock_factory = S_obtain_lock_factory(self);
-    return LockFact_Make_Lock(lock_factory, (CharBuf*)lock_name,
+    return LockFact_Make_Lock(lock_factory, (String*)lock_name,
                               ivars->deletion_lock_timeout,
                               ivars->deletion_lock_interval);
 }
@@ -255,7 +255,7 @@ IxManager_Make_Merge_Lock_IMP(IndexManager *self) {
     IndexManagerIVARS *const ivars = IxManager_IVARS(self);
     StackString *merge_lock_name = SSTR_WRAP_STR("merge", 5);
     LockFactory *lock_factory = S_obtain_lock_factory(self);
-    return LockFact_Make_Lock(lock_factory, (CharBuf*)merge_lock_name,
+    return LockFact_Make_Lock(lock_factory, (String*)merge_lock_name,
                               ivars->merge_lock_timeout,
                               ivars->merge_lock_interval);
 }
@@ -266,8 +266,8 @@ IxManager_Write_Merge_Data_IMP(IndexManager *self, int64_t cutoff) {
     StackString *merge_json = SSTR_WRAP_STR("merge.json", 10);
     Hash *data = Hash_new(1);
     bool success;
-    Hash_Store_Str(data, "cutoff", 6, (Obj*)CB_newf("%i64", cutoff));
-    success = Json_spew_json((Obj*)data, ivars->folder, (CharBuf*)merge_json);
+    Hash_Store_Str(data, "cutoff", 6, (Obj*)Str_newf("%i64", cutoff));
+    success = Json_spew_json((Obj*)data, ivars->folder, (String*)merge_json);
     DECREF(data);
     if (!success) {
         THROW(ERR, "Failed to write to %o", merge_json);
@@ -278,9 +278,9 @@ Hash*
 IxManager_Read_Merge_Data_IMP(IndexManager *self) {
     IndexManagerIVARS *const ivars = IxManager_IVARS(self);
     StackString *merge_json = SSTR_WRAP_STR("merge.json", 10);
-    if (Folder_Exists(ivars->folder, (CharBuf*)merge_json)) {
+    if (Folder_Exists(ivars->folder, (String*)merge_json)) {
         Hash *stuff
-            = (Hash*)Json_slurp_json(ivars->folder, (CharBuf*)merge_json);
+            = (Hash*)Json_slurp_json(ivars->folder, (String*)merge_json);
         if (stuff) {
             CERTIFY(stuff, HASH);
             return stuff;
@@ -298,17 +298,17 @@ bool
 IxManager_Remove_Merge_Data_IMP(IndexManager *self) {
     IndexManagerIVARS *const ivars = IxManager_IVARS(self);
     StackString *merge_json = SSTR_WRAP_STR("merge.json", 10);
-    return Folder_Delete(ivars->folder, (CharBuf*)merge_json) != 0;
+    return Folder_Delete(ivars->folder, (String*)merge_json) != 0;
 }
 
 Lock*
 IxManager_Make_Snapshot_Read_Lock_IMP(IndexManager *self,
-                                      const CharBuf *filename) {
+                                      const String *filename) {
     StackString *lock_name = SSTR_WRAP(filename);
     LockFactory *lock_factory = S_obtain_lock_factory(self);
 
-    if (!CB_Starts_With_Str(filename, "snapshot_", 9)
-        || !CB_Ends_With_Str(filename, ".json", 5)
+    if (!Str_Starts_With_Str(filename, "snapshot_", 9)
+        || !Str_Ends_With_Str(filename, ".json", 5)
        ) {
         THROW(ERR, "Not a snapshot filename: %o", filename);
     }
@@ -316,7 +316,7 @@ IxManager_Make_Snapshot_Read_Lock_IMP(IndexManager *self,
     // Truncate ".json" from end of snapshot file name.
     SStr_Chop(lock_name, sizeof(".json") - 1);
 
-    return LockFact_Make_Shared_Lock(lock_factory, (CharBuf*)lock_name, 1000, 100);
+    return LockFact_Make_Shared_Lock(lock_factory, (String*)lock_name, 1000, 100);
 }
 
 void
@@ -331,7 +331,7 @@ IxManager_Get_Folder_IMP(IndexManager *self) {
     return IxManager_IVARS(self)->folder;
 }
 
-CharBuf*
+String*
 IxManager_Get_Host_IMP(IndexManager *self) {
     return IxManager_IVARS(self)->host;
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/IndexManager.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/IndexManager.cfh b/core/Lucy/Index/IndexManager.cfh
index fa1b26d..79308e0 100644
--- a/core/Lucy/Index/IndexManager.cfh
+++ b/core/Lucy/Index/IndexManager.cfh
@@ -30,7 +30,7 @@ public class Lucy::Index::IndexManager cnick IxManager
     inherits Clownfish::Obj {
 
     Folder      *folder;
-    CharBuf     *host;
+    String      *host;
     LockFactory *lock_factory;
     uint32_t     write_lock_timeout;
     uint32_t     write_lock_interval;
@@ -40,14 +40,14 @@ public class Lucy::Index::IndexManager cnick IxManager
     uint32_t     deletion_lock_interval;
 
     public inert incremented IndexManager*
-    new(const CharBuf *host = NULL, LockFactory *lock_factory = NULL);
+    new(const String *host = NULL, LockFactory *lock_factory = NULL);
 
     /**
      * @param host An identifier which should be unique per-machine.
      * @param lock_factory A LockFactory.
      */
     public inert IndexManager*
-    init(IndexManager *self, const CharBuf *host = NULL,
+    init(IndexManager *self, const String *host = NULL,
          LockFactory *lock_factory = NULL);
 
     public void
@@ -67,7 +67,7 @@ public class Lucy::Index::IndexManager cnick IxManager
 
     /** Getter for <code>host</code> member.
      */
-    public CharBuf*
+    public String*
     Get_Host(IndexManager *self);
 
     /** Return an array of SegReaders representing segments that should be
@@ -131,7 +131,7 @@ public class Lucy::Index::IndexManager cnick IxManager
      * all the files it lists and indicates that they must not be deleted.
      */
     public incremented Lock*
-    Make_Snapshot_Read_Lock(IndexManager *self, const CharBuf *filename);
+    Make_Snapshot_Read_Lock(IndexManager *self, const String *filename);
 
     /** Return the highest number for a segment directory which contains a
      * segmeta file in the snapshot.
@@ -143,7 +143,7 @@ public class Lucy::Index::IndexManager cnick IxManager
      * "generation" embedded inside it greater than the generation of any
      * snapshot file currently in the index folder.
      */
-    public incremented CharBuf*
+    public incremented String*
     Make_Snapshot_Filename(IndexManager *self);
 
     /** Setter for write lock timeout.  Default: 1000 milliseconds.

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/IndexReader.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/IndexReader.c b/core/Lucy/Index/IndexReader.c
index 395bc23..dd27114 100644
--- a/core/Lucy/Index/IndexReader.c
+++ b/core/Lucy/Index/IndexReader.c
@@ -70,7 +70,7 @@ void
 IxReader_Close_IMP(IndexReader *self) {
     IndexReaderIVARS *const ivars = IxReader_IVARS(self);
     if (ivars->components) {
-        CharBuf *key;
+        String *key;
         DataReader *component;
         Hash_Iterate(ivars->components);
         while (Hash_Next(ivars->components, (Obj**)&key,
@@ -108,7 +108,7 @@ IxReader_Get_Components_IMP(IndexReader *self) {
 }
 
 DataReader*
-IxReader_Obtain_IMP(IndexReader *self, const CharBuf *api) {
+IxReader_Obtain_IMP(IndexReader *self, const String *api) {
     IndexReaderIVARS *const ivars = IxReader_IVARS(self);
     DataReader *component
         = (DataReader*)Hash_Fetch(ivars->components, (Obj*)api);
@@ -119,7 +119,7 @@ IxReader_Obtain_IMP(IndexReader *self, const CharBuf *api) {
 }
 
 DataReader*
-IxReader_Fetch_IMP(IndexReader *self, const CharBuf *api) {
+IxReader_Fetch_IMP(IndexReader *self, const String *api) {
     IndexReaderIVARS *const ivars = IxReader_IVARS(self);
     return (DataReader*)Hash_Fetch(ivars->components, (Obj*)api);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/IndexReader.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/IndexReader.cfh b/core/Lucy/Index/IndexReader.cfh
index 3fd63ec..d460afc 100644
--- a/core/Lucy/Index/IndexReader.cfh
+++ b/core/Lucy/Index/IndexReader.cfh
@@ -102,7 +102,7 @@ public class Lucy::Index::IndexReader cnick IxReader
      * component must implement.
      */
     public DataReader*
-    Obtain(IndexReader *self, const CharBuf *api);
+    Obtain(IndexReader *self, const String *api);
 
     /** Fetch a component, or return NULL if the component can't be found.
      *
@@ -110,7 +110,7 @@ public class Lucy::Index::IndexReader cnick IxReader
      * component must implement.
      */
     public nullable DataReader*
-    Fetch(IndexReader *self, const CharBuf *api);
+    Fetch(IndexReader *self, const String *api);
 
     public void
     Close(IndexReader *self);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/Indexer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Indexer.c b/core/Lucy/Index/Indexer.c
index 923f51a..cade20a 100644
--- a/core/Lucy/Index/Indexer.c
+++ b/core/Lucy/Index/Indexer.c
@@ -53,13 +53,13 @@ S_release_write_lock(Indexer *self);
 static void
 S_release_merge_lock(Indexer *self);
 
-// Verify a Folder or derive an FSFolder from a CharBuf path.  Call
+// Verify a Folder or derive an FSFolder from a String path.  Call
 // Folder_Initialize() if "create" is true.
 static Folder*
 S_init_folder(Obj *index, bool create);
 
 // Find the schema file within a snapshot.
-static CharBuf*
+static String*
 S_find_schema_file(Snapshot *snapshot);
 
 Indexer*
@@ -107,7 +107,7 @@ Indexer_init(Indexer *self, Schema *schema, Obj *index,
     }
 
     // Find the latest snapshot or create a new one.
-    CharBuf *latest_snapfile = IxFileNames_latest_snapshot(folder);
+    String *latest_snapfile = IxFileNames_latest_snapshot(folder);
     if (latest_snapfile) {
         Snapshot_Read_File(latest_snapshot, folder, latest_snapfile);
     }
@@ -122,7 +122,7 @@ Indexer_init(Indexer *self, Schema *schema, Obj *index,
             THROW(ERR, "No Schema supplied, and can't find one in the index");
         }
         else {
-            CharBuf *schema_file = S_find_schema_file(latest_snapshot);
+            String *schema_file = S_find_schema_file(latest_snapshot);
             Obj *dump = Json_slurp_json(folder, schema_file);
             if (dump) { // read file successfully
                 ivars->schema = (Schema*)CERTIFY(Freezer_load(dump), SCHEMA);
@@ -196,7 +196,7 @@ Indexer_init(Indexer *self, Schema *schema, Obj *index,
     // Add all known fields to Segment.
     VArray *fields = Schema_All_Fields(schema);
     for (uint32_t i = 0, max = VA_Get_Size(fields); i < max; i++) {
-        Seg_Add_Field(ivars->segment, (CharBuf*)VA_Fetch(fields, i));
+        Seg_Add_Field(ivars->segment, (String*)VA_Fetch(fields, i));
     }
     DECREF(fields);
 
@@ -247,8 +247,8 @@ S_init_folder(Obj *index, bool create) {
     if (Obj_Is_A(index, FOLDER)) {
         folder = (Folder*)INCREF(index);
     }
-    else if (Obj_Is_A(index, CHARBUF)) {
-        folder = (Folder*)FSFolder_new((CharBuf*)index);
+    else if (Obj_Is_A(index, STRING)) {
+        folder = (Folder*)FSFolder_new((String*)index);
     }
     else {
         THROW(ERR, "Invalid type for 'index': %o", Obj_Get_Class_Name(index));
@@ -274,7 +274,7 @@ Indexer_Add_Doc_IMP(Indexer *self, Doc *doc, float boost) {
 }
 
 void
-Indexer_Delete_By_Term_IMP(Indexer *self, CharBuf *field, Obj *term) {
+Indexer_Delete_By_Term_IMP(Indexer *self, String *field, Obj *term) {
     IndexerIVARS *const ivars = Indexer_IVARS(self);
     Schema    *schema = ivars->schema;
     FieldType *type   = Schema_Fetch_Type(schema, field);
@@ -286,9 +286,9 @@ Indexer_Delete_By_Term_IMP(Indexer *self, CharBuf *field, Obj *term) {
 
     // Analyze term if appropriate, then zap.
     if (FType_Is_A(type, FULLTEXTTYPE)) {
-        CERTIFY(term, CHARBUF);
+        CERTIFY(term, STRING);
         Analyzer *analyzer = Schema_Fetch_Analyzer(schema, field);
-        VArray *terms = Analyzer_Split(analyzer, (CharBuf*)term);
+        VArray *terms = Analyzer_Split(analyzer, (String*)term);
         Obj *analyzed_term = VA_Fetch(terms, 0);
         if (analyzed_term) {
             DelWriter_Delete_By_Term(ivars->del_writer, field,
@@ -322,8 +322,8 @@ Indexer_Add_Index_IMP(Indexer *self, Obj *index) {
     if (Obj_Is_A(index, FOLDER)) {
         other_folder = (Folder*)INCREF(index);
     }
-    else if (Obj_Is_A(index, CHARBUF)) {
-        other_folder = (Folder*)FSFolder_new((CharBuf*)index);
+    else if (Obj_Is_A(index, STRING)) {
+        other_folder = (Folder*)FSFolder_new((String*)index);
     }
     else {
         THROW(ERR, "Invalid type for 'index': %o", Obj_Get_Class_Name(index));
@@ -344,7 +344,7 @@ Indexer_Add_Index_IMP(Indexer *self, Obj *index) {
 
         // Add fields to Segment.
         for (uint32_t i = 0, max = VA_Get_Size(other_fields); i < max; i++) {
-            CharBuf *other_field = (CharBuf*)VA_Fetch(other_fields, i);
+            String *other_field = (String*)VA_Fetch(other_fields, i);
             Seg_Add_Field(ivars->segment, other_field);
         }
         DECREF(other_fields);
@@ -378,14 +378,14 @@ Indexer_Optimize_IMP(Indexer *self) {
     Indexer_IVARS(self)->optimize = true;
 }
 
-static CharBuf*
+static String*
 S_find_schema_file(Snapshot *snapshot) {
     VArray *files = Snapshot_List(snapshot);
-    CharBuf *retval = NULL;
+    String *retval = NULL;
     for (uint32_t i = 0, max = VA_Get_Size(files); i < max; i++) {
-        CharBuf *file = (CharBuf*)VA_Fetch(files, i);
-        if (CB_Starts_With_Str(file, "schema_", 7)
-            && CB_Ends_With_Str(file, ".json", 5)
+        String *file = (String*)VA_Fetch(files, i);
+        if (Str_Starts_With_Str(file, "schema_", 7)
+            && Str_Ends_With_Str(file, ".json", 5)
            ) {
             retval = file;
             break;
@@ -436,7 +436,7 @@ S_maybe_merge(Indexer *self, VArray *seg_readers) {
     for (uint32_t i = 0, max = VA_Get_Size(to_merge); i < max; i++) {
         SegReader *seg_reader
             = (SegReader*)CERTIFY(VA_Fetch(to_merge, i), SEGREADER);
-        CharBuf *seg_name = SegReader_Get_Seg_Name(seg_reader);
+        String *seg_name = SegReader_Get_Seg_Name(seg_reader);
         if (Hash_Fetch(seen, (Obj*)seg_name)) {
             DECREF(seen);
             DECREF(to_merge);
@@ -508,16 +508,16 @@ Indexer_Prepare_Commit_IMP(Indexer *self) {
         // Derive snapshot and schema file names.
         DECREF(ivars->snapfile);
         ivars->snapfile = IxManager_Make_Snapshot_Filename(ivars->manager);
-        CB_Cat_Trusted_Str(ivars->snapfile, ".temp", 5);
+        Str_Cat_Trusted_Str(ivars->snapfile, ".temp", 5);
         uint64_t schema_gen = IxFileNames_extract_gen(ivars->snapfile);
         char base36[StrHelp_MAX_BASE36_BYTES];
         StrHelp_to_base36(schema_gen, &base36);
-        CharBuf *new_schema_name = CB_newf("schema_%s.json", base36);
+        String *new_schema_name = Str_newf("schema_%s.json", base36);
 
         // Finish the segment, write schema file.
         SegWriter_Finish(ivars->seg_writer);
         Schema_Write(schema, folder, new_schema_name);
-        CharBuf *old_schema_name = S_find_schema_file(snapshot);
+        String *old_schema_name = S_find_schema_file(snapshot);
         if (old_schema_name) {
             Snapshot_Delete_Entry(snapshot, old_schema_name);
         }
@@ -554,13 +554,13 @@ Indexer_Commit_IMP(Indexer *self) {
         bool success;
 
         // Rename temp snapshot file.
-        CharBuf *temp_snapfile = ivars->snapfile;
+        String *temp_snapfile = ivars->snapfile;
         size_t ext_len      = sizeof(".temp") - 1;
-        size_t snapfile_len = CB_Length(temp_snapfile);
+        size_t snapfile_len = Str_Length(temp_snapfile);
         if (snapfile_len <= ext_len) {
             THROW(ERR, "Invalid snapfile name: %o", temp_snapfile);
         }
-        ivars->snapfile = CB_SubString(temp_snapfile, 0,
+        ivars->snapfile = Str_SubString(temp_snapfile, 0,
                                        snapfile_len - ext_len);
         Snapshot_Set_Path(ivars->snapshot, ivars->snapfile);
         success = Folder_Rename(ivars->folder, temp_snapfile, ivars->snapfile);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/Indexer.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Indexer.cfh b/core/Lucy/Index/Indexer.cfh
index e7b8745..9e15980 100644
--- a/core/Lucy/Index/Indexer.cfh
+++ b/core/Lucy/Index/Indexer.cfh
@@ -50,7 +50,7 @@ public class Lucy::Index::Indexer inherits Clownfish::Obj {
     Lock              *write_lock;
     Lock              *merge_lock;
     Doc               *stock_doc;
-    CharBuf           *snapfile;
+    String            *snapfile;
     bool               truncate;
     bool               optimize;
     bool               needs_commit;
@@ -103,7 +103,7 @@ public class Lucy::Index::Indexer inherits Clownfish::Obj {
      * will be processed automatically (so don't pre-process it yourself).
      */
     public void
-    Delete_By_Term(Indexer *self, CharBuf *field, Obj *term);
+    Delete_By_Term(Indexer *self, String *field, Obj *term);
 
     /** Mark documents which match the supplied Query as deleted.
      *

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/Inverter.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Inverter.c b/core/Lucy/Index/Inverter.c
index 03c256d..3c70742 100644
--- a/core/Lucy/Index/Inverter.c
+++ b/core/Lucy/Index/Inverter.c
@@ -113,7 +113,7 @@ Inverter_Get_Doc_IMP(Inverter *self) {
     return Inverter_IVARS(self)->doc;
 }
 
-CharBuf*
+String*
 Inverter_Get_Field_Name_IMP(Inverter *self) {
     InverterEntry *current = Inverter_IVARS(self)->current;
     return InvEntry_IVARS(current)->field;
@@ -160,7 +160,7 @@ Inverter_Add_Field_IMP(Inverter *self, InverterEntry *entry) {
         DECREF(entry_ivars->inversion);
         entry_ivars->inversion
             = Analyzer_Transform_Text(entry_ivars->analyzer,
-                                      (CharBuf*)entry_ivars->value);
+                                      (String*)entry_ivars->value);
         Inversion_Invert(entry_ivars->inversion);
     }
     else if (entry_ivars->indexed || entry_ivars->highlightable) {
@@ -192,17 +192,17 @@ Inverter_Clear_IMP(Inverter *self) {
 }
 
 InverterEntry*
-InvEntry_new(Schema *schema, const CharBuf *field, int32_t field_num) {
+InvEntry_new(Schema *schema, const String *field, int32_t field_num) {
     InverterEntry *self = (InverterEntry*)VTable_Make_Obj(INVERTERENTRY);
     return InvEntry_init(self, schema, field, field_num);
 }
 
 InverterEntry*
-InvEntry_init(InverterEntry *self, Schema *schema, const CharBuf *field,
+InvEntry_init(InverterEntry *self, Schema *schema, const String *field,
               int32_t field_num) {
     InverterEntryIVARS *const ivars = InvEntry_IVARS(self);
     ivars->field_num  = field_num;
-    ivars->field      = field ? CB_Clone(field) : NULL;
+    ivars->field      = field ? Str_Clone(field) : NULL;
     ivars->inversion  = NULL;
 
     if (schema) {

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/Inverter.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Inverter.cfh b/core/Lucy/Index/Inverter.cfh
index c2c1d38..6fcf8ff 100644
--- a/core/Lucy/Index/Inverter.cfh
+++ b/core/Lucy/Index/Inverter.cfh
@@ -99,7 +99,7 @@ class Lucy::Index::Inverter inherits Clownfish::Obj {
 
     /** Return the current field's name, or NULL if the iterator is exhausted.
      */
-    public nullable CharBuf*
+    public nullable String*
     Get_Field_Name(Inverter *self);
 
     /** Return the current field's value, or NULL if the iterator is
@@ -145,7 +145,7 @@ final class Lucy::Index::Inverter::InverterEntry cnick InvEntry
     inherits Clownfish::Obj {
 
     int32_t      field_num;
-    CharBuf     *field;
+    String      *field;
     Obj         *value;
     Inversion   *inversion;
     FieldType   *type;
@@ -155,11 +155,11 @@ final class Lucy::Index::Inverter::InverterEntry cnick InvEntry
     bool         highlightable;
 
     inert incremented InverterEntry*
-    new(Schema *schema = NULL, const CharBuf *field_name, int32_t field_num);
+    new(Schema *schema = NULL, const String *field_name, int32_t field_num);
 
     inert InverterEntry*
     init(InverterEntry *self = NULL, Schema *schema,
-         const CharBuf *field_name, int32_t field_num);
+         const String *field_name, int32_t field_num);
 
     public int32_t
     Compare_To(InverterEntry *self, Obj *other);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/LexIndex.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/LexIndex.c b/core/Lucy/Index/LexIndex.c
index 4b3505e..b9039db 100644
--- a/core/Lucy/Index/LexIndex.c
+++ b/core/Lucy/Index/LexIndex.c
@@ -33,18 +33,18 @@ S_read_entry(LexIndex *self);
 
 LexIndex*
 LexIndex_new(Schema *schema, Folder *folder, Segment *segment,
-             const CharBuf *field) {
+             const String *field) {
     LexIndex *self = (LexIndex*)VTable_Make_Obj(LEXINDEX);
     return LexIndex_init(self, schema, folder, segment, field);
 }
 
 LexIndex*
 LexIndex_init(LexIndex *self, Schema *schema, Folder *folder,
-              Segment *segment, const CharBuf *field) {
+              Segment *segment, const String *field) {
     int32_t  field_num = Seg_Field_Num(segment, field);
-    CharBuf *seg_name  = Seg_Get_Name(segment);
-    CharBuf *ixix_file = CB_newf("%o/lexicon-%i32.ixix", seg_name, field_num);
-    CharBuf *ix_file   = CB_newf("%o/lexicon-%i32.ix", seg_name, field_num);
+    String *seg_name  = Seg_Get_Name(segment);
+    String *ixix_file = Str_newf("%o/lexicon-%i32.ixix", seg_name, field_num);
+    String *ix_file   = Str_newf("%o/lexicon-%i32.ix", seg_name, field_num);
     Architecture *arch = Schema_Get_Architecture(schema);
 
     // Init.
@@ -56,7 +56,7 @@ LexIndex_init(LexIndex *self, Schema *schema, Folder *folder,
     // Derive
     ivars->field_type = Schema_Fetch_Type(schema, field);
     if (!ivars->field_type) {
-        CharBuf *mess = MAKE_MESS("Unknown field: '%o'", field);
+        String *mess = MAKE_MESS("Unknown field: '%o'", field);
         DECREF(ix_file);
         DECREF(ixix_file);
         DECREF(self);
@@ -153,9 +153,9 @@ LexIndex_Seek_IMP(LexIndex *self, Obj *target) {
         return;
     }
     else {
-        if (!Obj_Is_A(target, CHARBUF)) {
+        if (!Obj_Is_A(target, STRING)) {
             THROW(ERR, "Target is a %o, and not comparable to a %o",
-                  Obj_Get_Class_Name(target), VTable_Get_Name(CHARBUF));
+                  Obj_Get_Class_Name(target), VTable_Get_Name(STRING));
         }
         /* TODO:
         Obj *first_obj = VA_Fetch(terms, 0);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/LexIndex.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/LexIndex.cfh b/core/Lucy/Index/LexIndex.cfh
index 1897947..e28499d 100644
--- a/core/Lucy/Index/LexIndex.cfh
+++ b/core/Lucy/Index/LexIndex.cfh
@@ -31,11 +31,11 @@ class Lucy::Index::LexIndex inherits Lucy::Index::Lexicon {
 
     inert incremented LexIndex*
     new(Schema *schema, Folder *folder, Segment *segment,
-        const CharBuf *field);
+        const String *field);
 
     inert LexIndex*
     init(LexIndex *self, Schema *schema, Folder *folder, Segment *segment,
-         const CharBuf *field);
+         const String *field);
 
     public void
     Seek(LexIndex *self, Obj *target = NULL);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Index/Lexicon.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Index/Lexicon.c b/core/Lucy/Index/Lexicon.c
index 2797737..56c1bbf 100644
--- a/core/Lucy/Index/Lexicon.c
+++ b/core/Lucy/Index/Lexicon.c
@@ -20,14 +20,14 @@
 #include "Lucy/Index/Lexicon.h"
 
 Lexicon*
-Lex_init(Lexicon *self, const CharBuf *field) {
+Lex_init(Lexicon *self, const String *field) {
     LexiconIVARS *const ivars = Lex_IVARS(self);
-    ivars->field = CB_Clone(field);
+    ivars->field = Str_Clone(field);
     ABSTRACT_CLASS_CHECK(self, LEXICON);
     return self;
 }
 
-CharBuf*
+String*
 Lex_Get_Field_IMP(Lexicon *self) {
     return Lex_IVARS(self)->field;
 }


Mime
View raw message