summaryrefslogtreecommitdiffabout
path: root/kabc/vcard/Param.cpp
Unidiff
Diffstat (limited to 'kabc/vcard/Param.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kabc/vcard/Param.cpp129
1 files changed, 129 insertions, 0 deletions
diff --git a/kabc/vcard/Param.cpp b/kabc/vcard/Param.cpp
new file mode 100644
index 0000000..c513613
--- a/dev/null
+++ b/kabc/vcard/Param.cpp
@@ -0,0 +1,129 @@
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 <VCardParam.h>
25
26#include <VCardEntity.h>
27
28#include <VCardRToken.h>
29
30using namespace VCARD;
31
32Param::Param()
33 :Entity(),
34 name_(""),
35 value_("")
36{
37}
38
39Param::Param(const Param & x)
40 :Entity(x),
41 name_(x.name_),
42 value_(x.value_)
43{
44}
45
46Param::Param(const QCString & s)
47 :Entity(s),
48 name_(""),
49 value_("")
50{
51}
52
53 Param &
54Param::operator = (Param & x)
55{
56 if (*this == x) return *this;
57
58 Entity::operator = (x);
59 name_ = x.name_;
60 value_ = x.value_;
61
62 return *this;
63}
64
65 Param &
66Param::operator = (const QCString & s)
67{
68 Entity::operator = (s);
69 return *this;
70}
71
72 bool
73Param::operator == (Param & x)
74{
75 x.parse();
76 return false;
77}
78
79Param::~Param()
80{
81}
82
83 void
84Param::_parse()
85{
86}
87
88 void
89Param::_assemble()
90{
91 strRep_ = name_ + "=" + value_;
92}
93
94Param::Param(const QCString &name, const QCString &value)
95 :Entity(),
96 name_(name),
97 value_(value)
98{
99 parsed_ = true;
100 assembled_ = false;
101}
102
103 void
104Param::setName(const QCString & name)
105{
106 name_ = name;
107
108 assembled_ = false;
109}
110
111 void
112Param::setValue(const QCString & value)
113{
114 value_ = value;
115
116 assembled_ = false;
117}
118
119 QCString
120Param::name()
121{
122 return name_;
123}
124
125 QCString
126Param::value()
127{
128 return value_;
129}