lucy-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nwelln...@apache.org
Subject [lucy-commits] [05/24] Rename CharBuf to String (cnick Str)
Date Sun, 01 Sep 2013 20:16:53 GMT
http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/Store/TestFSDirHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSDirHandle.c b/core/Lucy/Test/Store/TestFSDirHandle.c
index 6f584d7..c6020bb 100644
--- a/core/Lucy/Test/Store/TestFSDirHandle.c
+++ b/core/Lucy/Test/Store/TestFSDirHandle.c
@@ -41,10 +41,10 @@ TestFSDH_new() {
 
 static void
 test_all(TestBatchRunner *runner) {
-    CharBuf  *foo           = (CharBuf*)SSTR_WRAP_STR("foo", 3);
-    CharBuf  *boffo         = (CharBuf*)SSTR_WRAP_STR("boffo", 5);
-    CharBuf  *foo_boffo     = (CharBuf*)SSTR_WRAP_STR("foo/boffo", 9);
-    CharBuf  *test_dir      = (CharBuf*)SSTR_WRAP_STR("_fsdir_test", 11);
+    String   *foo           = (String*)SSTR_WRAP_STR("foo", 3);
+    String   *boffo         = (String*)SSTR_WRAP_STR("boffo", 5);
+    String   *foo_boffo     = (String*)SSTR_WRAP_STR("foo/boffo", 9);
+    String   *test_dir      = (String*)SSTR_WRAP_STR("_fsdir_test", 11);
     FSFolder *folder        = FSFolder_new(test_dir);
     bool      saw_foo       = false;
     bool      saw_boffo     = false;
@@ -68,12 +68,12 @@ test_all(TestBatchRunner *runner) {
     FSDirHandle *dh = FSDH_open(test_dir);
     while (FSDH_Next(dh)) {
         count++;
-        CharBuf *entry = FSDH_Get_Entry(dh);
-        if (CB_Equals(entry, (Obj*)foo)) {
+        String *entry = FSDH_Get_Entry(dh);
+        if (Str_Equals(entry, (Obj*)foo)) {
             saw_foo = true;
             foo_was_dir = FSDH_Entry_Is_Dir(dh);
         }
-        else if (CB_Equals(entry, (Obj*)boffo)) {
+        else if (Str_Equals(entry, (Obj*)boffo)) {
             saw_boffo = true;
             boffo_was_dir = FSDH_Entry_Is_Dir(dh);
         }

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/Store/TestFSFileHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSFileHandle.c b/core/Lucy/Test/Store/TestFSFileHandle.c
index c43d555..d9faa32 100644
--- a/core/Lucy/Test/Store/TestFSFileHandle.c
+++ b/core/Lucy/Test/Store/TestFSFileHandle.c
@@ -42,9 +42,9 @@ static void
 test_open(TestBatchRunner *runner) {
 
     FSFileHandle *fh;
-    CharBuf *test_filename = (CharBuf*)SSTR_WRAP_STR("_fstest", 7);
+    String *test_filename = (String*)SSTR_WRAP_STR("_fstest", 7);
 
-    remove((char*)CB_Get_Ptr8(test_filename));
+    remove((char*)Str_Get_Ptr8(test_filename));
 
     Err_set_error(NULL);
     fh = FSFH_open(test_filename, FH_READ_ONLY);
@@ -98,7 +98,7 @@ test_open(TestBatchRunner *runner) {
               "open() read only -- no errors");
     DECREF(fh);
 
-    remove((char*)CB_Get_Ptr8(test_filename));
+    remove((char*)Str_Get_Ptr8(test_filename));
 }
 
 static void
@@ -108,9 +108,9 @@ test_Read_Write(TestBatchRunner *runner) {
     const char *bar = "bar";
     char buffer[12];
     char *buf = buffer;
-    CharBuf *test_filename = (CharBuf*)SSTR_WRAP_STR("_fstest", 7);
+    String *test_filename = (String*)SSTR_WRAP_STR("_fstest", 7);
 
-    remove((char*)CB_Get_Ptr8(test_filename));
+    remove((char*)Str_Get_Ptr8(test_filename));
     fh = FSFH_open(test_filename,
                    FH_CREATE | FH_WRITE_ONLY | FH_EXCLUSIVE);
 
@@ -157,15 +157,15 @@ test_Read_Write(TestBatchRunner *runner) {
               "Writing to a read-only handle sets error");
 
     DECREF(fh);
-    remove((char*)CB_Get_Ptr8(test_filename));
+    remove((char*)Str_Get_Ptr8(test_filename));
 }
 
 static void
 test_Close(TestBatchRunner *runner) {
-    CharBuf *test_filename = (CharBuf*)SSTR_WRAP_STR("_fstest", 7);
+    String *test_filename = (String*)SSTR_WRAP_STR("_fstest", 7);
     FSFileHandle *fh;
 
-    remove((char*)CB_Get_Ptr8(test_filename));
+    remove((char*)Str_Get_Ptr8(test_filename));
     fh = FSFH_open(test_filename,
                    FH_CREATE | FH_WRITE_ONLY | FH_EXCLUSIVE);
     TEST_TRUE(runner, FSFH_Close(fh), "Close returns true for write-only");
@@ -173,7 +173,7 @@ test_Close(TestBatchRunner *runner) {
 
     // Simulate an OS error when closing the file descriptor.  This
     // approximates what would happen if, say, we run out of disk space.
-    remove((char*)CB_Get_Ptr8(test_filename));
+    remove((char*)Str_Get_Ptr8(test_filename));
     fh = FSFH_open(test_filename,
                    FH_CREATE | FH_WRITE_ONLY | FH_EXCLUSIVE);
 #ifdef _MSC_VER
@@ -195,18 +195,18 @@ test_Close(TestBatchRunner *runner) {
     TEST_TRUE(runner, FSFH_Close(fh), "Close returns true for read-only");
 
     DECREF(fh);
-    remove((char*)CB_Get_Ptr8(test_filename));
+    remove((char*)Str_Get_Ptr8(test_filename));
 }
 
 static void
 test_Window(TestBatchRunner *runner) {
-    CharBuf *test_filename = (CharBuf*)SSTR_WRAP_STR("_fstest", 7);
+    String *test_filename = (String*)SSTR_WRAP_STR("_fstest", 7);
     FSFileHandle *fh;
     FileWindow *window = FileWindow_new();
     FileWindowIVARS *const window_ivars = FileWindow_IVARS(window);
     uint32_t i;
 
-    remove((char*)CB_Get_Ptr8(test_filename));
+    remove((char*)Str_Get_Ptr8(test_filename));
     fh = FSFH_open(test_filename,
                    FH_CREATE | FH_WRITE_ONLY | FH_EXCLUSIVE);
     for (i = 0; i < 1024; i++) {
@@ -245,7 +245,7 @@ test_Window(TestBatchRunner *runner) {
 
     DECREF(window);
     DECREF(fh);
-    remove((char*)CB_Get_Ptr8(test_filename));
+    remove((char*)Str_Get_Ptr8(test_filename));
 }
 
 void

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/Store/TestFSFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFSFolder.c b/core/Lucy/Test/Store/TestFSFolder.c
index 6ad6b51..6c66f10 100644
--- a/core/Lucy/Test/Store/TestFSFolder.c
+++ b/core/Lucy/Test/Store/TestFSFolder.c
@@ -57,7 +57,7 @@ TestFSFolder_new() {
 static Folder*
 S_set_up() {
     rmdir("_fstest");
-    CharBuf  *test_dir = (CharBuf*)SSTR_WRAP_STR("_fstest", 7);
+    String   *test_dir = (String*)SSTR_WRAP_STR("_fstest", 7);
     FSFolder *folder = FSFolder_new(test_dir);
     FSFolder_Initialize(folder);
     if (!FSFolder_Check(folder)) {
@@ -79,7 +79,7 @@ S_tear_down() {
 static void
 test_Initialize_and_Check(TestBatchRunner *runner) {
     rmdir("_fstest");
-    CharBuf  *test_dir = (CharBuf*)SSTR_WRAP_STR("_fstest", 7);
+    String   *test_dir = (String*)SSTR_WRAP_STR("_fstest", 7);
     FSFolder *folder   = FSFolder_new(test_dir);
     TEST_FALSE(runner, FSFolder_Check(folder),
                "Check() returns false when folder dir doesn't exist");
@@ -95,9 +95,9 @@ static void
 test_protect_symlinks(TestBatchRunner *runner) {
 #ifdef ENABLE_SYMLINK_TESTS
     FSFolder *folder    = (FSFolder*)S_set_up();
-    CharBuf  *foo       = (CharBuf*)SSTR_WRAP_STR("foo", 3);
-    CharBuf  *bar       = (CharBuf*)SSTR_WRAP_STR("bar", 3);
-    CharBuf  *foo_boffo = (CharBuf*)SSTR_WRAP_STR("foo/boffo", 9);
+    String   *foo       = (String*)SSTR_WRAP_STR("foo", 3);
+    String   *bar       = (String*)SSTR_WRAP_STR("bar", 3);
+    String   *foo_boffo = (String*)SSTR_WRAP_STR("foo/boffo", 9);
 
     FSFolder_MkDir(folder, foo);
     FSFolder_MkDir(folder, bar);
@@ -118,8 +118,8 @@ test_protect_symlinks(TestBatchRunner *runner) {
         VArray *list = FSFolder_List_R(folder, NULL);
         bool saw_bazooka_boffo = false;
         for (uint32_t i = 0, max = VA_Get_Size(list); i < max; i++) {
-            CharBuf *entry = (CharBuf*)VA_Fetch(list, i);
-            if (CB_Ends_With_Str(entry, "bazooka/boffo", 13)) {
+            String *entry = (String*)VA_Fetch(list, i);
+            if (Str_Ends_With_Str(entry, "bazooka/boffo", 13)) {
                 saw_bazooka_boffo = true;
             }
         }
@@ -152,14 +152,14 @@ void
 test_disallow_updir(TestBatchRunner *runner) {
     FSFolder *outer_folder = (FSFolder*)S_set_up();
 
-    CharBuf *foo = (CharBuf*)SSTR_WRAP_STR("foo", 3);
-    CharBuf *bar = (CharBuf*)SSTR_WRAP_STR("bar", 3);
+    String *foo = (String*)SSTR_WRAP_STR("foo", 3);
+    String *bar = (String*)SSTR_WRAP_STR("bar", 3);
     FSFolder_MkDir(outer_folder, foo);
     FSFolder_MkDir(outer_folder, bar);
 
-    CharBuf *inner_path = (CharBuf*)SSTR_WRAP_STR("_fstest/foo", 11);
+    String *inner_path = (String*)SSTR_WRAP_STR("_fstest/foo", 11);
     FSFolder *foo_folder = FSFolder_new(inner_path);
-    CharBuf *up_bar = (CharBuf*)SSTR_WRAP_STR("../bar", 6);
+    String *up_bar = (String*)SSTR_WRAP_STR("../bar", 6);
     TEST_FALSE(runner, FSFolder_Exists(foo_folder, up_bar),
                "up-dirs are inaccessible.");
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/Store/TestFileHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFileHandle.c b/core/Lucy/Test/Store/TestFileHandle.c
index 862bdb1..3d1e94b 100644
--- a/core/Lucy/Test/Store/TestFileHandle.c
+++ b/core/Lucy/Test/Store/TestFileHandle.c
@@ -40,9 +40,9 @@ static FileHandle*
 S_new_filehandle() {
     StackString *klass = SSTR_WRAP_STR("TestFileHandle", 14);
     FileHandle *fh;
-    VTable *vtable = VTable_fetch_vtable((CharBuf*)klass);
+    VTable *vtable = VTable_fetch_vtable((String*)klass);
     if (!vtable) {
-        vtable = VTable_singleton((CharBuf*)klass, FILEHANDLE);
+        vtable = VTable_singleton((String*)klass, FILEHANDLE);
     }
     VTable_Override(vtable, S_no_op_method, LUCY_FH_Close_OFFSET);
     fh = (FileHandle*)VTable_Make_Obj(vtable);
@@ -56,9 +56,9 @@ TestFH_Run_IMP(TestFileHandle *self, TestBatchRunner *runner) {
     FileHandle    *fh    = S_new_filehandle();
     StackString *foo   = SSTR_WRAP_STR("foo", 3);
 
-    TEST_TRUE(runner, CB_Equals_Str(FH_Get_Path(fh), "", 0), "Get_Path");
-    FH_Set_Path(fh, (CharBuf*)foo);
-    TEST_TRUE(runner, CB_Equals(FH_Get_Path(fh), (Obj*)foo), "Set_Path");
+    TEST_TRUE(runner, Str_Equals_Str(FH_Get_Path(fh), "", 0), "Get_Path");
+    FH_Set_Path(fh, (String*)foo);
+    TEST_TRUE(runner, Str_Equals(FH_Get_Path(fh), (Obj*)foo), "Set_Path");
 
     DECREF(fh);
 }

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/Store/TestFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFolder.c b/core/Lucy/Test/Store/TestFolder.c
index 5268abe..f40d051 100644
--- a/core/Lucy/Test/Store/TestFolder.c
+++ b/core/Lucy/Test/Store/TestFolder.c
@@ -27,17 +27,17 @@
 #include "Lucy/Store/OutStream.h"
 #include "Lucy/Store/RAMFolder.h"
 
-static CharBuf *foo               = NULL;
-static CharBuf *bar               = NULL;
-static CharBuf *baz               = NULL;
-static CharBuf *boffo             = NULL;
-static CharBuf *banana            = NULL;
-static CharBuf *foo_bar           = NULL;
-static CharBuf *foo_bar_baz       = NULL;
-static CharBuf *foo_bar_baz_boffo = NULL;
-static CharBuf *foo_boffo         = NULL;
-static CharBuf *foo_foo           = NULL;
-static CharBuf *nope              = NULL;
+static String *foo               = NULL;
+static String *bar               = NULL;
+static String *baz               = NULL;
+static String *boffo             = NULL;
+static String *banana            = NULL;
+static String *foo_bar           = NULL;
+static String *foo_bar_baz       = NULL;
+static String *foo_bar_baz_boffo = NULL;
+static String *foo_boffo         = NULL;
+static String *foo_foo           = NULL;
+static String *nope              = NULL;
 
 TestFolder*
 TestFolder_new() {
@@ -46,17 +46,17 @@ TestFolder_new() {
 
 static void
 S_init_strings(void) {
-    foo               = CB_newf("foo");
-    bar               = CB_newf("bar");
-    baz               = CB_newf("baz");
-    boffo             = CB_newf("boffo");
-    banana            = CB_newf("banana");
-    foo_bar           = CB_newf("foo/bar");
-    foo_bar_baz       = CB_newf("foo/bar/baz");
-    foo_bar_baz_boffo = CB_newf("foo/bar/baz/boffo");
-    foo_boffo         = CB_newf("foo/boffo");
-    foo_foo           = CB_newf("foo/foo");
-    nope              = CB_newf("nope");
+    foo               = Str_newf("foo");
+    bar               = Str_newf("bar");
+    baz               = Str_newf("baz");
+    boffo             = Str_newf("boffo");
+    banana            = Str_newf("banana");
+    foo_bar           = Str_newf("foo/bar");
+    foo_bar_baz       = Str_newf("foo/bar/baz");
+    foo_bar_baz_boffo = Str_newf("foo/bar/baz/boffo");
+    foo_boffo         = Str_newf("foo/boffo");
+    foo_foo           = Str_newf("foo/foo");
+    nope              = Str_newf("nope");
 }
 
 static void
@@ -105,10 +105,10 @@ test_Exists(TestBatchRunner *runner) {
 static void
 test_Set_Path_and_Get_Path(TestBatchRunner *runner) {
     Folder *folder = (Folder*)RAMFolder_new(foo);
-    TEST_TRUE(runner, CB_Equals(Folder_Get_Path(folder), (Obj*)foo),
+    TEST_TRUE(runner, Str_Equals(Folder_Get_Path(folder), (Obj*)foo),
               "Get_Path");
     Folder_Set_Path(folder, bar);
-    TEST_TRUE(runner, CB_Equals(Folder_Get_Path(folder), (Obj*)bar),
+    TEST_TRUE(runner, Str_Equals(Folder_Get_Path(folder), (Obj*)bar),
               "Set_Path");
     DECREF(folder);
 }
@@ -171,8 +171,8 @@ test_Enclosing_Folder_and_Find_Folder(TestBatchRunner *runner) {
                                 FH_CREATE | FH_WRITE_ONLY);
 
     {
-        Folder *encloser = Folder_Enclosing_Folder(folder, (CharBuf*)nope);
-        Folder *found = Folder_Find_Folder(folder, (CharBuf*)nope);
+        Folder *encloser = Folder_Enclosing_Folder(folder, (String*)nope);
+        Folder *found = Folder_Find_Folder(folder, (String*)nope);
         TEST_TRUE(runner, encloser == folder,
                   "Enclosing_Folder() - non-existent entry yields parent");
         TEST_TRUE(runner, found == NULL,
@@ -185,12 +185,12 @@ test_Enclosing_Folder_and_Find_Folder(TestBatchRunner *runner) {
         TEST_TRUE(runner,
                   encloser
                   && Folder_Is_A(encloser, FOLDER)
-                  && CB_Ends_With(Folder_Get_Path(encloser), foo),
+                  && Str_Ends_With(Folder_Get_Path(encloser), foo),
                   "Enclosing_Folder() - find one directory down");
         TEST_TRUE(runner,
                   found
                   && Folder_Is_A(found, FOLDER)
-                  && CB_Ends_With(Folder_Get_Path(found), bar),
+                  && Str_Ends_With(Folder_Get_Path(found), bar),
                   "Find_Folder() - 'foo/bar'");
     }
 
@@ -200,12 +200,12 @@ test_Enclosing_Folder_and_Find_Folder(TestBatchRunner *runner) {
         TEST_TRUE(runner,
                   encloser
                   && Folder_Is_A(encloser, FOLDER)
-                  && CB_Ends_With(Folder_Get_Path(encloser), bar),
+                  && Str_Ends_With(Folder_Get_Path(encloser), bar),
                   "Find two directories down");
         TEST_TRUE(runner,
                   found
                   && Folder_Is_A(found, FOLDER)
-                  && CB_Ends_With(Folder_Get_Path(found), baz),
+                  && Str_Ends_With(Folder_Get_Path(found), baz),
                   "Find_Folder() - 'foo/bar/baz'");
     }
 
@@ -216,7 +216,7 @@ test_Enclosing_Folder_and_Find_Folder(TestBatchRunner *runner) {
         TEST_TRUE(runner,
                   encloser
                   && Folder_Is_A(encloser, FOLDER)
-                  && CB_Ends_With(Folder_Get_Path(encloser), baz),
+                  && Str_Ends_With(Folder_Get_Path(encloser), baz),
                   "Recurse to find a directory containing a real file");
         TEST_TRUE(runner, found == NULL,
                   "Find_Folder() - file instead of folder yields NULL");
@@ -231,7 +231,7 @@ test_List(TestBatchRunner *runner) {
     Folder     *folder = (Folder*)RAMFolder_new(NULL);
     FileHandle *fh;
     VArray     *list;
-    CharBuf    *elem;
+    String     *elem;
 
     Folder_MkDir(folder, foo);
     Folder_MkDir(folder, foo_bar);
@@ -244,20 +244,20 @@ test_List(TestBatchRunner *runner) {
     list = Folder_List(folder, NULL);
     VA_Sort(list, NULL, NULL);
     TEST_INT_EQ(runner, VA_Get_Size(list), 3, "List");
-    elem = (CharBuf*)DOWNCAST(VA_Fetch(list, 0), CHARBUF);
-    TEST_TRUE(runner, elem && CB_Equals(elem, (Obj*)banana),
+    elem = (String*)DOWNCAST(VA_Fetch(list, 0), STRING);
+    TEST_TRUE(runner, elem && Str_Equals(elem, (Obj*)banana),
               "List first file");
-    elem = (CharBuf*)DOWNCAST(VA_Fetch(list, 1), CHARBUF);
-    TEST_TRUE(runner, elem && CB_Equals(elem, (Obj*)boffo),
+    elem = (String*)DOWNCAST(VA_Fetch(list, 1), STRING);
+    TEST_TRUE(runner, elem && Str_Equals(elem, (Obj*)boffo),
               "List second file");
-    elem = (CharBuf*)DOWNCAST(VA_Fetch(list, 2), CHARBUF);
-    TEST_TRUE(runner, elem && CB_Equals(elem, (Obj*)foo), "List dir");
+    elem = (String*)DOWNCAST(VA_Fetch(list, 2), STRING);
+    TEST_TRUE(runner, elem && Str_Equals(elem, (Obj*)foo), "List dir");
     DECREF(list);
 
     list = Folder_List(folder, foo_bar);
     TEST_INT_EQ(runner, VA_Get_Size(list), 1, "List subdirectory contents");
-    elem = (CharBuf*)DOWNCAST(VA_Fetch(list, 0), CHARBUF);
-    TEST_TRUE(runner, elem && CB_Equals(elem, (Obj*)baz),
+    elem = (String*)DOWNCAST(VA_Fetch(list, 0), STRING);
+    TEST_TRUE(runner, elem && Str_Equals(elem, (Obj*)baz),
               "Just the filename");
     DECREF(list);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/Store/TestFolderCommon.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestFolderCommon.c b/core/Lucy/Test/Store/TestFolderCommon.c
index db67025..f137544 100644
--- a/core/Lucy/Test/Store/TestFolderCommon.c
+++ b/core/Lucy/Test/Store/TestFolderCommon.c
@@ -29,33 +29,33 @@
 #define set_up_t    LUCY_TestFolderCommon_Set_Up_t
 #define tear_down_t LUCY_TestFolderCommon_Tear_Down_t
 
-static CharBuf *foo           = NULL;
-static CharBuf *bar           = NULL;
-static CharBuf *baz           = NULL;
-static CharBuf *boffo         = NULL;
-static CharBuf *banana        = NULL;
-static CharBuf *foo_bar       = NULL;
-static CharBuf *foo_bar_baz   = NULL;
-static CharBuf *foo_bar_boffo = NULL;
-static CharBuf *foo_boffo     = NULL;
-static CharBuf *foo_foo       = NULL;
-static CharBuf *nope          = NULL;
-static CharBuf *nope_nyet     = NULL;
+static String *foo           = NULL;
+static String *bar           = NULL;
+static String *baz           = NULL;
+static String *boffo         = NULL;
+static String *banana        = NULL;
+static String *foo_bar       = NULL;
+static String *foo_bar_baz   = NULL;
+static String *foo_bar_boffo = NULL;
+static String *foo_boffo     = NULL;
+static String *foo_foo       = NULL;
+static String *nope          = NULL;
+static String *nope_nyet     = NULL;
 
 static void
 S_init_strings(void) {
-    foo           = CB_newf("foo");
-    bar           = CB_newf("bar");
-    baz           = CB_newf("baz");
-    boffo         = CB_newf("boffo");
-    banana        = CB_newf("banana");
-    foo_bar       = CB_newf("foo/bar");
-    foo_bar_baz   = CB_newf("foo/bar/baz");
-    foo_bar_boffo = CB_newf("foo/bar/boffo");
-    foo_boffo     = CB_newf("foo/boffo");
-    foo_foo       = CB_newf("foo/foo");
-    nope          = CB_newf("nope");
-    nope_nyet     = CB_newf("nope/nyet");
+    foo           = Str_newf("foo");
+    bar           = Str_newf("bar");
+    baz           = Str_newf("baz");
+    boffo         = Str_newf("boffo");
+    banana        = Str_newf("banana");
+    foo_bar       = Str_newf("foo/bar");
+    foo_bar_baz   = Str_newf("foo/bar/baz");
+    foo_bar_boffo = Str_newf("foo/bar/boffo");
+    foo_boffo     = Str_newf("foo/boffo");
+    foo_foo       = Str_newf("foo/foo");
+    nope          = Str_newf("nope");
+    nope_nyet     = Str_newf("nope/nyet");
 }
 
 static void
@@ -138,7 +138,7 @@ test_Local_Find_Folder(TestBatchRunner *runner, set_up_t set_up,
     TEST_TRUE(runner, local == NULL, "Non-existent entry yields NULL");
 
     StackString *empty = SStr_BLANK();
-    local = Folder_Local_Find_Folder(folder, (CharBuf*)empty);
+    local = Folder_Local_Find_Folder(folder, (String*)empty);
     TEST_TRUE(runner, local == NULL, "Empty string yields NULL");
 
     local = Folder_Local_Find_Folder(folder, foo_bar);
@@ -157,7 +157,7 @@ test_Local_Find_Folder(TestBatchRunner *runner, set_up_t set_up,
     TEST_TRUE(runner,
               local
               && Folder_Is_A(local, FOLDER)
-              && CB_Ends_With(Folder_Get_Path(local), foo),
+              && Str_Ends_With(Folder_Get_Path(local), foo),
               "Find local directory");
 
     Folder_Delete(folder, foo_bar);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/Store/TestInStream.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestInStream.c b/core/Lucy/Test/Store/TestInStream.c
index c530e21..1b7a941 100644
--- a/core/Lucy/Test/Store/TestInStream.c
+++ b/core/Lucy/Test/Store/TestInStream.c
@@ -110,22 +110,22 @@ test_Clone_and_Reopen(TestBatchRunner *runner) {
     }
     OutStream_Close(outstream);
 
-    fh = RAMFH_open((CharBuf*)foo, FH_READ_ONLY, file);
+    fh = RAMFH_open((String*)foo, FH_READ_ONLY, file);
     instream = InStream_open((Obj*)fh);
     InStream_Seek(instream, 1);
-    TEST_TRUE(runner, CB_Equals(InStream_Get_Filename(instream), (Obj*)foo),
+    TEST_TRUE(runner, Str_Equals(InStream_Get_Filename(instream), (Obj*)foo),
               "Get_Filename");
 
     clone    = InStream_Clone(instream);
-    TEST_TRUE(runner, CB_Equals(InStream_Get_Filename(clone), (Obj*)foo),
+    TEST_TRUE(runner, Str_Equals(InStream_Get_Filename(clone), (Obj*)foo),
               "Clones have same filename");
     TEST_TRUE(runner, InStream_Length(instream) == InStream_Length(clone),
               "Clones have same length");
     TEST_TRUE(runner, InStream_Read_U8(instream) == InStream_Read_U8(clone),
               "Clones start at same file position");
 
-    reopened = InStream_Reopen(instream, (CharBuf*)bar, 25, 1);
-    TEST_TRUE(runner, CB_Equals(InStream_Get_Filename(reopened), (Obj*)bar),
+    reopened = InStream_Reopen(instream, (String*)bar, 25, 1);
+    TEST_TRUE(runner, Str_Equals(InStream_Get_Filename(reopened), (Obj*)bar),
               "Reopened InStreams take new filename");
     TEST_TRUE(runner, InStream_Read_U8(reopened) == 'z',
               "Reopened stream starts at supplied offset");

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/Store/TestRAMDirHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMDirHandle.c b/core/Lucy/Test/Store/TestRAMDirHandle.c
index 41de753..d584630 100644
--- a/core/Lucy/Test/Store/TestRAMDirHandle.c
+++ b/core/Lucy/Test/Store/TestRAMDirHandle.c
@@ -33,9 +33,9 @@ TestRAMDH_new() {
 static void
 test_all(TestBatchRunner *runner) {
     RAMFolder *folder        = RAMFolder_new(NULL);
-    CharBuf   *foo           = (CharBuf*)SSTR_WRAP_STR("foo", 3);
-    CharBuf   *boffo         = (CharBuf*)SSTR_WRAP_STR("boffo", 5);
-    CharBuf   *foo_boffo     = (CharBuf*)SSTR_WRAP_STR("foo/boffo", 9);
+    String    *foo           = (String*)SSTR_WRAP_STR("foo", 3);
+    String    *boffo         = (String*)SSTR_WRAP_STR("boffo", 5);
+    String    *foo_boffo     = (String*)SSTR_WRAP_STR("foo/boffo", 9);
     bool       saw_foo       = false;
     bool       saw_boffo     = false;
     bool       foo_was_dir   = false;
@@ -54,12 +54,12 @@ test_all(TestBatchRunner *runner) {
     RAMDirHandle *dh = RAMDH_new(folder);
     while (RAMDH_Next(dh)) {
         count++;
-        CharBuf *entry = RAMDH_Get_Entry(dh);
-        if (CB_Equals(entry, (Obj*)foo)) {
+        String *entry = RAMDH_Get_Entry(dh);
+        if (Str_Equals(entry, (Obj*)foo)) {
             saw_foo = true;
             foo_was_dir = RAMDH_Entry_Is_Dir(dh);
         }
-        else if (CB_Equals(entry, (Obj*)boffo)) {
+        else if (Str_Equals(entry, (Obj*)boffo)) {
             saw_boffo = true;
             boffo_was_dir = RAMDH_Entry_Is_Dir(dh);
         }

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/Store/TestRAMFileHandle.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMFileHandle.c b/core/Lucy/Test/Store/TestRAMFileHandle.c
index 36180c6..c8a57b9 100644
--- a/core/Lucy/Test/Store/TestRAMFileHandle.c
+++ b/core/Lucy/Test/Store/TestRAMFileHandle.c
@@ -55,7 +55,7 @@ test_Read_Write(TestBatchRunner *runner) {
     char buffer[12];
     char *buf = buffer;
 
-    TEST_TRUE(runner, CB_Equals_Str(RAMFH_Get_Path(fh), "", 0),
+    TEST_TRUE(runner, Str_Equals_Str(RAMFH_Get_Path(fh), "", 0),
               "NULL arg as filepath yields empty string");
 
     TEST_TRUE(runner, RAMFH_Write(fh, foo, 3), "Write returns success");

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/Store/TestRAMFolder.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Store/TestRAMFolder.c b/core/Lucy/Test/Store/TestRAMFolder.c
index eaf52a2..e712697 100644
--- a/core/Lucy/Test/Store/TestRAMFolder.c
+++ b/core/Lucy/Test/Store/TestRAMFolder.c
@@ -26,18 +26,18 @@
 #include "Lucy/Store/RAMDirHandle.h"
 #include "Lucy/Store/RAMFileHandle.h"
 
-static CharBuf *foo           = NULL;
-static CharBuf *bar           = NULL;
-static CharBuf *baz           = NULL;
-static CharBuf *boffo         = NULL;
-static CharBuf *banana        = NULL;
-static CharBuf *foo_bar       = NULL;
-static CharBuf *foo_bar_baz   = NULL;
-static CharBuf *foo_bar_boffo = NULL;
-static CharBuf *foo_boffo     = NULL;
-static CharBuf *foo_foo       = NULL;
-static CharBuf *nope          = NULL;
-static CharBuf *nope_nyet     = NULL;
+static String *foo           = NULL;
+static String *bar           = NULL;
+static String *baz           = NULL;
+static String *boffo         = NULL;
+static String *banana        = NULL;
+static String *foo_bar       = NULL;
+static String *foo_bar_baz   = NULL;
+static String *foo_bar_boffo = NULL;
+static String *foo_boffo     = NULL;
+static String *foo_foo       = NULL;
+static String *nope          = NULL;
+static String *nope_nyet     = NULL;
 
 TestRAMFolder*
 TestRAMFolder_new() {
@@ -46,18 +46,18 @@ TestRAMFolder_new() {
 
 static void
 S_init_strings(void) {
-    foo           = CB_newf("foo");
-    bar           = CB_newf("bar");
-    baz           = CB_newf("baz");
-    boffo         = CB_newf("boffo");
-    banana        = CB_newf("banana");
-    foo_bar       = CB_newf("foo/bar");
-    foo_bar_baz   = CB_newf("foo/bar/baz");
-    foo_bar_boffo = CB_newf("foo/bar/boffo");
-    foo_boffo     = CB_newf("foo/boffo");
-    foo_foo       = CB_newf("foo/foo");
-    nope          = CB_newf("nope");
-    nope_nyet     = CB_newf("nope/nyet");
+    foo           = Str_newf("foo");
+    bar           = Str_newf("bar");
+    baz           = Str_newf("baz");
+    boffo         = Str_newf("boffo");
+    banana        = Str_newf("banana");
+    foo_bar       = Str_newf("foo/bar");
+    foo_bar_baz   = Str_newf("foo/bar/baz");
+    foo_bar_boffo = Str_newf("foo/bar/boffo");
+    foo_boffo     = Str_newf("foo/boffo");
+    foo_foo       = Str_newf("foo/foo");
+    nope          = Str_newf("nope");
+    nope_nyet     = Str_newf("nope/nyet");
 }
 
 static void
@@ -140,7 +140,7 @@ test_Local_Find_Folder(TestBatchRunner *runner) {
     TEST_TRUE(runner, local == NULL, "Non-existent entry yields NULL");
 
     StackString *empty = SStr_BLANK();
-    local = (RAMFolder*)RAMFolder_Local_Find_Folder(folder, (CharBuf*)empty);
+    local = (RAMFolder*)RAMFolder_Local_Find_Folder(folder, (String*)empty);
     TEST_TRUE(runner, local == NULL, "Empty string yields NULL");
 
     local = (RAMFolder*)RAMFolder_Local_Find_Folder(folder, foo_bar);
@@ -159,7 +159,7 @@ test_Local_Find_Folder(TestBatchRunner *runner) {
     TEST_TRUE(runner,
               local
               && RAMFolder_Is_A(local, RAMFOLDER)
-              && CB_Equals_Str(RAMFolder_Get_Path(local), "foo", 3),
+              && Str_Equals_Str(RAMFolder_Get_Path(local), "foo", 3),
               "Find local directory");
 
     DECREF(folder);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/TestSchema.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/TestSchema.c b/core/Lucy/Test/TestSchema.c
index 1c372e0..ec40329 100644
--- a/core/Lucy/Test/TestSchema.c
+++ b/core/Lucy/Test/TestSchema.c
@@ -42,7 +42,7 @@ TestSchema_init(TestSchema *self, bool use_alt_arch) {
 
     Schema_init((Schema*)self);
     FullTextType_Set_Highlightable(type, true);
-    CharBuf *content = (CharBuf*)SSTR_WRAP_STR("content", 7);
+    String *content = (String*)SSTR_WRAP_STR("content", 7);
     TestSchema_Spec_Field(self, content, (FieldType*)type);
     DECREF(type);
     DECREF(tokenizer);
@@ -70,7 +70,7 @@ test_Equals(TestBatchRunner *runner) {
     TestSchema *schema = TestSchema_new(false);
     TestSchema *arch_differs = TestSchema_new(true);
     TestSchema *spec_differs = TestSchema_new(false);
-    CharBuf    *content      = (CharBuf*)SSTR_WRAP_STR("content", 7);
+    String     *content      = (String*)SSTR_WRAP_STR("content", 7);
     FullTextType *type = (FullTextType*)TestSchema_Fetch_Type(spec_differs,
                                                               content);
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/TestUtils.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/TestUtils.c b/core/Lucy/Test/TestUtils.c
index fc64a68..f2f1adf 100644
--- a/core/Lucy/Test/TestUtils.c
+++ b/core/Lucy/Test/TestUtils.c
@@ -76,14 +76,14 @@ TestUtils_make_poly_query(uint32_t boolop, ...) {
 
 TermQuery*
 TestUtils_make_term_query(const char *field, const char *term) {
-    CharBuf *field_cb = (CharBuf*)SSTR_WRAP_STR(field, strlen(field));
-    CharBuf *term_cb  = (CharBuf*)SSTR_WRAP_STR(term, strlen(term));
-    return TermQuery_new((CharBuf*)field_cb, (Obj*)term_cb);
+    String *field_cb = (String*)SSTR_WRAP_STR(field, strlen(field));
+    String *term_cb  = (String*)SSTR_WRAP_STR(term, strlen(term));
+    return TermQuery_new((String*)field_cb, (Obj*)term_cb);
 }
 
 PhraseQuery*
 TestUtils_make_phrase_query(const char *field, ...) {
-    CharBuf *field_cb = (CharBuf*)SSTR_WRAP_STR(field, strlen(field));
+    String *field_cb = (String*)SSTR_WRAP_STR(field, strlen(field));
     va_list args;
     VArray *terms = VA_new(0);
     PhraseQuery *query;
@@ -102,9 +102,9 @@ TestUtils_make_phrase_query(const char *field, ...) {
 
 LeafQuery*
 TestUtils_make_leaf_query(const char *field, const char *term) {
-    CharBuf *term_cb  = (CharBuf*)SSTR_WRAP_STR(term, strlen(term));
-    CharBuf *field_cb = field
-                        ? (CharBuf*)SSTR_WRAP_STR(field, strlen(field))
+    String *term_cb  = (String*)SSTR_WRAP_STR(term, strlen(term));
+    String *field_cb = field
+                        ? (String*)SSTR_WRAP_STR(field, strlen(field))
                         : NULL;
     return LeafQuery_new(field_cb, term_cb);
 }
@@ -120,26 +120,26 @@ RangeQuery*
 TestUtils_make_range_query(const char *field, const char *lower_term,
                            const char *upper_term, bool include_lower,
                            bool include_upper) {
-    CharBuf *f     = (CharBuf*)SSTR_WRAP_STR(field, strlen(field));
-    CharBuf *lterm = (CharBuf*)SSTR_WRAP_STR(lower_term, strlen(lower_term));
-    CharBuf *uterm = (CharBuf*)SSTR_WRAP_STR(upper_term, strlen(upper_term));
+    String *f     = (String*)SSTR_WRAP_STR(field, strlen(field));
+    String *lterm = (String*)SSTR_WRAP_STR(lower_term, strlen(lower_term));
+    String *uterm = (String*)SSTR_WRAP_STR(upper_term, strlen(upper_term));
     return RangeQuery_new(f, (Obj*)lterm, (Obj*)uterm, include_lower,
                           include_upper);
 }
 
 void
 TestUtils_test_analyzer(TestBatchRunner *runner, Analyzer *analyzer,
-                        CharBuf *source, VArray *expected,
+                        String *source, VArray *expected,
                         const char *message) {
-    Token *seed = Token_new((char*)CB_Get_Ptr8(source), CB_Get_Size(source),
+    Token *seed = Token_new((char*)Str_Get_Ptr8(source), Str_Get_Size(source),
                             0, 0, 1.0f, 1);
     Inversion *starter = Inversion_new(seed);
     Inversion *transformed = Analyzer_Transform(analyzer, starter);
     VArray *got = VA_new(1);
     Token *token;
     while (NULL != (token = Inversion_Next(transformed))) {
-        CharBuf *token_text
-            = CB_new_from_utf8(Token_Get_Text(token), Token_Get_Len(token));
+        String *token_text
+            = Str_new_from_utf8(Token_Get_Text(token), Token_Get_Len(token));
         VA_Push(got, (Obj*)token_text);
     }
     TEST_TRUE(runner, VA_Equals(expected, (Obj*)got),
@@ -149,8 +149,8 @@ TestUtils_test_analyzer(TestBatchRunner *runner, Analyzer *analyzer,
     transformed = Analyzer_Transform_Text(analyzer, source);
     VA_Clear(got);
     while (NULL != (token = Inversion_Next(transformed))) {
-        CharBuf *token_text
-            = CB_new_from_utf8(Token_Get_Text(token), Token_Get_Len(token));
+        String *token_text
+            = Str_new_from_utf8(Token_Get_Text(token), Token_Get_Len(token));
         VA_Push(got, (Obj*)token_text);
     }
     TEST_TRUE(runner, VA_Equals(expected, (Obj*)got),
@@ -171,7 +171,7 @@ TestUtils_modules_folder() {
     static const char *const paths[] = { "modules", "../modules" };
 
     for (int i = 0; i < sizeof(paths) / sizeof(char*); i++) {
-        CharBuf *path = CB_newf(paths[i]);
+        String *path = Str_newf(paths[i]);
         FSFolder *modules_folder = FSFolder_new(path);
         DECREF(path);
         if (FSFolder_Check(modules_folder)) {

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/TestUtils.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/TestUtils.cfh b/core/Lucy/Test/TestUtils.cfh
index bac562d..68c0d5f 100644
--- a/core/Lucy/Test/TestUtils.cfh
+++ b/core/Lucy/Test/TestUtils.cfh
@@ -18,7 +18,7 @@ parcel TestLucy;
 
 inert class Lucy::Test::TestUtils  {
 
-    /** Return a VArray of CharBufs, each representing the content for a
+    /** Return a VArray of Strings, each representing the content for a
      * document in the shared collection.
      */
     inert incremented VArray*
@@ -62,7 +62,7 @@ inert class Lucy::Test::TestUtils  {
     /** Verify an Analyzer's transform, transform_text, and split methods.
      */
     inert void
-    test_analyzer(TestBatchRunner *runner, Analyzer *analyzer, CharBuf *source,
+    test_analyzer(TestBatchRunner *runner, Analyzer *analyzer, String *source,
                   VArray *expected, const char *message);
 
     /** Return the "modules" folder.

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/Util/TestFreezer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestFreezer.c b/core/Lucy/Test/Util/TestFreezer.c
index 15e02b5..4b4ffd6 100644
--- a/core/Lucy/Test/Util/TestFreezer.c
+++ b/core/Lucy/Test/Util/TestFreezer.c
@@ -78,9 +78,9 @@ test_bytebuf(TestBatchRunner *runner) {
 
 static void
 test_charbuf(TestBatchRunner *runner) {
-    CharBuf *wanted = TestUtils_get_cb("foo");
-    CharBuf *got    = (CharBuf*)S_freeze_thaw((Obj*)wanted);
-    TEST_TRUE(runner, got && CB_Equals(wanted, (Obj*)got),
+    String *wanted = TestUtils_get_cb("foo");
+    String *got    = (String*)S_freeze_thaw((Obj*)wanted);
+    TEST_TRUE(runner, got && Str_Equals(wanted, (Obj*)got),
               "Round trip through FREEZE/THAW");
     DECREF(got);
     DECREF(wanted);
@@ -91,7 +91,7 @@ test_hash(TestBatchRunner *runner) {
     Hash  *wanted = Hash_new(0);
 
     for (uint32_t i = 0; i < 10; i++) {
-        CharBuf *cb = TestUtils_random_string(rand() % 1200);
+        String *cb = TestUtils_random_string(rand() % 1200);
         Integer32 *num = Int32_new(i);
         Hash_Store(wanted, (Obj*)cb, (Obj*)num);
         Hash_Store(wanted, (Obj*)num, (Obj*)cb);
@@ -150,8 +150,8 @@ test_num(TestBatchRunner *runner) {
 static void
 test_varray(TestBatchRunner *runner) {
     VArray *array = VA_new(0);
-    VA_Store(array, 1, (Obj*)CB_newf("foo"));
-    VA_Store(array, 3, (Obj*)CB_newf("bar"));
+    VA_Store(array, 1, (Obj*)Str_newf("foo"));
+    VA_Store(array, 3, (Obj*)Str_newf("bar"));
 
     {
         Obj *got = S_freeze_thaw((Obj*)array);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/Util/TestIndexFileNames.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestIndexFileNames.c b/core/Lucy/Test/Util/TestIndexFileNames.c
index 8003026..8dbbb7a 100644
--- a/core/Lucy/Test/Util/TestIndexFileNames.c
+++ b/core/Lucy/Test/Util/TestIndexFileNames.c
@@ -32,28 +32,28 @@ test_local_part(TestBatchRunner *runner) {
     StackString *source = SStr_BLANK();
     StackString *got    = SStr_BLANK();
 
-    got = IxFileNames_local_part((CharBuf*)source, got);
+    got = IxFileNames_local_part((String*)source, got);
     TEST_TRUE(runner, SStr_Equals(got, (Obj*)source), "simple name");
 
     SStr_Assign_Str(source, "foo.txt", 7);
-    got = IxFileNames_local_part((CharBuf*)source, got);
+    got = IxFileNames_local_part((String*)source, got);
     TEST_TRUE(runner, SStr_Equals(got, (Obj*)source), "name with extension");
 
     SStr_Assign_Str(source, "/foo", 4);
-    got = IxFileNames_local_part((CharBuf*)source, got);
+    got = IxFileNames_local_part((String*)source, got);
     TEST_TRUE(runner, SStr_Equals_Str(got, "foo", 3), "strip leading slash");
 
     SStr_Assign_Str(source, "/foo/", 5);
-    got = IxFileNames_local_part((CharBuf*)source, got);
+    got = IxFileNames_local_part((String*)source, got);
     TEST_TRUE(runner, SStr_Equals_Str(got, "foo", 3), "strip trailing slash");
 
     SStr_Assign_Str(source, "foo/bar\\ ", 9);
-    got = IxFileNames_local_part((CharBuf*)source, got);
+    got = IxFileNames_local_part((String*)source, got);
     TEST_TRUE(runner, SStr_Equals_Str(got, "bar\\ ", 5),
               "Include garbage like backslashes and spaces");
 
     SStr_Assign_Str(source, "foo/bar/baz.txt", 15);
-    got = IxFileNames_local_part((CharBuf*)source, got);
+    got = IxFileNames_local_part((String*)source, got);
     TEST_TRUE(runner, SStr_Equals_Str(got, "baz.txt", 7), "find last component");
 }
 
@@ -62,19 +62,19 @@ test_extract_gen(TestBatchRunner *runner) {
     StackString *source = SSTR_WRAP_STR("", 0);
 
     SStr_Assign_Str(source, "seg_9", 5);
-    TEST_TRUE(runner, IxFileNames_extract_gen((CharBuf*)source) == 9,
+    TEST_TRUE(runner, IxFileNames_extract_gen((String*)source) == 9,
               "extract_gen");
 
     SStr_Assign_Str(source, "seg_9/", 6);
-    TEST_TRUE(runner, IxFileNames_extract_gen((CharBuf*)source) == 9,
+    TEST_TRUE(runner, IxFileNames_extract_gen((String*)source) == 9,
               "deal with trailing slash");
 
     SStr_Assign_Str(source, "seg_9_8", 7);
-    TEST_TRUE(runner, IxFileNames_extract_gen((CharBuf*)source) == 9,
+    TEST_TRUE(runner, IxFileNames_extract_gen((String*)source) == 9,
               "Only go past first underscore");
 
     SStr_Assign_Str(source, "snapshot_5.json", 15);
-    TEST_TRUE(runner, IxFileNames_extract_gen((CharBuf*)source) == 5,
+    TEST_TRUE(runner, IxFileNames_extract_gen((String*)source) == 5,
               "Deal with file suffix");
 }
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Test/Util/TestJson.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Test/Util/TestJson.c b/core/Lucy/Test/Util/TestJson.c
index f36361e..b8efba7 100644
--- a/core/Lucy/Test/Util/TestJson.c
+++ b/core/Lucy/Test/Util/TestJson.c
@@ -31,19 +31,19 @@ TestJson_new() {
 }
 
 // Create a test data structure including at least one each of Hash, VArray,
-// and CharBuf.
+// and String.
 static Obj*
 S_make_dump() {
     Hash *dump = Hash_new(0);
-    Hash_Store_Str(dump, "foo", 3, (Obj*)CB_newf("foo"));
+    Hash_Store_Str(dump, "foo", 3, (Obj*)Str_newf("foo"));
     Hash_Store_Str(dump, "stuff", 5, (Obj*)VA_new(0));
     return (Obj*)dump;
 }
 
 static void
 test_tolerance(TestBatchRunner *runner) {
-    CharBuf *foo = CB_newf("foo");
-    CharBuf *not_json = Json_to_json((Obj*)foo);
+    String *foo = Str_newf("foo");
+    String *not_json = Json_to_json((Obj*)foo);
     TEST_TRUE(runner, not_json == NULL,
               "to_json returns NULL when fed invalid data type");
     TEST_TRUE(runner, Err_get_error() != NULL,
@@ -115,18 +115,18 @@ static const char* quote_escapes_json[] = {
 static void
 test_escapes(TestBatchRunner *runner) {
     for (int i = 0; control_escapes[i] != NULL; i++) {
-        CharBuf *string = CB_new(1);
-        CB_Cat_Char(string, i);
+        String *string = Str_new(1);
+        Str_Cat_Char(string, i);
         const char *escaped = control_escapes[i];
-        CharBuf    *json    = Json_to_json((Obj*)string);
-        CharBuf    *decoded = (CharBuf*)Json_from_json(json);
+        String     *json    = Json_to_json((Obj*)string);
+        String     *decoded = (String*)Json_from_json(json);
 
-        CharBuf *json_wanted = CB_newf("\"%s\"", escaped);
-        CB_Trim(json);
-        TEST_TRUE(runner, json != NULL && CB_Equals(json_wanted, (Obj*)json),
+        String *json_wanted = Str_newf("\"%s\"", escaped);
+        Str_Trim(json);
+        TEST_TRUE(runner, json != NULL && Str_Equals(json_wanted, (Obj*)json),
                   "encode control escape: %s", escaped);
 
-        TEST_TRUE(runner, decoded != NULL && CB_Equals(string, (Obj*)decoded),
+        TEST_TRUE(runner, decoded != NULL && Str_Equals(string, (Obj*)decoded),
                   "decode control escape: %s", escaped);
 
         DECREF(string);
@@ -138,16 +138,16 @@ test_escapes(TestBatchRunner *runner) {
     for (int i = 0; quote_escapes_source[i] != NULL; i++) {
         const char *source  = quote_escapes_source[i];
         const char *escaped = quote_escapes_json[i];
-        CharBuf *string  = CB_new_from_utf8(source, strlen(source));
-        CharBuf *json    = Json_to_json((Obj*)string);
-        CharBuf *decoded = (CharBuf*)Json_from_json(json);
+        String *string  = Str_new_from_utf8(source, strlen(source));
+        String *json    = Json_to_json((Obj*)string);
+        String *decoded = (String*)Json_from_json(json);
 
-        CharBuf *json_wanted = CB_newf("\"%s\"", escaped);
-        CB_Trim(json);
-        TEST_TRUE(runner, json != NULL && CB_Equals(json_wanted, (Obj*)json),
+        String *json_wanted = Str_newf("\"%s\"", escaped);
+        Str_Trim(json);
+        TEST_TRUE(runner, json != NULL && Str_Equals(json_wanted, (Obj*)json),
                   "encode quote/backslash escapes: %s", source);
 
-        TEST_TRUE(runner, decoded != NULL && CB_Equals(string, (Obj*)decoded),
+        TEST_TRUE(runner, decoded != NULL && Str_Equals(string, (Obj*)decoded),
                   "decode quote/backslash escapes: %s", source);
 
         DECREF(string);
@@ -160,15 +160,15 @@ test_escapes(TestBatchRunner *runner) {
 static void
 test_numbers(TestBatchRunner *runner) {
     Integer64 *i64  = Int64_new(33);
-    CharBuf   *json = Json_to_json((Obj*)i64);
-    CB_Trim(json);
-    TEST_TRUE(runner, json && CB_Equals_Str(json, "33", 2), "Integer");
+    String    *json = Json_to_json((Obj*)i64);
+    Str_Trim(json);
+    TEST_TRUE(runner, json && Str_Equals_Str(json, "33", 2), "Integer");
     DECREF(json);
 
     Float64 *f64 = Float64_new(33.33);
     json = Json_to_json((Obj*)f64);
     if (json) {
-        double value = CB_To_F64(json);
+        double value = Str_To_F64(json);
         double diff = 33.33 - value;
         if (diff < 0.0) { diff = 0.0 - diff; }
         TEST_TRUE(runner, diff < 0.0001, "Float");
@@ -185,7 +185,7 @@ test_numbers(TestBatchRunner *runner) {
 static void
 test_to_and_from(TestBatchRunner *runner) {
     Obj *dump = S_make_dump();
-    CharBuf *json = Json_to_json(dump);
+    String *json = Json_to_json(dump);
     Obj *got = Json_from_json(json);
     TEST_TRUE(runner, got != NULL && Obj_Equals(dump, got),
               "Round trip through to_json and from_json");
@@ -199,7 +199,7 @@ test_spew_and_slurp(TestBatchRunner *runner) {
     Obj *dump = S_make_dump();
     Folder *folder = (Folder*)RAMFolder_new(NULL);
 
-    CharBuf *foo = (CharBuf*)SSTR_WRAP_STR("foo", 3);
+    String *foo = (String*)SSTR_WRAP_STR("foo", 3);
     bool result = Json_spew_json(dump, folder, foo);
     TEST_TRUE(runner, result, "spew_json returns true on success");
     TEST_TRUE(runner, Folder_Exists(folder, foo),
@@ -217,14 +217,14 @@ test_spew_and_slurp(TestBatchRunner *runner) {
               "Failed spew_json sets Err_error");
 
     Err_set_error(NULL);
-    CharBuf *bar = (CharBuf*)SSTR_WRAP_STR("bar", 3);
+    String *bar = (String*)SSTR_WRAP_STR("bar", 3);
     got = Json_slurp_json(folder, bar);
     TEST_TRUE(runner, got == NULL,
               "slurp_json returns NULL when file doesn't exist");
     TEST_TRUE(runner, Err_get_error() != NULL,
               "Failed slurp_json sets Err_error");
 
-    CharBuf *boffo = (CharBuf*)SSTR_WRAP_STR("boffo", 5);
+    String *boffo = (String*)SSTR_WRAP_STR("boffo", 5);
 
     FileHandle *fh
         = Folder_Open_FileHandle(folder, boffo, FH_CREATE | FH_WRITE_ONLY);
@@ -247,7 +247,7 @@ static void
 S_verify_bad_syntax(TestBatchRunner *runner, const char *bad, const char *mess) {
     StackString *has_errors = SSTR_WRAP_STR(bad, strlen(bad));
     Err_set_error(NULL);
-    Obj *not_json = Json_from_json((CharBuf*)has_errors);
+    Obj *not_json = Json_from_json((String*)has_errors);
     TEST_TRUE(runner, not_json == NULL, "from_json returns NULL: %s", mess);
     TEST_TRUE(runner, Err_get_error() != NULL, "from_json sets Err_error: %s",
               mess);
@@ -279,7 +279,7 @@ S_round_trip_integer(TestBatchRunner *runner, int64_t value) {
     Integer64 *num = Int64_new(value);
     VArray *array = VA_new(1);
     VA_Store(array, 0, (Obj*)num);
-    CharBuf *json = Json_to_json((Obj*)array);
+    String *json = Json_to_json((Obj*)array);
     Obj *dump = Json_from_json(json);
     TEST_TRUE(runner, VA_Equals(array, dump), "Round trip integer %ld",
               (long)value);
@@ -301,7 +301,7 @@ S_round_trip_float(TestBatchRunner *runner, double value, double max_diff) {
     Float64 *num = Float64_new(value);
     VArray *array = VA_new(1);
     VA_Store(array, 0, (Obj*)num);
-    CharBuf *json = Json_to_json((Obj*)array);
+    String *json = Json_to_json((Obj*)array);
     Obj *dump = CERTIFY(Json_from_json(json), VARRAY);
     Float64 *got = (Float64*)CERTIFY(VA_Fetch((VArray*)dump, 0), FLOAT64);
     double diff = Float64_Get_Value(num) - Float64_Get_Value(got);
@@ -326,7 +326,7 @@ test_max_depth(TestBatchRunner *runner) {
     Hash *circular = Hash_new(0);
     Hash_Store_Str(circular, "circular", 8, INCREF(circular));
     Err_set_error(NULL);
-    CharBuf *not_json = Json_to_json((Obj*)circular);
+    String *not_json = Json_to_json((Obj*)circular);
     TEST_TRUE(runner, not_json == NULL,
               "to_json returns NULL when fed recursing data");
     TEST_TRUE(runner, Err_get_error() != NULL,
@@ -339,9 +339,9 @@ static void
 test_illegal_keys(TestBatchRunner *runner) {
     Hash *hash = Hash_new(0);
     Float64 *key = Float64_new(1.1);
-    Hash_Store(hash, (Obj*)key, (Obj*)CB_newf("blah"));
+    Hash_Store(hash, (Obj*)key, (Obj*)Str_newf("blah"));
     Err_set_error(NULL);
-    CharBuf *not_json = Json_to_json((Obj*)hash);
+    String *not_json = Json_to_json((Obj*)hash);
     TEST_TRUE(runner, not_json == NULL,
               "to_json returns NULL when fed an illegal key");
     TEST_TRUE(runner, Err_get_error() != NULL,

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Util/Freezer.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Freezer.c b/core/Lucy/Util/Freezer.c
index 44a241e..ff566df 100644
--- a/core/Lucy/Util/Freezer.c
+++ b/core/Lucy/Util/Freezer.c
@@ -41,7 +41,7 @@ Freezer_freeze(Obj *obj, OutStream *outstream) {
 
 Obj*
 Freezer_thaw(InStream *instream) {
-    CharBuf *class_name = Freezer_read_charbuf(instream);
+    String *class_name = Freezer_read_charbuf(instream);
     VTable *vtable = VTable_singleton(class_name, NULL);
     Obj *blank = VTable_Make_Obj(vtable);
     DECREF(class_name);
@@ -50,8 +50,8 @@ Freezer_thaw(InStream *instream) {
 
 void
 Freezer_serialize(Obj *obj, OutStream *outstream) {
-    if (Obj_Is_A(obj, CHARBUF)) {
-        Freezer_serialize_charbuf((CharBuf*)obj, outstream);
+    if (Obj_Is_A(obj, STRING)) {
+        Freezer_serialize_charbuf((String*)obj, outstream);
     }
     else if (Obj_Is_A(obj, BYTEBUF)) {
         Freezer_serialize_bytebuf((ByteBuf*)obj, outstream);
@@ -123,8 +123,8 @@ Freezer_serialize(Obj *obj, OutStream *outstream) {
 
 Obj*
 Freezer_deserialize(Obj *obj, InStream *instream) {
-    if (Obj_Is_A(obj, CHARBUF)) {
-        obj = (Obj*)Freezer_deserialize_charbuf((CharBuf*)obj, instream);
+    if (Obj_Is_A(obj, STRING)) {
+        obj = (Obj*)Freezer_deserialize_charbuf((String*)obj, instream);
     }
     else if (Obj_Is_A(obj, BYTEBUF)) {
         obj = (Obj*)Freezer_deserialize_bytebuf((ByteBuf*)obj, instream);
@@ -203,15 +203,15 @@ Freezer_deserialize(Obj *obj, InStream *instream) {
 }
 
 void
-Freezer_serialize_charbuf(CharBuf *charbuf, OutStream *outstream) {
-    size_t size  = CB_Get_Size(charbuf);
-    uint8_t *buf = CB_Get_Ptr8(charbuf);
+Freezer_serialize_charbuf(String *charbuf, OutStream *outstream) {
+    size_t size  = Str_Get_Size(charbuf);
+    uint8_t *buf = Str_Get_Ptr8(charbuf);
     OutStream_Write_C64(outstream, size);
     OutStream_Write_Bytes(outstream, buf, size);
 }
 
-CharBuf*
-Freezer_deserialize_charbuf(CharBuf *charbuf, InStream *instream) {
+String*
+Freezer_deserialize_charbuf(String *charbuf, InStream *instream) {
     size_t size = InStream_Read_C32(instream);
     if (size == SIZE_MAX) {
         THROW(ERR, "Can't deserialize SIZE_MAX bytes");
@@ -223,12 +223,12 @@ Freezer_deserialize_charbuf(CharBuf *charbuf, InStream *instream) {
     if (!StrHelp_utf8_valid(buf, size)) {
         THROW(ERR, "Attempt to deserialize invalid UTF-8");
     }
-    return CB_init_steal_trusted_str(charbuf, buf, size, cap);
+    return Str_init_steal_trusted_str(charbuf, buf, size, cap);
 }
 
-CharBuf*
+String*
 Freezer_read_charbuf(InStream *instream) {
-    CharBuf *charbuf = (CharBuf*)VTable_Make_Obj(CHARBUF);
+    String *charbuf = (String*)VTable_Make_Obj(STRING);
     return Freezer_deserialize_charbuf(charbuf, instream);
 }
 
@@ -299,18 +299,18 @@ Freezer_serialize_hash(Hash *hash, OutStream *outstream) {
     uint32_t hash_size = Hash_Get_Size(hash);
     OutStream_Write_C32(outstream, hash_size);
 
-    // Write CharBuf keys first.  CharBuf keys are the common case; grouping
+    // Write String keys first.  String keys are the common case; grouping
     // them together is a form of run-length-encoding and saves space, since
     // we omit the per-key class name.
     Hash_Iterate(hash);
     while (Hash_Next(hash, &key, &val)) {
-        if (Obj_Is_A(key, CHARBUF)) { charbuf_count++; }
+        if (Obj_Is_A(key, STRING)) { charbuf_count++; }
     }
     OutStream_Write_C32(outstream, charbuf_count);
     Hash_Iterate(hash);
     while (Hash_Next(hash, &key, &val)) {
-        if (Obj_Is_A(key, CHARBUF)) {
-            Freezer_serialize_charbuf((CharBuf*)key, outstream);
+        if (Obj_Is_A(key, STRING)) {
+            Freezer_serialize_charbuf((String*)key, outstream);
             FREEZE(val, outstream);
         }
     }
@@ -318,7 +318,7 @@ Freezer_serialize_hash(Hash *hash, OutStream *outstream) {
     // Punt on the classes of the remaining keys.
     Hash_Iterate(hash);
     while (Hash_Next(hash, &key, &val)) {
-        if (!Obj_Is_A(key, CHARBUF)) {
+        if (!Obj_Is_A(key, STRING)) {
             FREEZE(key, outstream);
             FREEZE(val, outstream);
         }
@@ -330,17 +330,17 @@ Freezer_deserialize_hash(Hash *hash, InStream *instream) {
     uint32_t size         = InStream_Read_C32(instream);
     uint32_t num_charbufs = InStream_Read_C32(instream);
     uint32_t num_other    = size - num_charbufs;
-    CharBuf *key          = num_charbufs ? CB_new(0) : NULL;
+    String *key          = num_charbufs ? Str_new(0) : NULL;
 
     Hash_init(hash, size);
 
-    // Read key-value pairs with CharBuf keys.
+    // Read key-value pairs with String keys.
     while (num_charbufs--) {
         uint32_t len = InStream_Read_C32(instream);
-        char *key_buf = CB_Grow(key, len);
+        char *key_buf = Str_Grow(key, len);
         InStream_Read_Bytes(instream, key_buf, len);
         key_buf[len] = '\0';
-        CB_Set_Size(key, len);
+        Str_Set_Size(key, len);
         Hash_Store(hash, (Obj*)key, THAW(instream));
     }
     DECREF(key);
@@ -383,7 +383,7 @@ S_dump_hash(Hash *hash) {
     while (Hash_Next(hash, &key, &value)) {
         // Since JSON only supports text hash keys, dump() can only support
         // text hash keys.
-        CERTIFY(key, CHARBUF);
+        CERTIFY(key, STRING);
         Hash_Store(dump, key, Freezer_dump(value));
     }
 
@@ -392,7 +392,7 @@ S_dump_hash(Hash *hash) {
 
 Obj*
 Freezer_dump(Obj *obj) {
-    if (Obj_Is_A(obj, CHARBUF)) {
+    if (Obj_Is_A(obj, STRING)) {
         return (Obj*)Obj_To_String(obj);
     }
     else if (Obj_Is_A(obj, VARRAY)) {
@@ -457,15 +457,15 @@ S_load_via_load_method(VTable *vtable, Obj *dump) {
 
 static Obj*
 S_load_from_hash(Hash *dump) {
-    CharBuf *class_name = (CharBuf*)Hash_Fetch_Str(dump, "_class", 6);
+    String *class_name = (String*)Hash_Fetch_Str(dump, "_class", 6);
 
     // Assume that the presence of the "_class" key paired with a valid class
     // name indicates the output of a dump() rather than an ordinary Hash.
-    if (class_name && CB_Is_A(class_name, CHARBUF)) {
+    if (class_name && Str_Is_A(class_name, STRING)) {
         VTable *vtable = VTable_fetch_vtable(class_name);
 
         if (!vtable) {
-            CharBuf *parent_class = VTable_find_parent_class(class_name);
+            String *parent_class = VTable_find_parent_class(class_name);
             if (parent_class) {
                 VTable *parent = VTable_singleton(parent_class, NULL);
                 vtable = VTable_singleton(class_name, parent);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Util/Freezer.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Freezer.cfh b/core/Lucy/Util/Freezer.cfh
index 93b152f..f393446 100644
--- a/core/Lucy/Util/Freezer.cfh
+++ b/core/Lucy/Util/Freezer.cfh
@@ -56,12 +56,12 @@ inert class Lucy::Util::Freezer {
     load(Obj *dump);
 
     inert void
-    serialize_charbuf(CharBuf *charbuf, OutStream *outstream);
+    serialize_charbuf(String *charbuf, OutStream *outstream);
 
-    inert incremented CharBuf*
-    deserialize_charbuf(decremented CharBuf *charbuf, InStream *instream);
+    inert incremented String*
+    deserialize_charbuf(decremented String *charbuf, InStream *instream);
 
-    inert incremented CharBuf*
+    inert incremented String*
     read_charbuf(InStream *instream);
 
     inert void

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Util/IndexFileNames.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/IndexFileNames.c b/core/Lucy/Util/IndexFileNames.c
index 8740655..9a938db 100644
--- a/core/Lucy/Util/IndexFileNames.c
+++ b/core/Lucy/Util/IndexFileNames.c
@@ -22,24 +22,24 @@
 #include "Lucy/Store/Folder.h"
 #include "Clownfish/Util/StringHelper.h"
 
-CharBuf*
+String*
 IxFileNames_latest_snapshot(Folder *folder) {
     DirHandle *dh = Folder_Open_Dir(folder, NULL);
-    CharBuf   *retval   = NULL;
+    String    *retval   = NULL;
     uint64_t   latest_gen = 0;
 
     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 > latest_gen) {
                 latest_gen = gen;
                 DECREF(retval);
-                retval = CB_Clone(entry);
+                retval = Str_Clone(entry);
             }
         }
         DECREF(entry);
@@ -50,7 +50,7 @@ IxFileNames_latest_snapshot(Folder *folder) {
 }
 
 uint64_t
-IxFileNames_extract_gen(const CharBuf *name) {
+IxFileNames_extract_gen(const String *name) {
     StackString *num_string = SSTR_WRAP(name);
 
     // Advance past first underscore.  Bail if we run out of string or if we
@@ -65,9 +65,9 @@ IxFileNames_extract_gen(const CharBuf *name) {
 }
 
 StackString*
-IxFileNames_local_part(const CharBuf *path, StackString *target) {
+IxFileNames_local_part(const String *path, StackString *target) {
     StackString *scratch = SSTR_WRAP(path);
-    size_t local_part_start = CB_Length(path);
+    size_t local_part_start = Str_Length(path);
     uint32_t code_point;
 
     SStr_Assign(target, path);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Util/IndexFileNames.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/IndexFileNames.cfh b/core/Lucy/Util/IndexFileNames.cfh
index d115826..872efb2 100644
--- a/core/Lucy/Util/IndexFileNames.cfh
+++ b/core/Lucy/Util/IndexFileNames.cfh
@@ -20,19 +20,19 @@ parcel Lucy;
  */
 inert class Lucy::Util::IndexFileNames cnick IxFileNames {
 
-    /** Skip past the first instance of an underscore in the CharBuf, then
+    /** Skip past the first instance of an underscore in the String, then
      * attempt to decode a base 36 number.  For example, "snapshot_5.json"
      * yields 5, and "seg_a1" yields 27.
      *
      * @return a generation number, or 0 if no number can be extracted.
      */
     inert uint64_t
-    extract_gen(const CharBuf *name);
+    extract_gen(const String *name);
 
     /** Return the name of the latest generation snapshot file in the Folder,
      * or NULL if no such file exists.
      */
-    inert incremented nullable CharBuf*
+    inert incremented nullable String*
     latest_snapshot(Folder *folder);
 
     /** Split the <code>path</code> on '/' and assign the last component to
@@ -43,7 +43,7 @@ inert class Lucy::Util::IndexFileNames cnick IxFileNames {
      * @return target, allowing an assignment idiom.
      */
     inert incremented StackString*
-    local_part(const CharBuf *path, StackString *target);
+    local_part(const String *path, StackString *target);
 }
 
 

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Util/Json.c
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Json.c b/core/Lucy/Util/Json.c
index e6843d6..e55e406 100644
--- a/core/Lucy/Util/Json.c
+++ b/core/Lucy/Util/Json.c
@@ -40,7 +40,7 @@ LucyParseJsonTrace(FILE *trace, char *line_prefix);
 // Encode JSON for supplied "dump".  On failure, sets Err_error and returns
 // false.
 static bool
-S_to_json(Obj *dump, CharBuf *json, int32_t depth);
+S_to_json(Obj *dump, String *json, int32_t depth);
 
 // Parse JSON from raw UTF-8 in memory.
 static Obj*
@@ -54,14 +54,14 @@ S_parse_number(char **json_ptr, char *const limit);
 
 // Parse a JSON string.  Advance the text buffer from pointing at the opening
 // double quote to pointing just after the closing double quote.
-static CharBuf*
+static String*
 S_parse_string(char **json_ptr, char *const limit);
 
 // Unescape JSON string text.  Expects pointers bookending the text data (i.e.
 // pointing just after the opening double quote and directly at the closing
 // double quote), and assumes that escapes have already been sanity checked
 // for length.
-static CharBuf*
+static String*
 S_unescape_text(char *const top, char *const end);
 
 // Check that the supplied text begins with the specified keyword, which must
@@ -79,18 +79,18 @@ static const size_t INDENTATION_LEN = sizeof(indentation) - 1;
 
 // Append indentation spaces x depth.
 static void
-S_cat_whitespace(CharBuf *json, int32_t depth);
+S_cat_whitespace(String *json, int32_t depth);
 
 // Set Err_error, appending escaped JSON in the vicinity of the error.
 static void
-S_set_error(CharBuf *mess, char *json, char *limit, int line,
+S_set_error(String *mess, char *json, char *limit, int line,
             const char *func);
 #define SET_ERROR(_mess, _json, _end) \
     S_set_error(_mess, _json, _end, __LINE__, CFISH_ERR_FUNC_MACRO)
 
 Obj*
-Json_from_json(CharBuf *json) {
-    Obj *dump = S_parse_json((char*)CB_Get_Ptr8(json), CB_Get_Size(json));
+Json_from_json(String *json) {
+    Obj *dump = S_parse_json((char*)Str_Get_Ptr8(json), Str_Get_Size(json));
     if (!dump) {
         ERR_ADD_FRAME(Err_get_error());
     }
@@ -98,7 +98,7 @@ Json_from_json(CharBuf *json) {
 }
 
 Obj*
-Json_slurp_json(Folder *folder, const CharBuf *path) {
+Json_slurp_json(Folder *folder, const String *path) {
     InStream *instream = Folder_Open_In(folder, path);
     if (!instream) {
         ERR_ADD_FRAME(Err_get_error());
@@ -116,8 +116,8 @@ Json_slurp_json(Folder *folder, const CharBuf *path) {
 }
 
 bool
-Json_spew_json(Obj *dump, Folder *folder, const CharBuf *path) {
-    CharBuf *json = Json_to_json(dump);
+Json_spew_json(Obj *dump, Folder *folder, const String *path) {
+    String *json = Json_to_json(dump);
     if (!json) {
         ERR_ADD_FRAME(Err_get_error());
         return false;
@@ -128,21 +128,21 @@ Json_spew_json(Obj *dump, Folder *folder, const CharBuf *path) {
         DECREF(json);
         return false;
     }
-    size_t size = CB_Get_Size(json);
-    OutStream_Write_Bytes(outstream, CB_Get_Ptr8(json), size);
+    size_t size = Str_Get_Size(json);
+    OutStream_Write_Bytes(outstream, Str_Get_Ptr8(json), size);
     OutStream_Close(outstream);
     DECREF(outstream);
     DECREF(json);
     return true;
 }
 
-CharBuf*
+String*
 Json_to_json(Obj *dump) {
     // Validate object type, only allowing hashes and arrays per JSON spec.
     if (!dump || !(Obj_Is_A(dump, HASH) || Obj_Is_A(dump, VARRAY))) {
         if (!tolerant) {
-            CharBuf *class_name = dump ? Obj_Get_Class_Name(dump) : NULL;
-            CharBuf *mess = MAKE_MESS("Illegal top-level object type: %o",
+            String *class_name = dump ? Obj_Get_Class_Name(dump) : NULL;
+            String *mess = MAKE_MESS("Illegal top-level object type: %o",
                                       class_name);
             Err_set_error(Err_new(mess));
             return NULL;
@@ -150,7 +150,7 @@ Json_to_json(Obj *dump) {
     }
 
     // Encode.
-    CharBuf *json = CB_new(31);
+    String *json = Str_new(31);
     if (!S_to_json(dump, json, 0)) {
         DECREF(json);
         ERR_ADD_FRAME(Err_get_error());
@@ -158,7 +158,7 @@ Json_to_json(Obj *dump) {
     }
     else {
         // Append newline.
-        CB_Cat_Trusted_Str(json, "\n", 1);
+        Str_Cat_Trusted_Str(json, "\n", 1);
     }
 
     return json;
@@ -172,19 +172,19 @@ Json_set_tolerant(bool tolerance) {
 static const int32_t MAX_DEPTH = 200;
 
 static void
-S_append_json_string(Obj *dump, CharBuf *json) {
+S_append_json_string(Obj *dump, String *json) {
     // Append opening quote.
-    CB_Cat_Trusted_Str(json, "\"", 1);
+    Str_Cat_Trusted_Str(json, "\"", 1);
 
     // Process string data.
-    StackString *iterator = SSTR_WRAP((CharBuf*)dump);
+    StackString *iterator = SSTR_WRAP((String*)dump);
     while (SStr_Get_Size(iterator)) {
         uint32_t code_point = SStr_Nibble(iterator);
         if (code_point > 127) {
             // There is no need to escape any high characters, including those
             // above the BMP, as we assume that the destination channel can
             // handle arbitrary UTF-8 data.
-            CB_Cat_Char(json, code_point);
+            Str_Cat_Char(json, code_point);
         }
         else {
             char buffer[7];
@@ -238,83 +238,83 @@ S_append_json_string(Obj *dump, CharBuf *json) {
                     buffer[0] = (char)code_point;
                     len = 1;
             }
-            CB_Cat_Trusted_Str(json, buffer, len);
+            Str_Cat_Trusted_Str(json, buffer, len);
         }
     }
 
     // Append closing quote.
-    CB_Cat_Trusted_Str(json, "\"", 1);
+    Str_Cat_Trusted_Str(json, "\"", 1);
 }
 
 static void
-S_cat_whitespace(CharBuf *json, int32_t depth) {
+S_cat_whitespace(String *json, int32_t depth) {
     while (depth--) {
-        CB_Cat_Trusted_Str(json, indentation, INDENTATION_LEN);
+        Str_Cat_Trusted_Str(json, indentation, INDENTATION_LEN);
     }
 }
 
 static bool
-S_to_json(Obj *dump, CharBuf *json, int32_t depth) {
+S_to_json(Obj *dump, String *json, int32_t depth) {
     // Guard against infinite recursion in self-referencing data structures.
     if (depth > MAX_DEPTH) {
-        CharBuf *mess = MAKE_MESS("Exceeded max depth of %i32", MAX_DEPTH);
+        String *mess = MAKE_MESS("Exceeded max depth of %i32", MAX_DEPTH);
         Err_set_error(Err_new(mess));
         return false;
     }
 
     if (!dump) {
-        CB_Cat_Trusted_Str(json, "null", 4);
+        Str_Cat_Trusted_Str(json, "null", 4);
     }
     else if (dump == (Obj*)CFISH_TRUE) {
-        CB_Cat_Trusted_Str(json, "true", 4);
+        Str_Cat_Trusted_Str(json, "true", 4);
     }
     else if (dump == (Obj*)CFISH_FALSE) {
-        CB_Cat_Trusted_Str(json, "false", 5);
+        Str_Cat_Trusted_Str(json, "false", 5);
     }
-    else if (Obj_Is_A(dump, CHARBUF)) {
+    else if (Obj_Is_A(dump, STRING)) {
         S_append_json_string(dump, json);
     }
     else if (Obj_Is_A(dump, INTNUM)) {
-        CB_catf(json, "%i64", Obj_To_I64(dump));
+        Str_catf(json, "%i64", Obj_To_I64(dump));
     }
     else if (Obj_Is_A(dump, FLOATNUM)) {
-        CB_catf(json, "%f64", Obj_To_F64(dump));
+        Str_catf(json, "%f64", Obj_To_F64(dump));
     }
     else if (Obj_Is_A(dump, VARRAY)) {
         VArray *array = (VArray*)dump;
         size_t size = VA_Get_Size(array);
         if (size == 0) {
             // Put empty array on single line.
-            CB_Cat_Trusted_Str(json, "[]", 2);
+            Str_Cat_Trusted_Str(json, "[]", 2);
             return true;
         }
         else if (size == 1) {
             Obj *elem = VA_Fetch(array, 0);
             if (!(Obj_Is_A(elem, HASH) || Obj_Is_A(elem, VARRAY))) {
                 // Put array containing single scalar element on one line.
-                CB_Cat_Trusted_Str(json, "[", 1);
+                Str_Cat_Trusted_Str(json, "[", 1);
                 if (!S_to_json(elem, json, depth + 1)) {
                     return false;
                 }
-                CB_Cat_Trusted_Str(json, "]", 1);
+                Str_Cat_Trusted_Str(json, "]", 1);
                 return true;
             }
         }
         // Fall back to spreading elements across multiple lines.
-        CB_Cat_Trusted_Str(json, "[", 1);
+        Str_Cat_Trusted_Str(json, "[", 1);
         for (size_t i = 0; i < size; i++) {
-            CB_Cat_Trusted_Str(json, "\n", 1);
+            Str_Cat_Trusted_Str(json, "\n", 1);
             S_cat_whitespace(json, depth + 1);
             if (!S_to_json(VA_Fetch(array, i), json, depth + 1)) {
                 return false;
             }
             if (i + 1 < size) {
-                CB_Cat_Trusted_Str(json, ",", 1);
+                Str_Cat_Trusted_Str(json, ",", 1);
             }
         }
-        CB_Cat_Trusted_Str(json, "\n", 1);
+        Str_Cat_Trusted_Str(json, "\n", 1);
         S_cat_whitespace(json, depth);
-        CB_Cat_Trusted_Str(json, "]", 1);
+        Str_Cat_Trusted_Str(json, "]", 1);
     }
     else if (Obj_Is_A(dump, HASH)) {
         Hash *hash = (Hash*)dump;
@@ -322,7 +322,7 @@ S_to_json(Obj *dump, CharBuf *json, int32_t depth) {
 
         // Put empty hash on single line.
         if (size == 0) {
-            CB_Cat_Trusted_Str(json, "{}", 2);
+            Str_Cat_Trusted_Str(json, "{}", 2);
             return true;
         }
 
@@ -330,10 +330,10 @@ S_to_json(Obj *dump, CharBuf *json, int32_t depth) {
         VArray *keys = Hash_Keys(hash);
         for (size_t i = 0; i < size; i++) {
             Obj *key = VA_Fetch(keys, i);
-            if (!key || !Obj_Is_A(key, CHARBUF)) {
+            if (!key || !Obj_Is_A(key, STRING)) {
                 DECREF(keys);
-                CharBuf *key_class = key ? Obj_Get_Class_Name(key) : NULL;
-                CharBuf *mess = MAKE_MESS("Illegal key type: %o", key_class);
+                String *key_class = key ? Obj_Get_Class_Name(key) : NULL;
+                String *mess = MAKE_MESS("Illegal key type: %o", key_class);
                 Err_set_error(Err_new(mess));
                 return false;
             }
@@ -341,24 +341,24 @@ S_to_json(Obj *dump, CharBuf *json, int32_t depth) {
         VA_Sort(keys, NULL, NULL);
 
         // Spread pairs across multiple lines.
-        CB_Cat_Trusted_Str(json, "{", 1);
+        Str_Cat_Trusted_Str(json, "{", 1);
         for (size_t i = 0; i < size; i++) {
             Obj *key = VA_Fetch(keys, i);
-            CB_Cat_Trusted_Str(json, "\n", 1);
+            Str_Cat_Trusted_Str(json, "\n", 1);
             S_cat_whitespace(json, depth + 1);
             S_append_json_string(key, json);
-            CB_Cat_Trusted_Str(json, ": ", 2);
+            Str_Cat_Trusted_Str(json, ": ", 2);
             if (!S_to_json(Hash_Fetch(hash, key), json, depth + 1)) {
                 DECREF(keys);
                 return false;
             }
             if (i + 1 < size) {
-                CB_Cat_Trusted_Str(json, ",", 1);
+                Str_Cat_Trusted_Str(json, ",", 1);
             }
         }
-        CB_Cat_Trusted_Str(json, "\n", 1);
+        Str_Cat_Trusted_Str(json, "\n", 1);
         S_cat_whitespace(json, depth);
-        CB_Cat_Trusted_Str(json, "}", 1);
+        Str_Cat_Trusted_Str(json, "}", 1);
 
         DECREF(keys);
     }
@@ -370,7 +370,7 @@ static Obj*
 S_parse_json(char *text, size_t size) {
     void *json_parser = LucyParseJsonAlloc(Memory_wrapped_malloc);
     if (json_parser == NULL) {
-        CharBuf *mess = MAKE_MESS("Failed to allocate JSON parser");
+        String *mess = MAKE_MESS("Failed to allocate JSON parser");
         Err_set_error(Err_new(mess));
         return NULL;
     }
@@ -471,7 +471,7 @@ S_do_parse_json(void *json_parser, char *json, size_t len) {
         }
         LucyParseJson(json_parser, token_type, value, &state);
         if (state.errors) {
-            SET_ERROR(CB_newf("JSON syntax error"), save, end);
+            SET_ERROR(Str_newf("JSON syntax error"), save, end);
             return NULL;
         }
     }
@@ -479,7 +479,7 @@ S_do_parse_json(void *json_parser, char *json, size_t len) {
     // Finish up.
     LucyParseJson(json_parser, 0, NULL, &state);
     if (state.errors) {
-        SET_ERROR(CB_newf("JSON syntax error"), json, end);
+        SET_ERROR(Str_newf("JSON syntax error"), json, end);
         return NULL;
     }
     return state.result;
@@ -518,12 +518,12 @@ S_parse_number(char **json_ptr, char *const limit) {
         }
     }
     if (!result) {
-        SET_ERROR(CB_newf("JSON syntax error"), top, limit);
+        SET_ERROR(Str_newf("JSON syntax error"), top, limit);
     }
     return result;
 }
 
-static CharBuf*
+static String*
 S_parse_string(char **json_ptr, char *const limit) {
     // Find terminating double quote, determine whether there are any escapes.
     char *top = *json_ptr + 1;
@@ -545,7 +545,7 @@ S_parse_string(char **json_ptr, char *const limit) {
         }
     }
     if (!end) {
-        SET_ERROR(CB_newf("Unterminated string"), *json_ptr, limit);
+        SET_ERROR(Str_newf("Unterminated string"), *json_ptr, limit);
         return NULL;
     }
 
@@ -559,15 +559,15 @@ S_parse_string(char **json_ptr, char *const limit) {
         // Optimize common case where there are no escapes.
         size_t len = end - top;
         if (!StrHelp_utf8_valid(top, len)) {
-            CharBuf *mess = MAKE_MESS("Bad UTF-8 in JSON");
+            String *mess = MAKE_MESS("Bad UTF-8 in JSON");
             Err_set_error(Err_new(mess));
             return NULL;
         }
-        return CB_new_from_trusted_utf8(top, len);
+        return Str_new_from_trusted_utf8(top, len);
     }
 }
 
-static CharBuf*
+static String*
 S_unescape_text(char *const top, char *const end) {
     // The unescaped string will never be longer than the escaped string
     // because only a \u escape can theoretically be too long and
@@ -619,12 +619,12 @@ S_unescape_text(char *const top, char *const end) {
                         char *temp_ptr = temp;
                         if (num_end != temp_ptr + 4 || code_point < 0) {
                             FREEMEM(target_buf);
-                            SET_ERROR(CB_newf("Invalid \\u escape"), text - 5, end);
+                            SET_ERROR(Str_newf("Invalid \\u escape"), text - 5, end);
                             return NULL;
                         }
                         if (code_point >= 0xD800 && code_point <= 0xDFFF) {
                             FREEMEM(target_buf);
-                            SET_ERROR(CB_newf("Surrogate pairs not supported"),
+                            SET_ERROR(Str_newf("Surrogate pairs not supported"),
                                       text - 5, end);
                             return NULL;
                         }
@@ -634,7 +634,7 @@ S_unescape_text(char *const top, char *const end) {
                     break;
                 default:
                     FREEMEM(target_buf);
-                    SET_ERROR(CB_newf("Illegal escape"), text - 1, end);
+                    SET_ERROR(Str_newf("Illegal escape"), text - 1, end);
                     return NULL;
             }
         }
@@ -644,11 +644,11 @@ S_unescape_text(char *const top, char *const end) {
     target_buf[target_size] = '\0';
     if (!StrHelp_utf8_valid(target_buf, target_size)) {
         FREEMEM(target_buf);
-        CharBuf *mess = MAKE_MESS("Bad UTF-8 in JSON");
+        String *mess = MAKE_MESS("Bad UTF-8 in JSON");
         Err_set_error(Err_new(mess));
         return NULL;
     }
-    return CB_new_steal_from_trusted_str(target_buf, target_size, cap);
+    return Str_new_steal_from_trusted_str(target_buf, target_size, cap);
 }
 
 static CFISH_INLINE bool
@@ -664,14 +664,14 @@ SI_check_keyword(char *json, char* end, const char *keyword, size_t len) {
 }
 
 static void
-S_set_error(CharBuf *mess, char *json, char *limit, int line,
+S_set_error(String *mess, char *json, char *limit, int line,
             const char *func) {
     if (func) {
-        CB_catf(mess, " at %s %s line %i32 near ", func, __FILE__,
+        Str_catf(mess, " at %s %s line %i32 near ", func, __FILE__,
                 (int32_t)line);
     }
     else {
-        CB_catf(mess, " at %s line %i32 near ", __FILE__, (int32_t)line);
+        Str_catf(mess, " at %s line %i32 near ", __FILE__, (int32_t)line);
     }
 
     // Append escaped text.

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Util/Json.cfh
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Json.cfh b/core/Lucy/Util/Json.cfh
index f872438..ceedfd3 100644
--- a/core/Lucy/Util/Json.cfh
+++ b/core/Lucy/Util/Json.cfh
@@ -25,30 +25,30 @@ class Lucy::Util::Json inherits Clownfish::Obj {
     /** Encode <code>dump</code> as JSON.  Returns NULL and sets Err_error on
      * failure.
      */
-    inert incremented nullable CharBuf*
+    inert incremented nullable String*
     to_json(Obj *dump);
 
     /** Decode the supplied JSON and return a data structure made
-     * of Hashes, VArrays, and CharBufs.  Returns NULL and sets Err_error on
+     * of Hashes, VArrays, and Strings.  Returns NULL and sets Err_error on
      * failure.
      */
     inert incremented nullable Obj*
-    from_json(CharBuf *json);
+    from_json(String *json);
 
     /** Encode <code>dump</code> as JSON and attempt to write to the indicated
      * file.
      * @return true if the write succeeds, false on failure (sets Err_error).
      */
     inert bool
-    spew_json(Obj *dump, Folder *folder, const CharBuf *path);
+    spew_json(Obj *dump, Folder *folder, const String *path);
 
     /** Decode the JSON in the file at <code>path</code> and return a data
-     * structure made of Hashes, VArrays, and CharBufs.  Returns NULL and sets
+     * structure made of Hashes, VArrays, and Strings.  Returns NULL and sets
      * Err_error if the file can't be can't be opened or if the file doesn't
      * contain valid JSON.
      */
     inert incremented nullable Obj*
-    slurp_json(Folder *folder, const CharBuf *path);
+    slurp_json(Folder *folder, const String *path);
 
     /** Allow the encoder to output strings, etc, instead of throwing an error
      * on anything other than a hash or an array.  Testing only.

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Util/Json/JsonParser.y
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/Json/JsonParser.y b/core/Lucy/Util/Json/JsonParser.y
index aa3ddcf..3e1b5c9 100644
--- a/core/Lucy/Util/Json/JsonParser.y
+++ b/core/Lucy/Util/Json/JsonParser.y
@@ -26,7 +26,7 @@
 #include <assert.h>
 #include "Clownfish/Hash.h"
 #include "Clownfish/VArray.h"
-#include "Clownfish/CharBuf.h"
+#include "Clownfish/String.h"
 #include "Clownfish/Err.h"
 #include "Lucy/Util/Json.h"
 }
@@ -51,7 +51,7 @@ result ::= top_level_value(A).
 top_level_value(A) ::= value(B).  { A = B; }
 
 /* Values */
-%type STRING { cfish_CharBuf* }
+%type STRING { cfish_String* }
 
 value(A) ::= FALSE(B).   { A = B; }
 value(A) ::= NULL(B).    { A = B; }

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/Lucy/Util/ToolSet.h
----------------------------------------------------------------------
diff --git a/core/Lucy/Util/ToolSet.h b/core/Lucy/Util/ToolSet.h
index 6ad0ebf..ce4c21d 100644
--- a/core/Lucy/Util/ToolSet.h
+++ b/core/Lucy/Util/ToolSet.h
@@ -40,7 +40,7 @@ extern "C" {
 #include "Clownfish/Obj.h"
 #include "Lucy/Object/BitVector.h"
 #include "Clownfish/ByteBuf.h"
-#include "Clownfish/CharBuf.h"
+#include "Clownfish/String.h"
 #include "Clownfish/Err.h"
 #include "Clownfish/Hash.h"
 #include "Lucy/Object/I32Array.h"

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/LucyX/Search/ProximityQuery.c
----------------------------------------------------------------------
diff --git a/core/LucyX/Search/ProximityQuery.c b/core/LucyX/Search/ProximityQuery.c
index 771dbfa..6ae2875 100644
--- a/core/LucyX/Search/ProximityQuery.c
+++ b/core/LucyX/Search/ProximityQuery.c
@@ -41,19 +41,19 @@
 // Shared initialization routine which assumes that it's ok to assume control
 // over [field] and [terms], eating their refcounts.
 static ProximityQuery*
-S_do_init(ProximityQuery *self, CharBuf *field, VArray *terms, float boost,
+S_do_init(ProximityQuery *self, String *field, VArray *terms, float boost,
           uint32_t within);
 
 ProximityQuery*
-ProximityQuery_new(const CharBuf *field, VArray *terms, uint32_t within) {
+ProximityQuery_new(const String *field, VArray *terms, uint32_t within) {
     ProximityQuery *self = (ProximityQuery*)VTable_Make_Obj(PROXIMITYQUERY);
     return ProximityQuery_init(self, field, terms, within);
 }
 
 ProximityQuery*
-ProximityQuery_init(ProximityQuery *self, const CharBuf *field, VArray *terms,
+ProximityQuery_init(ProximityQuery *self, const String *field, VArray *terms,
                     uint32_t within) {
-    return S_do_init(self, CB_Clone(field), VA_Clone(terms), 1.0f, within);
+    return S_do_init(self, Str_Clone(field), VA_Clone(terms), 1.0f, within);
 }
 
 void
@@ -65,7 +65,7 @@ ProximityQuery_Destroy_IMP(ProximityQuery *self) {
 }
 
 static ProximityQuery*
-S_do_init(ProximityQuery *self, CharBuf *field, VArray *terms, float boost,
+S_do_init(ProximityQuery *self, String *field, VArray *terms, float boost,
           uint32_t within) {
     Query_init((Query*)self, boost);
     ProximityQueryIVARS *const ivars = ProximityQuery_IVARS(self);
@@ -90,7 +90,7 @@ ProximityQuery_Serialize_IMP(ProximityQuery *self, OutStream *outstream) {
 ProximityQuery*
 ProximityQuery_Deserialize_IMP(ProximityQuery *self, InStream *instream) {
     float boost = InStream_Read_F32(instream);
-    CharBuf *field = Freezer_read_charbuf(instream);
+    String *field = Freezer_read_charbuf(instream);
     VArray  *terms = Freezer_read_varray(instream);
     uint32_t within = InStream_Read_C32(instream);
     return S_do_init(self, field, terms, boost, within);
@@ -105,7 +105,7 @@ ProximityQuery_Dump_IMP(ProximityQuery *self) {
     Hash_Store_Str(dump, "field", 5, Freezer_dump((Obj*)ivars->field));
     Hash_Store_Str(dump, "terms", 5, Freezer_dump((Obj*)ivars->terms));
     Hash_Store_Str(dump, "within", 6,
-                   (Obj*)CB_newf("%i64", (int64_t)ivars->within));
+                   (Obj*)Str_newf("%i64", (int64_t)ivars->within));
     return (Obj*)dump;
 }
 
@@ -117,7 +117,7 @@ ProximityQuery_Load_IMP(ProximityQuery *self, Obj *dump) {
     ProximityQuery *loaded = (ProximityQuery*)super_load(self, dump);
     ProximityQueryIVARS *loaded_ivars = ProximityQuery_IVARS(loaded);
     Obj *field = CERTIFY(Hash_Fetch_Str(source, "field", 5), OBJ);
-    loaded_ivars->field = (CharBuf*)CERTIFY(Freezer_load(field), CHARBUF);
+    loaded_ivars->field = (String*)CERTIFY(Freezer_load(field), STRING);
     Obj *terms = CERTIFY(Hash_Fetch_Str(source, "terms", 5), OBJ);
     loaded_ivars->terms = (VArray*)CERTIFY(Freezer_load(terms), VARRAY);
     Obj *within = CERTIFY(Hash_Fetch_Str(source, "within", 6), OBJ);
@@ -136,7 +136,7 @@ ProximityQuery_Equals_IMP(ProximityQuery *self, Obj *other) {
     if (ivars->boost != ovars->boost)       { return false; }
     if (ivars->field && !ovars->field)      { return false; }
     if (!ivars->field && ovars->field)      { return false; }
-    if (ivars->field && !CB_Equals(ivars->field, (Obj*)ovars->field)) {
+    if (ivars->field && !Str_Equals(ivars->field, (Obj*)ovars->field)) {
         return false;
     }
     if (!VA_Equals(ovars->terms, (Obj*)ivars->terms)) { return false; }
@@ -144,23 +144,23 @@ ProximityQuery_Equals_IMP(ProximityQuery *self, Obj *other) {
     return true;
 }
 
-CharBuf*
+String*
 ProximityQuery_To_String_IMP(ProximityQuery *self) {
     ProximityQueryIVARS *const ivars = ProximityQuery_IVARS(self);
     uint32_t num_terms = VA_Get_Size(ivars->terms);
-    CharBuf *retval = CB_Clone(ivars->field);
-    CB_Cat_Trusted_Str(retval, ":\"", 2);
+    String *retval = Str_Clone(ivars->field);
+    Str_Cat_Trusted_Str(retval, ":\"", 2);
     for (uint32_t i = 0; i < num_terms; i++) {
         Obj *term = VA_Fetch(ivars->terms, i);
-        CharBuf *term_string = Obj_To_String(term);
-        CB_Cat(retval, term_string);
+        String *term_string = Obj_To_String(term);
+        Str_Cat(retval, term_string);
         DECREF(term_string);
         if (i < num_terms - 1) {
-            CB_Cat_Trusted_Str(retval, " ",  1);
+            Str_Cat_Trusted_Str(retval, " ",  1);
         }
     }
-    CB_Cat_Trusted_Str(retval, "\"", 1);
-    CB_catf(retval, "~%u32", ivars->within);
+    Str_Cat_Trusted_Str(retval, "\"", 1);
+    Str_catf(retval, "~%u32", ivars->within);
     return retval;
 }
 
@@ -189,7 +189,7 @@ ProximityQuery_Make_Compiler_IMP(ProximityQuery *self, Searcher *searcher,
     }
 }
 
-CharBuf*
+String*
 ProximityQuery_Get_Field_IMP(ProximityQuery *self) {
     return ProximityQuery_IVARS(self)->field;
 }
@@ -367,7 +367,7 @@ ProximityCompiler_Make_Matcher_IMP(ProximityCompiler *self, SegReader *reader,
 VArray*
 ProximityCompiler_Highlight_Spans_IMP(ProximityCompiler *self,
                                       Searcher *searcher, DocVector *doc_vec,
-                                      const CharBuf *field) {
+                                      const String *field) {
     ProximityCompilerIVARS *const ivars = ProximityCompiler_IVARS(self);
     ProximityQueryIVARS *const parent_ivars
         = ProximityQuery_IVARS((ProximityQuery*)ivars->parent);
@@ -378,7 +378,7 @@ ProximityCompiler_Highlight_Spans_IMP(ProximityCompiler *self,
 
     // Bail if no terms or field doesn't match.
     if (!num_terms) { return spans; }
-    if (!CB_Equals(field, (Obj*)parent_ivars->field)) { return spans; }
+    if (!Str_Equals(field, (Obj*)parent_ivars->field)) { return spans; }
 
     VArray      *term_vectors    = VA_new(num_terms);
     BitVector   *posit_vec       = BitVec_new(0);
@@ -386,7 +386,7 @@ ProximityCompiler_Highlight_Spans_IMP(ProximityCompiler *self,
     for (uint32_t i = 0; i < num_terms; i++) {
         Obj *term = VA_Fetch(terms, i);
         TermVector *term_vector
-            = DocVec_Term_Vector(doc_vec, field, (CharBuf*)term);
+            = DocVec_Term_Vector(doc_vec, field, (String*)term);
 
         // Bail if any term is missing.
         if (!term_vector) {

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/core/LucyX/Search/ProximityQuery.cfh
----------------------------------------------------------------------
diff --git a/core/LucyX/Search/ProximityQuery.cfh b/core/LucyX/Search/ProximityQuery.cfh
index 0d02a24..102b38f 100644
--- a/core/LucyX/Search/ProximityQuery.cfh
+++ b/core/LucyX/Search/ProximityQuery.cfh
@@ -24,23 +24,23 @@ parcel Lucy;
 
 public class LucyX::Search::ProximityQuery inherits Lucy::Search::Query {
 
-    CharBuf       *field;
+    String        *field;
     VArray        *terms;
     uint32_t       within;
 
     inert incremented ProximityQuery*
-    new(const CharBuf *field, VArray *terms, uint32_t within);
+    new(const String *field, VArray *terms, uint32_t within);
 
     /**
      * @param field The field that the phrase must occur in.
      * @param terms The ordered array of terms that must match.
      */
     public inert ProximityQuery*
-    init(ProximityQuery *self, const CharBuf *field, VArray *terms, uint32_t within);
+    init(ProximityQuery *self, const String *field, VArray *terms, uint32_t within);
 
     /** Accessor for object's field attribute.
      */
-    public CharBuf*
+    public String*
     Get_Field(ProximityQuery *self);
 
     /** Accessor for object's array of terms.
@@ -60,7 +60,7 @@ public class LucyX::Search::ProximityQuery inherits Lucy::Search::Query {
     public bool
     Equals(ProximityQuery *self, Obj *other);
 
-    public incremented CharBuf*
+    public incremented String*
     To_String(ProximityQuery *self);
 
     public void
@@ -109,7 +109,7 @@ class LucyX::Search::ProximityCompiler
 
     public incremented VArray*
     Highlight_Spans(ProximityCompiler *self, Searcher *searcher,
-                    DocVector *doc_vec, const CharBuf *field);
+                    DocVector *doc_vec, const String *field);
 
     public bool
     Equals(ProximityCompiler *self, Obj *other);

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/example-lang/README
----------------------------------------------------------------------
diff --git a/example-lang/README b/example-lang/README
index ae98717..add0171 100644
--- a/example-lang/README
+++ b/example-lang/README
@@ -37,7 +37,7 @@ search-related.  At some point everything under Lucy::Object will probably
 migrate to a new namespace:
 
     Clownfish::Obj       => Clownfish::Obj
-    Lucy::Object::CharBuf   => Clownfish::CharBuf
+    Lucy::Object::String    => Clownfish::String
     Lucy::Object::VArray    => Clownfish::VArray
     Lucy::Object::Hash      => Clownfish::Hash
     Lucy::Object::BitVector => Clownfish::BitVector

http://git-wip-us.apache.org/repos/asf/lucy/blob/2c3dbf15/example-lang/src/CFBind.h
----------------------------------------------------------------------
diff --git a/example-lang/src/CFBind.h b/example-lang/src/CFBind.h
index f8443cd..b4c142b 100644
--- a/example-lang/src/CFBind.h
+++ b/example-lang/src/CFBind.h
@@ -27,7 +27,7 @@ extern "C" {
 #include "charmony.h"
 #include "Clownfish/Obj.h"
 #include "Clownfish/ByteBuf.h"
-#include "Clownfish/CharBuf.h"
+#include "Clownfish/String.h"
 #include "Clownfish/Err.h"
 #include "Clownfish/Hash.h"
 #include "Clownfish/Num.h"


Mime
View raw message