2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (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://www.apache.org/licenses/LICENSE-2.0
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 * @file FCntContentManagerUtil.cpp
18 * @brief This is the implementation file for the %ContentManagerUtil class.
20 * This file contains implementation of the %ContentManagerUtil class.
23 #include <FBaseSysLog.h>
24 #include <FCntContentManagerUtil.h>
25 #include <FCntImageMetadata.h>
26 #include <FCntAudioMetadata.h>
27 #include <FCntVideoMetadata.h>
28 #include <FCnt_ContentManagerUtilImpl.h>
30 using namespace Tizen::Base;
32 namespace Tizen { namespace Content
36 ContentManagerUtil::GetImageMetaN(const String& filePath)
41 ImageMetadata* pImageMetadata = null;
43 pImageMetadata = _ContentManagerUtilImpl::GetImageMetaN(filePath);
45 SysTryReturn(NID_CNT, pImageMetadata != null, null, r, "[%s] GetImageMetaN failed.", GetErrorMessage(r));
47 return pImageMetadata;
51 ContentManagerUtil::GetAudioMetaN(const String& filePath)
56 AudioMetadata* pAudioMetadata = null;
58 pAudioMetadata = _ContentManagerUtilImpl::GetAudioMetaN(filePath);
60 SysTryReturn(NID_CNT, pAudioMetadata != null, null, r, "[%s] GetAudioMetaN failed.", GetErrorMessage(r));
62 return pAudioMetadata;
66 ContentManagerUtil::GetVideoMetaN(const String& filePath)
71 VideoMetadata* pVideoMetadata = null;
73 pVideoMetadata = _ContentManagerUtilImpl::GetVideoMetaN(filePath);
75 SysTryReturn(NID_CNT, pVideoMetadata != null, null, r, "[%s] GetVideoMetaN failed.", GetErrorMessage(r));
77 return pVideoMetadata;
81 ContentManagerUtil::GetImageMetaN(const ByteBuffer& byteBuffer)
86 ImageMetadata* pImageMetadata = null;
88 pImageMetadata = _ContentManagerUtilImpl::GetImageMetaN(byteBuffer);
90 SysTryReturn(NID_CNT, pImageMetadata != null, null, r, "[%s] GetImageMetaN failed.", GetErrorMessage(r));
92 return pImageMetadata;
96 ContentManagerUtil::GetAudioMetaN(const ByteBuffer& byteBuffer)
100 result r = E_SUCCESS;
101 AudioMetadata* pAudioMetadata = null;
103 pAudioMetadata = _ContentManagerUtilImpl::GetAudioMetaN(byteBuffer);
105 SysTryReturn(NID_CNT, pAudioMetadata != null, null, r, "[%s] GetAudioMetaN failed.", GetErrorMessage(r));
107 return pAudioMetadata;
111 ContentManagerUtil::GetVideoMetaN(const ByteBuffer& byteBuffer)
115 result r = E_SUCCESS;
116 VideoMetadata* pVideoMetadata = null;
118 pVideoMetadata = _ContentManagerUtilImpl::GetVideoMetaN(byteBuffer);
120 SysTryReturn(NID_CNT, pVideoMetadata != null, null, r, "[%s] GetVideoMetaN failed.", GetErrorMessage(r));
122 return pVideoMetadata;
126 ContentManagerUtil::CheckContentType(const String& filePath)
130 result r = E_SUCCESS;
131 ContentType contentType = CONTENT_TYPE_UNKNOWN;
133 contentType = _ContentManagerUtilImpl::CheckContentType(filePath);
135 SysTryReturn(NID_CNT, contentType != CONTENT_TYPE_UNKNOWN, CONTENT_TYPE_UNKNOWN, r,
136 "[%s] CheckContentType failed.", GetErrorMessage(r));
142 ContentManagerUtil::CopyToMediaDirectory(const String& srcFilePath, const String& destFilePath)
146 result r = E_SUCCESS;
148 r = _ContentManagerUtilImpl::CopyToMediaDirectory(srcFilePath, destFilePath);
149 SysTryReturn(NID_CNT, !IsFailed(r), r, r, "[%s] CopyToMediaDirectory failed.", GetErrorMessage(r));
155 ContentManagerUtil::MoveToMediaDirectory(const String& srcFilePath, const String& destFilePath)
159 result r = E_SUCCESS;
161 r = _ContentManagerUtilImpl::MoveToMediaDirectory(srcFilePath, destFilePath);
162 SysTryReturn(NID_CNT, !IsFailed(r), r, r, "[%s] MoveToMediaDirectory failed.", GetErrorMessage(r));