Index: /trunk/include/iprt/cpp/ministring.h
===================================================================
--- /trunk/include/iprt/cpp/ministring.h	(revision 68122)
+++ /trunk/include/iprt/cpp/ministring.h	(revision 68123)
@@ -50,5 +50,5 @@
  * behave the same.  In both cases, RTCString allocates no memory, reports
  * a zero length and zero allocated bytes for both, and returns an empty
- * C string from c_str().
+ * C-style string from c_str().
  *
  * @note    RTCString ASSUMES that all strings it deals with are valid UTF-8.
@@ -92,5 +92,5 @@
 
     /**
-     * Creates a copy of a C string.
+     * Creates a copy of a C-style string.
      *
      * This allocates strlen(pcsz) + 1 bytes for the new instance, unless s is empty.
@@ -126,5 +126,5 @@
 
     /**
-     * Create a partial copy of a C string.
+     * Create a partial copy of a C-style string.
      *
      * @param   a_pszSrc        The source string (UTF-8).
@@ -330,4 +330,48 @@
 
     /**
+     * Assigns a copy of another RTCString.
+     *
+     * @param   a_rSrc          Reference to the source string.
+     * @throws  std::bad_alloc  On allocation error.  The object is left unchanged.
+     */
+    RTCString &assign(const RTCString &a_rSrc);
+
+    /**
+     * Assigns a copy of a C-style string.
+     *
+     * @param   a_pszSrc        Pointer to the C-style source string.
+     * @throws  std::bad_alloc  On allocation error.  The object is left unchanged.
+     * @remarks ASSUMES valid
+     */
+    RTCString &assign(const char *a_pszSrc);
+
+    /**
+     * Assigns a partial copy of another RTCString.
+     *
+     * @param   a_rSrc          The source string.
+     * @param   a_offSrc        The byte offset into the source string.
+     * @param   a_cchSrc        The max number of chars (encoded UTF-8 bytes)
+     *                          to copy from the source string.
+     */
+    RTCString &assign(const RTCString &a_rSrc, size_t a_offSrc, size_t a_cchSrc = npos);
+
+    /**
+     * Assigns a partial copy of a C-style string.
+     *
+     * @param   a_pszSrc        The source string (UTF-8).
+     * @param   a_cchSrc        The max number of chars (encoded UTF-8 bytes)
+     *                          to copy from the source string.
+     */
+    RTCString &assign(const char *a_pszSrc, size_t a_cchSrc);
+
+    /**
+     * Assigs a string containing @a a_cTimes repetitions of the character @a a_ch.
+     *
+     * @param   a_cTimes        The number of times the character is repeated.
+     * @param   a_ch            The character to fill the string with.
+     */
+    RTCString &assign(size_t a_cTimes, char a_ch);
+
+    /**
      * Assigns the output of the string format operation (RTStrPrintf).
      *
@@ -358,24 +402,20 @@
 
     /**
-     * Appends the string @a that to @a this.
-     *
-     * @param   that            The string to append.
-     *
-     * @throws  std::bad_alloc  On allocation error.  The object is left unchanged.
-     *
-     * @returns Reference to the object.
-     */
-    RTCString &append(const RTCString &that);
-
-    /**
-     * Appends the string @a pszThat to @a this.
-     *
-     * @param   pszThat         The C string to append.
-     *
-     * @throws  std::bad_alloc  On allocation error.  The object is left unchanged.
-     *
-     * @returns Reference to the object.
-     */
-    RTCString &append(const char *pszThat);
+     * Appends the string @a that to @a rThat.
+     *
+     * @param   rThat            The string to append.
+     * @throws  std::bad_alloc  On allocation error.  The object is left unchanged.
+     * @returns Reference to the object.
+     */
+    RTCString &append(const RTCString &rThat);
+
+    /**
+     * Appends the string @a pszSrc to @a this.
+     *
+     * @param   pszSrc          The C-style string to append.
+     * @throws  std::bad_alloc  On allocation error.  The object is left unchanged.
+     * @returns Reference to the object.
+     */
+    RTCString &append(const char *pszSrc);
 
     /**
@@ -386,7 +426,5 @@
      *                          not codepoint).
      * @param   cchMax          The maximum number of bytes to append.
-     *
-     * @throws  std::bad_alloc  On allocation error.  The object is left unchanged.
-     *
+     * @throws  std::bad_alloc  On allocation error.  The object is left unchanged.
      * @returns Reference to the object.
      */
@@ -396,9 +434,7 @@
      * Appends the first @a cchMax chars from string @a pszThat to @a this.
      *
-     * @param   pszThat         The C string to append.
+     * @param   pszThat         The C-style string to append.
      * @param   cchMax          The maximum number of bytes to append.
