2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
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
8 // http://www.apache.org/licenses/LICENSE-2.0
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 express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FBaseUtilInflator.h
19 * @brief This is the header file for the %Inflator class.
21 * This header file contains the declarations of the %Inflator class.
23 #ifndef _FBASE_UTIL_INFLATOR_H_
24 #define _FBASE_UTIL_INFLATOR_H_
26 #include <FBaseByteBuffer.h>
27 #include <FBaseUtilTypes.h>
30 namespace Tizen { namespace Base { namespace Utility
34 * @brief This class provides the inflate functionality using zlib.
38 * The %Inflator class provides the inflate functionality using zlib.
40 * For more information on the class features, see <a href="../org.tizen.native.appprogramming/html/guide/base/utility_namespace.htm">Utility</a>.
42 * The following example demonstrates how to use the %Inflator class.
48 * using namespace Tizen::Base;
49 * using namespace Tizen::Base::Utility;
52 * MyClass::InflatorSample(ByteBuffer &buf)
54 * ByteBuffer* pBuf1 = null;
55 * ByteBuffer* pBuf2 = null;
57 * // Inflates the buf from the current position to limit of the buf
58 * pBuf1 = Inflator::InflateN(buf);
61 * // Error case handling...
63 * // pBuf1 : Inflated Data of buf
66 * // Inflates the buf from the current position to (limit-2) of the buf
67 * pBuf2 = Inflator::InflateN(buf, (buf.GetLimit()-2));
70 * // Error case handling...
80 class _OSP_EXPORT_ Inflator
84 * Inflates the number of bytes from the source byte buffer to the output byte buffer.
88 * @return A pointer to the ByteBuffer instance with the inflated equivalent of the source buffer @n
89 * The buffer's limit is the length of the inflated data, @n
90 * else @c null if an exception occurs.
91 * @param[in] src The buffer to inflate
92 * @param[in] byteCount The number of bytes to inflate from the source buffer
93 * @exception E_SUCCESS The method is successful.
94 * @exception E_INVALID_ARG A specified input parameter is invalid.
95 * @exception E_SYSTEM A system error has occurred.
96 * @remarks The specific error code can be accessed using the GetLastResult() method.
97 * @see Tizen::Base::Utility::Deflator
99 static ByteBuffer* InflateN(const ByteBuffer& src, int byteCount);
102 * Inflates data from the source byte buffer to the output byte buffer.
106 * @return A pointer to the ByteBuffer instance with the inflated equivalent of the source buffer @n
107 * The buffer's limit is the length of the inflated data, @n
108 * else @c null if an exception occurs.
109 * @param[in] src The buffer to inflate
110 * @exception E_SUCCESS The method is successful.
111 * @exception E_INVALID_ARG The specified input parameter is invalid.
112 * @exception E_SYSTEM A system error has occurred.
113 * @remarks The specific error code can be accessed using the GetLastResult() method.
114 * @see Tizen::Base::Utility::Deflator
116 static ByteBuffer* InflateN(const ByteBuffer& src);
119 static ByteBuffer* __InflateN(const ByteBuffer& src, int byteCount);
122 * This default constructor is intentionally declared as private because this class cannot be constructed.
127 * This destructor is intentionally declared as private because this class cannot be constructed.
132 * The implementation of this copy constructor is intentionally blank and declared as private to prohibit copying of objects.
134 * @param[in] rhs An instance of %Inflator
136 Inflator(const Inflator& rhs);
139 * The implementation of this copy assignment operator is intentionally blank and declared as private to prohibit copying of objects.
141 * @param[in] rhs An instance of %Inflator
143 Inflator& operator =(const Inflator& rhs);
147 }}} // Tizen::Base::Utility
149 #endif // _FBASE_UTIL_INFLATOR_H_