examples/PIPS/OpenCStringUtilitiesEx/library/inc/stringutils.h

Go to the documentation of this file.
00001 /*
00002 Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
00003 
00004 Redistribution and use in source and binary forms, with or without
00005 modification, are permitted provided that the following conditions are met:
00006 
00007 * Redistributions of source code must retain the above copyright notice, this
00008   list of conditions and the following disclaimer.
00009 * Redistributions in binary form must reproduce the above copyright notice,
00010   this list of conditions and the following disclaimer in the documentation
00011   and/or other materials provided with the distribution.
00012 * Neither the name of Nokia Corporation nor the names of its contributors
00013   may be used to endorse or promote products derived from this software
00014   without specific prior written permission.
00015 
00016 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00017 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00018 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00019 DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
00020 FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
00021 DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
00022 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
00023 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
00024 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
00025 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00026 
00027 Description: 
00028 */
00029 
00030 #ifndef __STRINGUTILS_H__
00031 #define __STRINGUTILS_H__
00032 
00040 //Symbian Headers
00041 #include <e32cmn.h>
00042 #include <wchar.h>
00043 
00055 #define hbufC16towchar  tbufC16towchar
00056 
00059 #define hbufC16tochar   tbufC16tochar
00060 
00063 #define hbufC8towchar   tbufC8towchar
00064 
00067 #define hbufC8tochar    tbufC8tochar
00068 
00069                 
00070 //Function prototypes
00071 
00081 IMPORT_C wchar_t* tbuf16towchar(TDes& aArg);
00082 
00088 IMPORT_C char* tbuf8tochar(TDes8& aArg);
00089 
00100 IMPORT_C int tbuf16tochar(TDes& aSrc, char* aDes);
00101         
00112 IMPORT_C int tbuf8towchar(TDes8& aSrc, wchar_t* aDes);
00113         
00123 IMPORT_C void tbufC16towchar(TDesC& aSrc ,wchar_t* aDes);
00124 
00125   
00136 IMPORT_C void tbufC8tochar(TDesC8& aSrc, char* aDes);
00137 
00148 IMPORT_C int tbufC16tochar(TDesC& aSrc, char* aDes);
00149         
00150         
00161 IMPORT_C int tbufC8towchar(TDesC8& aSrc, wchar_t* aDes);
00162 
00163 
00177 IMPORT_C void wchartotbuf16(const wchar_t *aSrc, TDes16& aDes);
00178         
00179 
00189 IMPORT_C int chartotbuf16(const char* aSrc, TDes16& aDes);
00190         
00201 IMPORT_C int wchartotbuf8(const wchar_t* aSrc, TDes8& aDes);
00202 
00203 
00204  /*
00205   * This Api converts the character string to a TBuf8. It is user 
00206   *     responsibality to allocate a required size of TBuf8 object. Api may     
00207   * resulting in crash, if the destination object size is smaller than
00208   * that of the source.
00209   * @param              aSrc character pointer.
00210   * @param              aDes TBuf8 object, to which the resultant string will be copied.
00211   *     @return         none
00212   */
00213 IMPORT_C void chartotbuf8(const char* aSrc, TDes8& aDes);
00214 
00215 
00224 IMPORT_C void wchartohbufc16(const wchar_t* aSrc, HBufC16& aDes);
00225         
00226 
00236 IMPORT_C int chartohbufc16(const char* aSrc, HBufC16& aDes);
00237         
00247 IMPORT_C int wchartohbufc8(const wchar_t* aSrc, HBufC8& aDes);
00248 
00249   
00250  /*
00251   * This Api converts the char to a HBufC8. It is user responsibality 
00252   * to allocate a required size of HBufC8 object. Api may resulting in crash,
00253   * if the destination object size is smaller than      that of the source.
00254   * @param              aSrc character pointer.
00255   * @param              aDes HBufC8 object, to which the resultant string will be copied.
00256   * @return             none
00257   */
00258 IMPORT_C void chartohbufc8(const char* aSrc, HBufC8& aDes);
00259         
00260 #endif /*__STRINGUTILS_H__*/

Generated by  doxygen 1.6.2