size_t Set(const TextBuf &other) { if (other.IsByteStr() ) { return SetText(other.GetText(), other.GetLen()); } else { return SetStr(other.GetStr()); } }
bool operator == (const TextBuf &other) const { if (IsNull() || other.IsNull() ) { return false; } if (IsByteStr() || other.IsByteStr()) { if (GetLen() != other.GetLen()) { return false; } else if (GetLen() == 0) { return true; } else { return (memcmp(GetBuf(), other.GetBuf(), GetLen()) == 0); } } else { return (strcmp(GetBuf(), other.GetBuf()) == 0); } };