void structCategories :: v_writeText (MelderFile file) { texputi4 (file, size, U"size", 0, 0, 0, 0, 0); for (long i = 1; i <= size; i++) { SimpleString data = (SimpleString) item [i]; texputintro (file, U"item" " [", Melder_integer (i), U"]:", nullptr, nullptr, nullptr); data -> structSimpleString :: v_writeText (file); texexdent (file); } }
void _CollectionOfDaata_v_writeText (_CollectionOfDaata* me, MelderFile file) { texputi4 (file, my size, U"size", 0,0,0,0,0); texputintro (file, U"item []: ", my size ? nullptr : U"(empty)", 0,0,0,0); for (long i = 1; i <= my size; i ++) { Daata thing = my at [i]; ClassInfo classInfo = thing -> classInfo; texputintro (file, U"item [", Melder_integer (i), U"]:", 0,0,0); if (! Thing_isa (thing, classDaata) || ! Data_canWriteText (thing)) Melder_throw (U"Objects of class ", classInfo -> className, U" cannot be written."); texputw2 (file, classInfo -> version > 0 ? Melder_cat (classInfo -> className, U" ", classInfo -> version) : classInfo -> className, U"class", 0,0,0,0,0); texputw2 (file, thing -> name, U"name", 0,0,0,0,0); Data_writeText (thing, file); texexdent (file); } texexdent (file); }