2 // Open Service Platform
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
18 * @file FScl_UrlImpl.cpp
19 * @brief This is the implementation for _UrlImpl class.
21 * This file contains definitions of @e _UrlImpl class.
24 #include <FBaseSysLog.h>
26 #include <FApp_AppInfo.h>
27 #include "FScl_UrlImpl.h"
29 using namespace Tizen::App;
30 using namespace Tizen::Base;
32 namespace Tizen { namespace Social
35 _UrlImpl::_UrlImpl(void)
36 : __type(URL_TYPE_PERSONAL)
41 _UrlImpl::_UrlImpl(UrlType type, const String& url)
48 _UrlImpl::_UrlImpl(const _UrlImpl& rhs)
51 __label = rhs.__label;
55 _UrlImpl::~_UrlImpl(void)
61 _UrlImpl::operator =(const _UrlImpl& rhs)
69 __label = rhs.__label;
76 _UrlImpl::operator ==(const _UrlImpl& rhs) const
78 if (__type == rhs.__type && __label == rhs.__label && __url == rhs.__url)
87 _UrlImpl::operator !=(const _UrlImpl& rhs) const
89 return !(*this == rhs);
93 _UrlImpl::Equals(const Object& rhs) const
95 const _UrlImpl* pUrl = dynamic_cast<const _UrlImpl*>(&rhs);
102 return (*this == *pUrl);
106 _UrlImpl::GetHashCode(void) const
111 hashCode += __label.GetHashCode();
112 hashCode += __url.GetHashCode();
118 _UrlImpl::GetType(void) const
124 _UrlImpl::GetUrl(void) const
130 _UrlImpl::SetType(UrlType type)
136 _UrlImpl::SetUrl(const String& url)
138 SysTryReturn(NID_SCL, !url.IsEmpty(), E_INVALID_ARG, E_INVALID_ARG, "[%s] Invalid argument is used. The url is empty", GetErrorMessage(E_INVALID_ARG));
146 _UrlImpl::GetLabel(void) const
152 _UrlImpl::SetLabel(const String& label)
158 _UrlImpl::GetInstance(const Url& url)
160 return url.__pUrlImpl;
164 _UrlImpl::GetInstance(Url& url)
166 return url.__pUrlImpl;