-     *
-     * @throws  std::bad_alloc  On allocation error.  The object is left unchanged.
-     *
+     * @throws  std::bad_alloc  On allocation error.  The object is left unchanged.
      * @returns Reference to the object.
      */
@@ -409,7 +445,5 @@
      *
      * @param   ch              The character to append.
-     *
-     * @throws  std::bad_alloc  On allocation error.  The object is left unchanged.
-     *
+     * @throws  std::bad_alloc  On allocation error.  The object is left unchanged.
      * @returns Reference to the object.
      */
@@ -420,7 +454,5 @@
      *
      * @param   uc              The unicode code point to append.
-     *
-     * @throws  std::bad_alloc  On allocation error.  The object is left unchanged.
-     *
+     * @throws  std::bad_alloc  On allocation error.  The object is left unchanged.
      * @returns Reference to the object.
      */
@@ -430,6 +462,5 @@
      * Shortcut to append(), RTCString variant.
      *
-     * @param that              The string to append.
-     *
+     * @param   rThat           The string to append.
      * @returns Reference to the object.
      */
@@ -442,6 +473,5 @@
      * Shortcut to append(), const char* variant.
      *
-     * @param pszThat           The C string to append.
-     *
+     * @param   pszThat         The C-style string to append.
      * @returns                 Reference to the object.
      */
@@ -579,5 +609,5 @@
      * Returns the byte at the given index, or a null byte if the index is not
      * smaller than length().  This does _not_ count codepoints but simply points
-     * into the member C string.
+     * into the member C-style string.
      *
      * @param   i       The index into the string buffer.
@@ -592,7 +622,8 @@
 
     /**
-     * Returns the contained string as a C-style const char* pointer.
-     * This never returns NULL; if the string is empty, this returns a
-     * pointer to static null byte.
+     * Returns the contained string as a const C-style string pointer.
+     *
+     * This never returns NULL; if the string is empty, this returns a pointer to
+     * static null byte.
      *
      * @returns const pointer to C-style string.
Index: /trunk/src/VBox/Runtime/common/string/ministring.cpp
===================================================================
--- /trunk/src/VBox/Runtime/common/string/ministring.cpp	(revision 68122)
+++ /trunk/src/VBox/Runtime/common/string/ministring.cpp	(revision 68123)
@@ -50,4 +50,79 @@
 
 
+RTCString &RTCString::assign(const RTCString &a_rSrc)
+{
+    size_t const cchSrc = a_rSrc.length();
+    if (cchSrc > 0)
+    {
+        reserve(cchSrc + 1);
+        memcpy(m_psz, a_rSrc.c_str(), cchSrc);
+        m_psz[cchSrc] = '\0';
+        m_cch = cchSrc;
+        return *this;
+    }
+    setNull();
+    return *this;
+
+}
+
+RTCString &RTCString::assign(const char *a_pszSrc)
+{
+    if (a_pszSrc)
+    {
+        size_t cchSrc = strlen(a_pszSrc);
+        if (cchSrc)
+        {
+            reserve(cchSrc + 1);
+            memcpy(m_psz, a_pszSrc, cchSrc);
+            m_psz[cchSrc] = '\0';
+            m_cch = cchSrc;
+            return *this;
+        }
+    }
+    setNull();
+    return *this;
+}
+
+RTCString &RTCString::assign(const RTCString &a_rSrc, size_t a_offSrc, size_t a_cchSrc /*= npos*/)
+{
+    AssertReturn(&a_rSrc != this, *this);
+    if (a_offSrc < a_rSrc.length())
+    {
+        size_t cchMax = a_rSrc.length() - a_offSrc;
+        if (a_cchSrc > cchMax)
+            a_cchSrc = cchMax;
+        reserve(a_cchSrc + 1);
+        memcpy(m_psz, a_rSrc.c_str(), a_cchSrc);
+        m_psz[a_cchSrc] = '\0';
+        m_cch = a_cchSrc;
+    }
+    else
+        setNull();
+    return *this;
+}
+
+RTCString &RTCString::assign(const char *a_pszSrc, size_t a_cchSrc)
+{
+    if (a_cchSrc)
+    {
+        a_cchSrc = RTStrNLen(a_pszSrc, a_cchSrc);
+        reserve(a_cchSrc + 1);
+        memcpy(m_psz, a_pszSrc, a_cchSrc);
+        m_psz[a_cchSrc] = '\0';
+        m_cch = a_cchSrc;
+    }
+    else
+        setNull();
+    return *this;
+}
+
+RTCString &RTCString::assign(size_t a_cTimes, char a_ch)
+{
+    reserve(a_cTimes + 1);
+    memset(m_psz, a_ch, a_cTimes);
+    return *this;
+}
+
+
 RTCString &RTCString::printf(const char *pszFormat, ...)
 {
