2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
19 * @file FWebJson_JsonWriterImpl.h
20 * @brief This is the header file for _JsonWriterImpl Class.
23 #ifndef _FWEB_JSON_INTERNAL_JSON_WRITER_IMPL_H_
24 #define _FWEB_JSON_INTERNAL_JSON_WRITER_IMPL_H_
26 #include <FBaseByteBuffer.h>
27 #include <FBaseObject.h>
28 #include <FBaseString.h>
30 namespace Tizen { namespace Web { namespace Json
34 }}} // Tizen::Web::Json
36 namespace Tizen { namespace Web { namespace Json
40 : public Tizen::Base::Object
44 * This functionality is used to serialize json encoded data from JSON value to a string object
47 * @param[in] value JSON value
48 * @param[out] string File path of JSON file
49 * @return An error code
50 * @exception E_SUCCESS The method was successful.
51 * @exception E_FAILURE In case of error.
53 static result Compose(const IJsonValue* pValue, Tizen::Base::String& filePath);
56 * This functionality is used to serialize json encoded data from JSON value to a buffer
59 * @param[in] value A JSON encoded string.
60 * @param[in] bufferLength Json encoded data buffer length.
61 * @param[out] pBuffer Buffer with Json encoded data.
62 * @return An error code
63 * @exception E_SUCCESS The method was successful.
64 * @exception E_FAILURE In case of error.
66 static result Compose(const IJsonValue* pValue, void* pBuffer, int bufferLength);
69 * This functionality is used to serialize json encoded data from JSON value to a byte buffer
72 * @param[in] value A JSON encoded string.
73 * @param[out] buffer Buffer with Json encoded data
74 * @return An error code
75 * @exception E_SUCCESS The method was successful.
76 * @exception E_FAILURE In case of error.
78 static result Compose(const IJsonValue* pValue, Tizen::Base::ByteBuffer& buffer);
82 * This is the default constructor for this class.
84 * @remarks This constructor is hidden.
86 _JsonWriterImpl(void){}
89 * This is the default destructor for this class.
91 * @remarks This constructor is hidden.
93 virtual ~_JsonWriterImpl(void){}
95 static result ConvertIJsonToString(IJsonValue* pValue, Tizen::Base::String& outString);
97 static result ToEscString(const Tizen::Base::String& unEscStr, Tizen::Base::String& escString);
101 }}} // Tizen::Web::Json
102 #endif // _FWEBJSON_INTERNAL_JSON_WRITER_IMPL_H_