1 /* ------------------------------------------------------------------ 2 * Copyright (C) 1998-2009 PacketVideo 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either 13 * express or implied. 14 * See the License for the specific language governing permissions 15 * and limitations under the License. 16 * ------------------------------------------------------------------- 17 */ 18 // -*- c++ -*- 19 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 20 21 // O S C L _ S T R I N G _ U R I 22 23 // = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = 24 25 /*! \addtogroup osclutil OSCL Util 26 * 27 * @{ 28 */ 29 30 31 /** \file oscl_string_uri.h 32 \brief Utilities to unescape URIs. 33 */ 34 35 /*! 36 * \par URI String Manipualation 37 * These routines handle all of the special escape sequences in the URI. 38 * 39 */ 40 #ifndef OSCL_STRING_URI_H 41 #define OSCL_STRING_URI_H 42 43 // - - Inclusion - - - - - - - - - - - - - - - - - - - - - - - - - - - - 44 #ifndef OSCL_BASE_H_INCLUDED 45 #include "oscl_base.h" 46 #endif 47 #ifndef OSCL_STRING_H_INCLUDED 48 #include "oscl_string.h" 49 #endif 50 51 // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 52 // Function prototypes 53 /*! 54 \brief unescape any of the special escape sequence in the uri string 55 56 The function scans the string and replaces each escape sequence with its corresponding 57 character. It stops at the first null character, or the max_byte value. 58 It returns false if the string contains any illegal escape sequence or the output 59 buffer is not big enough. The out_buf_len value indicates the needed buffer length 60 or the index of the byte that causes the error respectively. 61 62 \param str_buf_in Ptr to an input string 63 \param str_buf_out Ptr to an output buffer which stores the modified string 64 \param max_out_buf_bytes The size of str_buf_out. 65 \param max_bytes The maximum number of bytes to read. 66 It is the length of str_buf_in. 67 \param out_buf_len The length of the result string (not including the null character) 68 \return It returns true if succeeds, otherwise false. 69 70 */ 71 OSCL_IMPORT_REF bool oscl_str_unescape_uri(const char *str_buf_in, char *str_buf_out, uint32 max_out_buf_bytes, uint32 max_bytes, uint32& out_buf_len); 72 /*! 73 \brief unescape any of the special escape sequence in the uri string 74 75 The function scans the string and replaces each escape sequence with its corresponding 76 character. It stops at the first null character, or the max_byte value. 77 It returns false if the string contains any illegal escape sequence or the output 78 buffer is not big enough. The out_buf_len value indicates the needed buffer length 79 or the index of the byte that causes the error respectively. 80 81 \param oscl_str_in Ptr to an input OSCL_String 82 \param oscl_str_out Ptr to an output OSCL_String which stores the modified string 83 \param out_buf_len The length of the result string (not including the null character) 84 \return It returns true if succeeds, otherwise false. 85 */ 86 //Old Definition 87 //bool oscl_str_unescape_uri(const OSCL_String<char>& oscl_str_in, OSCL_String<char>& oscl_str_out, uint32& out_buf_len); 88 //New definition 89 OSCL_IMPORT_REF bool oscl_str_unescape_uri(const OSCL_String& oscl_str_in, OSCL_String& oscl_str_out, uint32& out_buf_len); 90 #endif 91 92 /*! @} */ 93