VirtualBox

Changeset 17646 in vbox for trunk/include/VBox/com


Ignore:
Timestamp:
Mar 10, 2009 5:47:31 PM (16 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
44134
Message:

OVF: add actual image export

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/VBox/com/string.h

    r17634 r17646  
    409409    }
    410410
     411    void append(const Utf8Str &that)
     412    {
     413        size_t cbThis = length();
     414        size_t cbThat = that.length();
     415
     416        if (cbThat)
     417        {
     418            size_t cbBoth = cbThis + cbThat + 1;
     419
     420            // @todo optimize
     421            char *pszTemp;
     422#if !defined (VBOX_WITH_XPCOM)
     423            pszTemp = (char*)::RTMemTmpAlloc(cbBoth);
     424#else
     425            pszTemp = (char*)nsMemory::Alloc(cbBoth);
     426#endif
     427            if (str)
     428            {
     429                memcpy(pszTemp, str, cbThis);
     430                setNull();
     431            }
     432            if (that.str)
     433                memcpy(pszTemp + cbThis, that.str, cbThat);
     434            pszTemp[cbThis + cbThat] = '\0';
     435
     436            str = pszTemp;
     437        }
     438    }
     439
    411440    int compare (const char *s) const
    412441    {
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette