|
1 /* |
|
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * Header STRNG.H |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 #ifndef __STRNG_H__ |
|
21 #define __STRNG_H__ |
|
22 |
|
23 #include <string.h> |
|
24 #include <stdlib.h> |
|
25 |
|
26 #if defined(__VC32__) && !defined(__MSVCDOTNET__) |
|
27 #include <iostream.h> |
|
28 #else //!__VC32__ || __MSVCDOTNET__ |
|
29 #include <iostream> |
|
30 using namespace std; |
|
31 #endif //!__VC32__ || __MSVCDOTNET__ |
|
32 |
|
33 #include "GDR.H" |
|
34 |
|
35 class String |
|
36 /** |
|
37 NB only byte strings supported, no Unicode yet |
|
38 @publishedAll |
|
39 WARNING: Class for internal use ONLY. Compatibility is not guaranteed in future releases. |
|
40 */ |
|
41 { |
|
42 public: |
|
43 inline String(); |
|
44 inline String(const char* aText); |
|
45 inline String(int aLength, char* aText); |
|
46 inline String(const String& aString); |
|
47 inline String& operator = (const char* aText); |
|
48 inline String& operator = (const String& aString); |
|
49 inline String& operator += (const char aChar); |
|
50 inline String& operator += (const String& aString); |
|
51 inline int operator == (const String& aString) const; |
|
52 inline char& operator [] (const int aNum) const; |
|
53 inline int Length() const; |
|
54 inline const char* Text(); |
|
55 IMPORT_C virtual void Externalize(ostream& out); |
|
56 protected: |
|
57 inline void CopyText(char* aDest, const char* aSource, int aLength) const; |
|
58 IMPORT_C int CreateText(const int aLength); |
|
59 IMPORT_C void DeleteText(char* aText) const; |
|
60 public: |
|
61 IMPORT_C ~String(); |
|
62 protected: |
|
63 int32 iLength; // length of string |
|
64 char* iText; // data |
|
65 friend ostream& operator << (ostream& out, const String& aString); |
|
66 }; |
|
67 |
|
68 #include "STRNG.INL" |
|
69 |
|
70 #endif |