Inserts a string into another string.
IppStatus ippsInsert_8u(const Ipp8u* pSrc, int srcLen, const Ipp8u* pInsert, int insertLen, Ipp8u* pDst, int startIndex);
IppStatus ippsInsert_16u(const Ipp16u* pSrc, int srcLen, const Ipp16u* pInsert, int insertLen, Ipp16u* pDst, int startIndex);
IppStatus ippsInsert_8u_I(const Ipp8u* pInsert, int insertLen, Ipp8u* pSrcDst, int* pSrcDstLen, int startIndex);
IppStatus ippsInsert_16u_I(const Ipp16u* pInsert, int insertLen, Ipp16u* pSrcDst, int* pSrcDstLen, int startIndex);
pSrc |
Pointer to the source string. |
srcLen |
Number of elements in the source string. |
pInsert |
Pointer to the string to be inserted. |
insertLen |
Number of elements in the string to be inserted. |
pDst |
Pointer to the destination string. |
pSrcDst |
Pointer to the source and destination string for in-place operation. |
pSrcDstLen |
Pointer to the number of elements in the source and destination string for in-place operation. |
startIndex |
Index of the insertion point. |
The function ippsInsert is declared in the ippch.h file. This function inserts the string pInsert containing insertLen elements into a source string pSrc of length srcLen. Insertion position is specified by startIndex. The result is stored in the pDst.
The in-place flavors of ippsInsert insert the string pInsert in the source string pSrcDst and store the result in the destination string pSrcDst.
Example below shows how to use the function ippsInsert_8u.
ippStsNoErr |
Indicates no error. |
ippStsNullPtrErr |
Indicates an error condition if one of the specified pointers is NULL. |
ippStsLengthErr |
Indicates an error condition if one of the srcLen, insertLen, pSrcSdtLen, startIndex is negative, or startIndex is greater than srcLen or pSrcDstLen. |
Ipp8u string[] = " 1st string part 2nd string part ";
Ipp8u substring[] = " substring ";
Ipp8u dst_string [ sizeof (string) + sizeof (substring) - 1];
int dst_string_len ;
ippsInsert_8u( string, sizeof (string) - 1, substring, sizeof (substring) - 1, dst_string , 16 );
dst_string [ sizeof ( dst_string ) - 1] = 0;
printf ( "ippsInsert_8u returned: %s.\n", (char*) dst_string );
dst_string_len = sizeof ( dst_string ) - 1;
ippsRemove_8u_I( dst_string , & dst_string_len , 16, sizeof (substring) - 1 );
dst_string [ dst_string_len ] = 0;
printf ( "ippsRemove_8u_I returned: %s.\n", (char*) dst_string );
Output:
ippsInsert_8u returned: 1st string part substring 2nd string part .
ippsRemove_8u_I returned: 1st string part 2nd string part .
Copyright © 2000 - 2010, Intel Corporation. All rights reserved.