VirtualBox

Changeset 34846 in vbox for trunk/include


Ignore:
Timestamp:
Dec 8, 2010 5:50:25 PM (14 years ago)
Author:
vboxsync
Message:

COM glue: Added a substring constructor to the Bstr class (with optimized memory usage compared to the others).

File:
1 edited

Legend:

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

    r34837 r34846  
    125125    }
    126126
     127    Bstr(const char *a_pThat, size_t a_cchMax)
     128    {
     129        copyFromN(a_pThat, a_cchMax);
     130    }
     131
    127132    ~Bstr()
    128133    {
     
    389394    }
    390395
     396    /**
     397     * Variant of copyFrom for sub-string constructors.
     398     *
     399     * @param   a_pszSrc            The source string.
     400     * @param   a_cchMax            The maximum number of chars (not
     401     *                              codepoints) to copy.  If you pass RTSTR_MAX
     402     *                              it'll be exactly like copyFrom().
     403     * @throws  std::bad_alloc
     404     */
     405    void copyFromN(const char *a_pszSrc, size_t a_cchSrc);
     406
    391407    BSTR m_bstr;
    392408
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