예제 #1
0
UString::UString(const DOM::DOMString &d)
{
  if (d.isNull()) {
    attach(&Rep::null);
    return;
  }

  unsigned int len = d.length();
  UChar *dat = new UChar[len];
  memcpy(dat, d.unicode(), len * sizeof(UChar));
  rep = UString::Rep::create(dat, len);
}
예제 #2
0
UString::UString(const DOM::DOMString &d)
{
    if(d.isNull())
    {
        // we do a conversion here as null DOMStrings shouldn't cross
        // the boundary to kjs. They should either be empty strings
        // or explicitly converted to KJS::Null via getString().
        attach(&Rep::empty);
        return;
    }

    unsigned int len = d.length();
    UChar *dat = new UChar[len];
    memcpy(dat, d.unicode(), len * sizeof(UChar));
    rep = UString::Rep::create(dat, len);
}