|
1 // Copyright (c) 2004-2009 Nokia Corporation and/or its subsidiary(-ies). |
|
2 // All rights reserved. |
|
3 // This component and the accompanying materials are made available |
|
4 // under the terms of "Eclipse Public License v1.0" |
|
5 // which accompanies this distribution, and is available |
|
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
7 // |
|
8 // Initial Contributors: |
|
9 // Nokia Corporation - initial contribution. |
|
10 // |
|
11 // Contributors: |
|
12 // |
|
13 // Description: |
|
14 // Name : CSIPStrings.cpp |
|
15 // Part of : SIP Codec |
|
16 // Version : SIP/4.0 |
|
17 // |
|
18 |
|
19 |
|
20 |
|
21 #include <stringpool.h> |
|
22 #include "CSIPStrings.h" |
|
23 #include "sipstrconsts.h" |
|
24 #include "_sipcodecdefs.h" |
|
25 |
|
26 // ---------------------------------------------------------------------------- |
|
27 // CSIPStrings::NewLC |
|
28 // ---------------------------------------------------------------------------- |
|
29 // |
|
30 CSIPStrings* CSIPStrings::NewL() |
|
31 { |
|
32 CSIPStrings* self = NewLC(); |
|
33 CleanupStack::Pop(self); |
|
34 return self; |
|
35 } |
|
36 |
|
37 // ---------------------------------------------------------------------------- |
|
38 // CSIPStrings::NewLC |
|
39 // ---------------------------------------------------------------------------- |
|
40 // |
|
41 CSIPStrings* CSIPStrings::NewLC() |
|
42 { |
|
43 CSIPStrings* self = new(ELeave)CSIPStrings; |
|
44 CleanupStack::PushL(self); |
|
45 self->ConstructL(); |
|
46 return self; |
|
47 } |
|
48 |
|
49 // ---------------------------------------------------------------------------- |
|
50 // CSIPStrings::CSIPStrings |
|
51 // ---------------------------------------------------------------------------- |
|
52 // |
|
53 CSIPStrings::CSIPStrings() |
|
54 : iUsageCount(1) |
|
55 { |
|
56 } |
|
57 |
|
58 // ---------------------------------------------------------------------------- |
|
59 // CSIPStrings::ConstructL |
|
60 // ---------------------------------------------------------------------------- |
|
61 // |
|
62 void CSIPStrings::ConstructL() |
|
63 { |
|
64 iPool.OpenL(SipStrConsts::Table); |
|
65 } |
|
66 |
|
67 // ---------------------------------------------------------------------------- |
|
68 // CSIPStrings::~CSIPStrings |
|
69 // ---------------------------------------------------------------------------- |
|
70 // |
|
71 CSIPStrings::~CSIPStrings() |
|
72 { |
|
73 iPool.Close(); |
|
74 } |
|
75 |
|
76 // ----------------------------------------------------------------------------- |
|
77 // CSIPStrings::IncrementUsageCount |
|
78 // ----------------------------------------------------------------------------- |
|
79 // |
|
80 void CSIPStrings::IncrementUsageCount() |
|
81 { |
|
82 iUsageCount++; |
|
83 } |
|
84 |
|
85 // ----------------------------------------------------------------------------- |
|
86 // CSIPStrings::DecrementUsageCount |
|
87 // ----------------------------------------------------------------------------- |
|
88 // |
|
89 void CSIPStrings::DecrementUsageCount() |
|
90 { |
|
91 iUsageCount--; |
|
92 } |
|
93 |
|
94 // ----------------------------------------------------------------------------- |
|
95 // CSIPStrings::UsageCount |
|
96 // ----------------------------------------------------------------------------- |
|
97 // |
|
98 TUint CSIPStrings::UsageCount() |
|
99 { |
|
100 return iUsageCount; |
|
101 } |
|
102 |
|
103 // ---------------------------------------------------------------------------- |
|
104 // CSIPStrings::StringPool |
|
105 // ---------------------------------------------------------------------------- |
|
106 // |
|
107 RStringPool& CSIPStrings::Pool() |
|
108 { |
|
109 return iPool; |
|
110 } |
|
111 |
|
112 // ---------------------------------------------------------------------------- |
|
113 // CSIPStrings::StringTable |
|
114 // ---------------------------------------------------------------------------- |
|
115 // |
|
116 const TStringTable& CSIPStrings::Table() |
|
117 { |
|
118 return SipStrConsts::Table; |
|
119 } |
|
120 |