/* OSObject.cpp created by gvdl on Fri 1998-11-17 */
#include <libkern/c++/OSObject.h>
+#include <libkern/c++/OSString.h>
#include <libkern/c++/OSArray.h>
#include <libkern/c++/OSSerialize.h>
#include <libkern/c++/OSLib.h>
bool OSObject::serialize(OSSerialize *s) const
{
- if (s->previouslySerialized(this)) return true;
+ char cstr[128];
+ bool ok;
- if (!s->addXMLStartTag(this, "string")) return false;
+ snprintf(cstr, sizeof(cstr), "%s is not serializable", getClassName(this));
- if (!s->addString(getClassName(this))) return false;
- if (!s->addString(" is not serializable")) return false;
-
- return s->addXMLEndTag("string");
+ OSString * str;
+ str = OSString::withCStringNoCopy(cstr);
+ if (!str) return false;
+
+ ok = str->serialize(s);
+ str->release();
+
+ return (ok);
}