VirtualBox

Changeset 36407 in vbox for trunk/include/iprt


Ignore:
Timestamp:
Mar 24, 2011 4:14:57 PM (14 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
70762
Message:

IPRT: Added RTStrCopyP, RTStrCopyPEx, RTStrCatP and RTStrCatPEx. These functions will advance the destination buffer pointer and size parameters.

Location:
trunk/include/iprt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/mangling.h

    r36267 r36407  
    11231123#define RTStrCat                                RT_MANGLER(RTStrCat)
    11241124#define RTStrCatEx                              RT_MANGLER(RTStrCatEx)
     1125#define RTStrCatP                               RT_MANGLER(RTStrCatP)
     1126#define RTStrCatPEx                             RT_MANGLER(RTStrCatPEx)
    11251127#define RTStrCmp                                RT_MANGLER(RTStrCmp)
    11261128#define RTStrConvertHexBytes                    RT_MANGLER(RTStrConvertHexBytes)
    11271129#define RTStrCopy                               RT_MANGLER(RTStrCopy)
    11281130#define RTStrCopyEx                             RT_MANGLER(RTStrCopyEx)
     1131#define RTStrCopyP                              RT_MANGLER(RTStrCopyP)
     1132#define RTStrCopyPEx                            RT_MANGLER(RTStrCopyPEx)
    11291133#define RTStrCurrentCPToUtf8Tag                 RT_MANGLER(RTStrCurrentCPToUtf8Tag)
    11301134#define RTStrDupExTag                           RT_MANGLER(RTStrDupExTag)
  • trunk/include/iprt/string.h

    r35585 r36407  
    21512151
    21522152/**
     2153 * String copy with overflow handling and buffer advancing.
     2154 *
     2155 * @retval  VINF_SUCCESS on success.
     2156 * @retval  VERR_BUFFER_OVERFLOW if the destination buffer is too small.  The
     2157 *          buffer will contain as much of the string as it can hold, fully
     2158 *          terminated.
     2159 *
     2160 * @param   ppszDst             Pointer to the destination buffer pointer.
     2161 *                              This will be advanced to the end of the copied
     2162 *                              bytes (points at the terminator).  This is also
     2163 *                              updated on overflow.
     2164 * @param   pcbDst              Pointer to the destination buffer size
     2165 *                              variable.  This will be updated in accord with
     2166 *                              the buffer pointer.
     2167 * @param   pszSrc              The source string.  NULL is not OK.
     2168 */
     2169RTDECL(int) RTStrCopyP(char **ppszDst, size_t *pcbDst, const char *pszSrc);
     2170
     2171/**
     2172 * String copy with overflow handling.
     2173 *
     2174 * @retval  VINF_SUCCESS on success.
     2175 * @retval  VERR_BUFFER_OVERFLOW if the destination buffer is too small.  The
     2176 *          buffer will contain as much of the string as it can hold, fully
     2177 *          terminated.
     2178 *
     2179 * @param   ppszDst             Pointer to the destination buffer pointer.
     2180 *                              This will be advanced to the end of the copied
     2181 *                              bytes (points at the terminator).  This is also
     2182 *                              updated on overflow.
     2183 * @param   pcbDst              Pointer to the destination buffer size
     2184 *                              variable.  This will be updated in accord with
     2185 *                              the buffer pointer.
     2186 * @param   pszSrc              The source string.  NULL is not OK.
     2187 * @param   cchSrcMax           The maximum number of chars (not code points) to
     2188 *                              copy from the source string, not counting the
     2189 *                              terminator as usual.
     2190 */
     2191RTDECL(int) RTStrCopyPEx(char **ppszDst, size_t *pcbDst, const char *pszSrc, size_t cchSrcMax);
     2192
     2193/**
    21532194 * String concatenation with overflow handling.
    21542195 *
     
    21802221 */
    21812222RTDECL(int) RTStrCatEx(char *pszDst, size_t cbDst, const char *pszSrc, size_t cchSrcMax);
     2223
     2224/**
     2225 * String concatenation with overflow handling.
     2226 *
     2227 * @retval  VINF_SUCCESS on success.
     2228 * @retval  VERR_BUFFER_OVERFLOW if the destination buffer is too small.  The
     2229 *          buffer will contain as much of the string as it can hold, fully
     2230 *          terminated.
     2231 *
     2232 * @param   ppszDst             Pointer to the destination buffer pointer.
     2233 *                              This will be advanced to the end of the copied
     2234 *                              bytes (points at the terminator).  This is also
     2235 *                              updated on overflow.
     2236 * @param   pcbDst              Pointer to the destination buffer size
     2237 *                              variable.  This will be updated in accord with
     2238 *                              the buffer pointer.
     2239 * @param   pszSrc              The source string.  NULL is not OK.
     2240 */
     2241RTDECL(int) RTStrCatP(char **ppszDst, size_t *pcbDst, const char *pszSrc);
     2242
     2243/**
     2244 * String concatenation with overflow handling and buffer advancing.
     2245 *
     2246 * @retval  VINF_SUCCESS on success.
     2247 * @retval  VERR_BUFFER_OVERFLOW if the destination buffer is too small.  The
     2248 *          buffer will contain as much of the string as it can hold, fully
     2249 *          terminated.
     2250 *
     2251 * @param   ppszDst             Pointer to the destination buffer pointer.
     2252 *                              This will be advanced to the end of the copied
     2253 *                              bytes (points at the terminator).  This is also
     2254 *                              updated on overflow.
     2255 * @param   pcbDst              Pointer to the destination buffer size
     2256 *                              variable.  This will be updated in accord with
     2257 *                              the buffer pointer.
     2258 * @param   pszSrc              The source string.  NULL is not OK.
     2259 * @param   cchSrcMax           The maximum number of chars (not code points) to
     2260 *                              copy from the source string, not counting the
     2261 *                              terminator as usual.
     2262 */
     2263RTDECL(int) RTStrCatPEx(char **ppszDst, size_t *pcbDst, const char *pszSrc, size_t cchSrcMax);
    21822264
    21832265/**
Note: See TracChangeset for help on using the changeset viewer.

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