Implementation of ImmutableString
[platform/framework/native/appfw.git] / src / base / inc / FBase_StringBuffer.h
1 //
2 // Copyright (c) 2013 Samsung Electronics Co., Ltd.
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 express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file        FBase_StringBuffer.h
19  * @brief       This is the header file for the %_StringBuffer class.
20  *
21  * This file contains the declarations of the %_StringBuffer class.
22  */
23
24 #ifndef _FBASE_INTERNAL_STRING_BUFFER_H_
25 #define _FBASE_INTERNAL_STRING_BUFFER_H_
26
27 namespace Tizen {namespace Base
28 {
29
30 class String;
31 class ImmutalbeString;
32
33 class _StringBuffer
34 {
35 public:
36         _StringBuffer(const wchar_t* pStr);
37         _StringBuffer(const char* pStr);
38         _StringBuffer(const String& value);
39         _StringBuffer(const wchar_t* pStr1, const wchar_t* pStr2);
40         explicit _StringBuffer(int capacity);
41         ~_StringBuffer(void);
42
43         static _StringBuffer* Format(int length, const wchar_t* pFormat, __builtin_va_list& args);
44         _StringBuffer* Insert(const _StringBuffer* pStr, int indexAt) const;
45         _StringBuffer* Remove(int startIndex, int length) const;
46         _StringBuffer* Replace(wchar_t original, wchar_t replace) const;
47         _StringBuffer* Replace(const _StringBuffer* pOriginal, const _StringBuffer* pReplace, int startIndex) const;
48         _StringBuffer* Reverse(void) const;
49         _StringBuffer* SetCharAt(wchar_t ch, int indexAt) const;
50         _StringBuffer* SubString(int startIndex, int length) const;
51         _StringBuffer* ToUpperCase(void) const;
52         _StringBuffer* ToLowerCase(void) const;
53         _StringBuffer* Trim(void) const;
54         int GetHashCode(const wchar_t* pValue);
55
56         wchar_t* __pValue;
57         int __length;
58         int __hash;
59         volatile int __refCount;
60
61 };
62 }} // Tizen::Base
63 #endif // _FBASE_INTERNAL_STRING_BUFFER_H_