URIValue.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <VCardURIValue.h>
00025
00026 #include <VCardValue.h>
00027
00028 using namespace VCARD;
00029
00030 URIValue::URIValue()
00031 : Value()
00032 {
00033 }
00034
00035 URIValue::URIValue(const QCString & scheme, const QCString & schemeSpecificPart)
00036 : Value(),
00037 scheme_ (scheme),
00038 schemeSpecificPart_ (schemeSpecificPart)
00039 {
00040 parsed_ = true;
00041 }
00042
00043 URIValue::URIValue(const URIValue & x)
00044 : Value (x),
00045 scheme_ (x.scheme_),
00046 schemeSpecificPart_ (x.schemeSpecificPart_)
00047 {
00048 }
00049
00050 URIValue::URIValue(const QCString & s)
00051 : Value(s)
00052 {
00053 }
00054
00055 URIValue &
00056 URIValue::operator = (URIValue & x)
00057 {
00058 if (*this == x) return *this;
00059
00060 scheme_ = x.scheme_;
00061 schemeSpecificPart_ = x.schemeSpecificPart_;
00062
00063 Value::operator = (x);
00064 return *this;
00065 }
00066
00067 URIValue &
00068 URIValue::operator = (const QCString & s)
00069 {
00070 Value::operator = (s);
00071 return *this;
00072 }
00073
00074 bool
00075 URIValue::operator == (URIValue & x)
00076 {
00077 x.parse();
00078 return (
00079 (scheme_ == x.scheme_) &&
00080 (schemeSpecificPart_ == x.schemeSpecificPart_));
00081
00082 return false;
00083 }
00084
00085 URIValue::~URIValue()
00086 {
00087 }
00088
00089 void
00090 URIValue::_parse()
00091 {
00092 int split = strRep_.find(':');
00093 if (split == -1)
00094 return;
00095
00096 scheme_ = strRep_.left(split);
00097 schemeSpecificPart_ = strRep_.mid(split + 1);
00098 }
00099
00100 void
00101 URIValue::_assemble()
00102 {
00103 strRep_ = scheme_ + ':' + schemeSpecificPart_;
00104 }
00105
00106 QCString
00107 URIValue::scheme()
00108 {
00109 parse();
00110 return scheme_;
00111 }
00112
00113 QCString
00114 URIValue::schemeSpecificPart()
00115 {
00116 parse();
00117 return schemeSpecificPart_;
00118 }
00119
00120 void
00121 URIValue::setScheme(const QCString & s)
00122 {
00123 parse();
00124 scheme_ = s;
00125 }
00126
00127 void
00128 URIValue::setSchemeSpecificPart(const QCString & s)
00129 {
00130 parse();
00131 schemeSpecificPart_ = s;
00132 }
00133
This file is part of the documentation for kdelibs Version 3.1.5.