wrt-plugins-tizen_0.4.23
[framework/web/wrt-plugins-tizen.git] / src / Content / ContentFolder.cpp
1 //
2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 //
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
8 //
9 // http://www.apache.org/licenses/LICENSE-2.0
10 //
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.
16 //
17
18 #include <Commons/Exception.h>
19 #include "ContentFolder.h"
20 #include <Logger.h>
21
22 namespace DeviceAPI {
23 namespace Content {
24
25
26 MediacontentFolder::MediacontentFolder()
27 {
28     m_modifiedDate = NULL;
29
30 }
31
32 MediacontentFolder::~MediacontentFolder()
33 {
34     if(m_modifiedDate != NULL)
35     {
36         free(m_modifiedDate);
37     }
38 }
39
40
41 string MediacontentFolder::getFolderUUID() const
42 {
43     return m_folderUUID;
44 }
45
46 void MediacontentFolder::setFolderUUID(const string &value)
47 {
48         m_folderUUID = value;
49 }
50
51
52 string MediacontentFolder::getFolderName() const
53 {
54     return m_folderName;
55 }
56
57 void MediacontentFolder::setFolderName(const string &value)
58 {
59         m_folderName = value;
60 }
61
62 string MediacontentFolder::getFolderPath() const
63 {
64         return m_folderPath;
65
66 }
67
68 void MediacontentFolder::setFolderPath(const string &value)
69 {
70         m_folderPath = value;
71
72 }
73
74 string MediacontentFolder::getFolderStorageType()
75 {
76         return m_storageType;   
77 }
78
79 void MediacontentFolder::setFolderStorageType(const string &value)
80 {
81         m_storageType = value;
82
83 }
84 tm* MediacontentFolder::getFolderModifiedDate() const
85 {
86         return m_modifiedDate;
87 }
88
89 MediaIdListPtr MediacontentFolder::getMediaIdList() const
90 {
91         return m_mediaIdArrayPtr;
92 }
93
94
95 void MediacontentFolder::setFolderModifiedDate(tm *value)
96 {
97         m_modifiedDate = value;
98
99 }
100
101 void MediacontentFolder::setMediaIdList(const MediaIdListPtr &value)
102 {
103         m_mediaIdArrayPtr = value;
104
105 }
106
107
108 void MediacontentFolder::insertValue(string attrName, string value)
109 {
110         m_folderValue.insert(pair<string, string>(attrName,value));
111 }
112
113 string MediacontentFolder::findValue(string attrName)
114 {
115
116         string value;
117         
118         map<string, string>::iterator pos;
119
120         pos = m_folderValue.find(attrName);
121
122         if(m_folderValue.end() != pos)
123         {
124                 value = pos->second;
125         }
126         else
127         {
128                 LoggerD("Attribute(" << attrName << ") There is no data.");
129         }
130         return value;
131 }
132
133
134 void MediacontentFolder::display() const
135 {
136     LoggerD("m_folderUUID: " << m_folderUUID);
137     LoggerD("m_folderName: " << m_folderName);
138         LoggerD("m_folderPath: " << m_folderPath);
139         LoggerD("m_storageType: " << m_storageType);
140 }
141
142
143 }
144 }