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 FTextLatin1Encoding.cpp
20 * @brief This is the implementation file for Latin1 Encoding class.
23 #include <FTextLatin1Encoding.h>
24 #include <FBaseSysLog.h>
25 #include "FText_EncodingImpl.h"
28 #define ENCODING_NAME L"ISO-8859-1"
30 using namespace Tizen::Base;
32 namespace Tizen { namespace Text
36 Latin1Encoding::Latin1Encoding(void)
37 : __pLatin1EncodingImpl(null)
39 _pEncodingImpl = new (std::nothrow) _EncodingImpl;
42 result r = _pEncodingImpl->Construct(ENCODING_NAME);
45 delete _pEncodingImpl;
46 _pEncodingImpl = null;
50 SysAssert(_pEncodingImpl);
54 Latin1Encoding::~Latin1Encoding(void)
56 delete _pEncodingImpl;
61 Latin1Encoding::GetBytesN(const WcharBuffer& chars) const
63 return _pEncodingImpl->GetBytesN(chars);
67 Latin1Encoding::GetBytesN(const String& str) const
69 return _pEncodingImpl->GetBytesN(str);
74 Latin1Encoding::GetBytes(const WcharBuffer& chars, int charIndex, int charCount, ByteBuffer& bytes, int byteIndex) const
76 return _pEncodingImpl->GetBytes(chars, charIndex, charCount, bytes, byteIndex);
81 Latin1Encoding::GetBytes(const String& str, int charIndex, int charCount, ByteBuffer& bytes, int byteIndex) const
83 return _pEncodingImpl->GetBytes(str, charIndex, charCount, bytes, byteIndex);
88 Latin1Encoding::GetCharsN(const ByteBuffer& bytes) const
90 return _pEncodingImpl->GetCharsN(bytes);
95 Latin1Encoding::GetChars(const ByteBuffer& bytes, int byteIndex, int byteCount, WcharBuffer& chars, int charIndex) const
97 return _pEncodingImpl->GetChars(bytes, byteIndex, byteCount, chars, charIndex);
102 Latin1Encoding::GetString(const ByteBuffer& bytes, String& str) const
104 return _pEncodingImpl->GetString(bytes, str);
109 Latin1Encoding::GetString(const ByteBuffer& bytes, int byteIndex, int byteCount, String& str) const
111 return _pEncodingImpl->GetString(bytes, byteIndex, byteCount, str);
116 Latin1Encoding::GetMaxByteCount(int charCount) const
123 Latin1Encoding::GetMaxCharCount(int byteCount) const
130 Latin1Encoding::GetEncoderN(void) const
137 Latin1Encoding::GetDecoderN(void) const
144 Latin1Encoding::GetEncodingType(void) const
146 return String(ENCODING_NAME);