• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeabc
 

tdeabc

  • tdeabc
  • vcard
AdrValue.cpp
1/*
2 libvcard - vCard parsing library for vCard version 3.0
3
4 Copyright (C) 1998 Rik Hemsley rik@kde.org
5
6 Permission is hereby granted, free of charge, to any person obtaining a copy
7 of this software and associated documentation files (the "Software"), to
8 deal in the Software without restriction, including without limitation the
9 rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10 sell copies of the Software, and to permit persons to whom the Software is
11 furnished to do so, subject to the following conditions:
12
13 The above copyright notice and this permission notice shall be included in
14 all copies or substantial portions of the Software.
15
16 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
20 ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
21 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22*/
23
24#include <VCardRToken.h>
25#include <VCardAdrValue.h>
26#include <VCardValue.h>
27#include <VCardDefines.h>
28
29using namespace VCARD;
30
31AdrValue::AdrValue()
32 : Value()
33{
34}
35
36AdrValue::AdrValue(const AdrValue & x)
37 : Value(x),
38 poBox_ (x.poBox_),
39 extAddress_ (x.extAddress_),
40 street_ (x.street_),
41 locality_ (x.locality_),
42 region_ (x.region_),
43 postCode_ (x.postCode_),
44 countryName_ (x.countryName_)
45{
46}
47
48AdrValue::AdrValue(const TQCString & s)
49 : Value(s)
50{
51}
52
53 AdrValue &
54AdrValue::operator = (AdrValue & x)
55{
56 if (*this == x) return *this;
57
58 poBox_ = x.poBox_;
59 extAddress_ = x.extAddress_;
60 street_ = x.street_;
61 locality_ = x.locality_;
62 region_ = x.region_;
63 postCode_ = x.postCode_;
64 countryName_ = x.countryName_;
65
66 Value::operator = (x);
67 return *this;
68}
69
70 AdrValue &
71AdrValue::operator = (const TQCString & s)
72{
73 Value::operator = (s);
74 return *this;
75}
76
77 bool
78AdrValue::operator == (AdrValue & x)
79{
80 parse();
81 x.parse();
82
83 return (
84 poBox_ == x.poBox_ &&
85 extAddress_ == x.extAddress_ &&
86 street_ == x.street_ &&
87 locality_ == x.locality_ &&
88 region_ == x.region_ &&
89 postCode_ == x.postCode_ &&
90 countryName_ == x.countryName_);
91}
92
93AdrValue::~AdrValue()
94{
95}
96
97 AdrValue *
98AdrValue::clone()
99{
100 return new AdrValue( *this );
101}
102
103 void
104AdrValue::_parse()
105{
106 vDebug("AdrValue::_parse()");
107
108 TQStrList l;
109 RTokenise(strRep_, ";", l);
110
111 for (unsigned int i = 0; i < l.count(); i++) {
112
113 switch (i) {
114
115 case 0: poBox_ = l.at(0); break;
116 case 1: extAddress_ = l.at(1); break;
117 case 2: street_ = l.at(2); break;
118 case 3: locality_ = l.at(3); break;
119 case 4: region_ = l.at(4); break;
120 case 5: postCode_ = l.at(5); break;
121 case 6: countryName_ = l.at(6); break;
122 default: break;
123 }
124 }
125}
126
127 void
128AdrValue::_assemble()
129{
130 vDebug("AdrValue::_assemble");
131
132 strRep_ = poBox_;
133 strRep_ += ";" + extAddress_;
134 strRep_ += ";" + street_;
135 strRep_ += ";" + locality_;
136 strRep_ += ";" + region_;
137 strRep_ += ";" + postCode_;
138 strRep_ += ";" + countryName_;
139}
140

tdeabc

Skip menu "tdeabc"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeabc

Skip menu "tdeabc"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeabc by doxygen 1.9.4
This website is maintained by Timothy Pearson.