#include <FBaseUtilStringTokenizer.h>
#include <FCntContentSearch.h>
#include <FCntContentSearchResult.h>
+#include <FSysEnvironment.h>
+#include <FApp_AppInfo.h>
#include <FBase_StringConverter.h>
#include <FBase_LocalizedNumParser.h>
+#include <FIo_FileImpl.h>
#include "FCnt_ContentUtility.h"
#include "FCnt_ContentSearchImpl.h"
#include "FCnt_ContentInfoImpl.h"
#include "FCnt_OtherContentInfoImpl.h"
#include "FCnt_ContentInfoHelper.h"
+using namespace Tizen::App;
using namespace Tizen::Base;
using namespace Tizen::Base::Collection;
using namespace Tizen::Base::Utility;
using namespace Tizen::Io;
+using namespace Tizen::System;
namespace Tizen { namespace Content
{
int maxCols = 0;
int indexOf = 0;
-
+
String strToBeReplaced(L"\\'");
int strLen = strToBeReplaced.GetLength();
int startIndex = 0;
SysTryReturnResult(NID_CNT, r == E_SUCCESS, r, "Failed to parse DateTime.");
int year = dt.GetYear();
- int month = dt.GetMonth();
+ int month = dt.GetMonth();
int day = dt.GetDay();
int hour = dt.GetHour();
- int minute = dt.GetMinute();
+ int minute = dt.GetMinute();
int second = dt.GetSecond();
-
+
time_t rawTime;
struct tm* timeInfo;
pMediaPath.reset(pTempPath);
String contentPath(pMediaPath.get());
+ String changedPath(contentPath);
+
+ // If the api version is 2.0, the content path has to be changed.
+ if (_AppInfo::GetApiVersion() == _API_VERSION_2_0 && _AppInfo::IsOspCompat())
+ {
+ r = _FileImpl::ConvertPhysicalToVirtualPath(contentPath, changedPath);
+ SysTryReturnResult(NID_CNT, !IsFailed(r), E_INVALID_ARG,
+ "[%s] Failed to convert physical path to virtual path.", GetErrorMessage(E_INVALID_ARG));
+ }
switch (mediaType)
{
pOtherContentInfo = std::unique_ptr<OtherContentInfo>(new (std::nothrow) OtherContentInfo);
SysTryReturnResult(NID_CNT, pOtherContentInfo.get() != null, E_OUT_OF_MEMORY, "Failed to create pOtherContentInfo.");
- r = pOtherContentInfo->Construct(&contentPath);
+ r = pOtherContentInfo->Construct(&changedPath);
r = ConvertErrorToResult(r);
SysTryReturnResult(NID_CNT, !IsFailed(r), r, "Failed to perform Construct operation to OtherContentInfo.");
pImageContentInfo = std::unique_ptr<ImageContentInfo>(new (std::nothrow) ImageContentInfo);
SysTryReturnResult(NID_CNT, pImageContentInfo.get() != null, E_OUT_OF_MEMORY, "Failed to create pImageContentInfo.");
- r = pImageContentInfo->Construct(&contentPath);
+ r = pImageContentInfo->Construct(&changedPath);
r = ConvertErrorToResult(r);
SysTryReturnResult(NID_CNT, !IsFailed(r), r, "Failed to perform Construct operation to ImageContentInfo.");
pAudioContentInfo = std::unique_ptr<AudioContentInfo>(new (std::nothrow) AudioContentInfo);
SysTryReturnResult(NID_CNT, pAudioContentInfo.get() != null, E_OUT_OF_MEMORY, "Failed to create pAudioContentInfo.");
- r = pAudioContentInfo->Construct(&contentPath);
+ r = pAudioContentInfo->Construct(&changedPath);
r = ConvertErrorToResult(r);
SysTryReturnResult(NID_CNT, !IsFailed(r), r, "Failed to perform Construct operation to AudioContentInfo.");
pVideoContentInfo = std::unique_ptr<VideoContentInfo>(new (std::nothrow) VideoContentInfo);
SysTryReturnResult(NID_CNT, pVideoContentInfo.get() != null, E_OUT_OF_MEMORY, "Failed to create pVideoContentInfo.");
- r = pVideoContentInfo->Construct(&contentPath);
+ r = pVideoContentInfo->Construct(&changedPath);
r = ConvertErrorToResult(r);
SysTryReturnResult(NID_CNT, !IsFailed(r), r, "Failed to perform Construct operation to VideoContentInfo.");
totalPageCount = (totalCount / countPerPage) + 1;
}
- if ((pageNo < 1) || (pageNo > totalPageCount))
- {
- r = E_INVALID_ARG;
- SysTryReturnResult(NID_CNT, !IsFailed(r), r, "(pageNo < 1) || (pageNo > totalPageCount).");
- }
+ SysTryReturnResult(NID_CNT, ((pageNo >= 1) && (pageNo <= totalPageCount)) , r, "(pageNo < 1) || (pageNo > totalPageCount).");
offset = (pageNo * countPerPage) - countPerPage;