2 * Copyright (c) 2000-2015 Samsung Electronics Co., Ltd.
4 * Licensed under the Flora License, Version 1.1 (the License);
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://floralicense.org/license/
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an AS IS BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "CXMLAttribute.h"
19 #include "TADC_ErrorCode.h"
21 //////////////////////////////////////////////////////////////////////
22 // Construction/Destruction
23 //////////////////////////////////////////////////////////////////////
25 CXMLAttribute::CXMLAttribute()
30 CXMLAttribute::~CXMLAttribute()
39 // [in] pszName : should be null-terminated string
40 int CXMLAttribute::SetName(LPCTSTR pszName)
43 size_t pszNameLen = 0;
50 pszNameLen = strlen(pszName);
52 m_pszName = new CHAR[pszNameLen + 1];
53 IF_TRUE_GOTO(m_pszName == NULL, ERROR_NOT_ENOUGH_MEMORY);
55 memcpy(m_pszName, pszName, pszNameLen + 1);
60 DRM_TAPPS_EXCEPTION("CXMLAttribute::SetName() Error!");
65 // [in] pszValue : should be null-terminated string
66 int CXMLAttribute::SetValue(LPCTSTR pszValue)
69 size_t pszValueLen = 0;
76 pszValueLen = strlen(pszValue);
78 m_pszValue = new CHAR[pszValueLen + 1];
79 IF_TRUE_GOTO(m_pszName == NULL, ERROR_NOT_ENOUGH_MEMORY);
81 memcpy(m_pszValue, pszValue, pszValueLen + 1);
86 DRM_TAPPS_EXCEPTION("CXMLAttribute::SetValue() Error!");