xref: /aoo41x/main/soltools/giparser/gen_info.cxx (revision 7a4715d3)
1*7a4715d3SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*7a4715d3SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*7a4715d3SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*7a4715d3SAndrew Rist  * distributed with this work for additional information
6*7a4715d3SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*7a4715d3SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*7a4715d3SAndrew Rist  * "License"); you may not use this file except in compliance
9*7a4715d3SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*7a4715d3SAndrew Rist  *
11*7a4715d3SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*7a4715d3SAndrew Rist  *
13*7a4715d3SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*7a4715d3SAndrew Rist  * software distributed under the License is distributed on an
15*7a4715d3SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*7a4715d3SAndrew Rist  * KIND, either express or implied.  See the License for the
17*7a4715d3SAndrew Rist  * specific language governing permissions and limitations
18*7a4715d3SAndrew Rist  * under the License.
19*7a4715d3SAndrew Rist  *
20*7a4715d3SAndrew Rist  *************************************************************/
21*7a4715d3SAndrew Rist 
22*7a4715d3SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_soltools.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include <gen_info.hxx>
28cdf0e10cSrcweir #include <gi_list.hxx>
29cdf0e10cSrcweir 
30cdf0e10cSrcweir 
GenericInfo(const Simstr & i_sKey,const Simstr & i_sValue,const Simstr & i_sComment)31cdf0e10cSrcweir GenericInfo::GenericInfo( const Simstr &      i_sKey,
32cdf0e10cSrcweir                           const Simstr &      i_sValue,
33cdf0e10cSrcweir                           const Simstr &      i_sComment )
34cdf0e10cSrcweir     :   sKey(i_sKey),
35cdf0e10cSrcweir 	    sValue(i_sValue),
36cdf0e10cSrcweir 	    sComment(i_sComment),
37cdf0e10cSrcweir 	    dpSubList(0)
38cdf0e10cSrcweir {
39cdf0e10cSrcweir }
40cdf0e10cSrcweir 
GenericInfo(const GenericInfo & i_rInfo)41cdf0e10cSrcweir GenericInfo::GenericInfo( const GenericInfo & i_rInfo )
42cdf0e10cSrcweir     :   sKey(i_rInfo.sKey),
43cdf0e10cSrcweir 	    sValue(i_rInfo.sValue),
44cdf0e10cSrcweir 	    sComment(i_rInfo.sComment),
45cdf0e10cSrcweir         dpSubList(0)
46cdf0e10cSrcweir {
47cdf0e10cSrcweir     if ( i_rInfo.HasSubList() )
48cdf0e10cSrcweir     {
49cdf0e10cSrcweir         dpSubList = new List_GenericInfo(i_rInfo.SubList());
50cdf0e10cSrcweir     }
51cdf0e10cSrcweir }
52cdf0e10cSrcweir 
~GenericInfo()53cdf0e10cSrcweir GenericInfo::~GenericInfo()
54cdf0e10cSrcweir {
55cdf0e10cSrcweir     if ( dpSubList != 0 )
56cdf0e10cSrcweir         delete dpSubList;
57cdf0e10cSrcweir }
58cdf0e10cSrcweir 
59cdf0e10cSrcweir GenericInfo &
operator =(const GenericInfo & i_rInfo)60cdf0e10cSrcweir GenericInfo::operator=( const GenericInfo & i_rInfo )
61cdf0e10cSrcweir {
62cdf0e10cSrcweir     sKey = i_rInfo.sKey;
63cdf0e10cSrcweir     sValue = i_rInfo.sValue;
64cdf0e10cSrcweir     sComment = i_rInfo.sComment;
65cdf0e10cSrcweir 
66cdf0e10cSrcweir     if ( dpSubList != 0 )
67cdf0e10cSrcweir         delete dpSubList;
68cdf0e10cSrcweir     if ( i_rInfo.HasSubList() )
69cdf0e10cSrcweir     {
70cdf0e10cSrcweir         dpSubList = new List_GenericInfo(i_rInfo.SubList());
71cdf0e10cSrcweir     }
72cdf0e10cSrcweir     else
73cdf0e10cSrcweir         dpSubList = 0;
74cdf0e10cSrcweir 
75cdf0e10cSrcweir     return *this;
76cdf0e10cSrcweir }
77cdf0e10cSrcweir 
78cdf0e10cSrcweir List_GenericInfo &
CreateMyList() const79cdf0e10cSrcweir GenericInfo::CreateMyList() const
80cdf0e10cSrcweir {
81cdf0e10cSrcweir     return * ( const_cast<GenericInfo&>(*this).dpSubList = new List_GenericInfo);
82cdf0e10cSrcweir 
83cdf0e10cSrcweir }
84cdf0e10cSrcweir 
85