The ContentManagerUtil class provides access to different local content types, such as image, audio, and video, and manages the content metadata.
For more information on managing the content's utility on the device, see Device Content Management.
The following example demonstrates how to use the ContentManagerUtil class.
result MyClass::TestContentManagerUtil(void) { result r = E_SUCCESS; // Image ImageMetadata* pImageMeta = ContentManagerUtil::GetImageMetaN(L"/Media/Images/full_meta.jpg"); TryReturn(pImageMeta != null, GetLastResult(), "GetImageMetaN failed."); // Audio AudioMetadata* pAudioMeta = ContentManagerUtil::GetAudioMetaN(L"/Media/Sounds/hot.mp3"); if(pAudioMeta == null) { delete pImageMeta; return GetLastResult(); } // Video VideoMetadata* pVideoMeta = ContentManagerUtil::GetVideoMetaN(L"/Media/Videos/video.mp4"); if(pVideoMeta == null) { delete pImageMeta; delete pAudioMeta; return GetLastResult(); } delete pImageMeta; delete pAudioMeta; delete pVideoMeta; return r; }
Public Member Functions | |
ContentManagerUtil (void) | |
virtual | ~ContentManagerUtil (void) |
Static Public Member Functions | |
static Osp::Content::ContentType | CheckContentType (const Osp::Base::String &contentPath) |
static result | CopyToMediaDirectory (const Osp::Base::String &srcContentPath, const Osp::Base::String &destContentPath) |
static Osp::Content::AudioMetadata * | GetAudioMetaN (const Osp::Base::String &contentPath) |
static Osp::Content::ContentType | GetContentType (const Osp::Base::String &contentPath) |
static Osp::Content::ImageMetadata * | GetImageMetaN (const Osp::Base::String &contentPath) |
static Osp::Content::VideoMetadata * | GetVideoMetaN (const Osp::Base::String &contentPath) |
static result | MoveToMediaDirectory (const Osp::Base::String &srcContentPath, const Osp::Base::String &destContentPath) |
Osp::Content::ContentManagerUtil::ContentManagerUtil | ( | void | ) |
This is the default constructor for this class.
virtual Osp::Content::ContentManagerUtil::~ContentManagerUtil | ( | void | ) | [virtual] |
This is the destructor for this class.
static Osp::Content::ContentType Osp::Content::ContentManagerUtil::CheckContentType | ( | const Osp::Base::String & | contentPath | ) | [static] |
Checks the content type from the content path.
[in] | contentPath | The content path |
E_SUCCESS | The method is successful. |
E_INVALID_ARG | The specified input parameter is invalid, or the length of the specified path is 0 or exceeds system limitations. |
E_FILE_NOT_FOUND | The specified file cannot be found. |
E_UNSUPPORTED_FORMAT | The specified format is invalid or not supported. |
static result Osp::Content::ContentManagerUtil::CopyToMediaDirectory | ( | const Osp::Base::String & | srcContentPath, |
const Osp::Base::String & | destContentPath | ||
) | [static] |
Copies an existing file to a new directory.
[in] | srcContentPath | The source content path |
[in] | destContentPath | The destination content path |
E_SUCCESS | The method is successful. |
E_INVALID_ARG | Either of the following conditions has occurred:
|
E_ILLEGAL_ACCESS | Access is denied due to insufficient permission. |
E_FILE_NOT_FOUND | The specified file cannot be found or accessed. |
E_FILE_ALREADY_EXIST | The specified file already exists. |
E_MAX_EXCEEDED | The number of opened files has exceeded the maximum limit. |
E_IO | Either of the following conditions has occurred:
|
static Osp::Content::AudioMetadata* Osp::Content::ContentManagerUtil::GetAudioMetaN | ( | const Osp::Base::String & | contentPath | ) | [static] |
Gets the metadata for an audio.
null
, if an exception occurs [in] | contentPath | The content path |
E_SUCCESS | The method is successful. |
E_INVALID_ARG | The specified input parameter is invalid. |
E_OUT_OF_MEMORY | The memory is insufficient. |
static Osp::Content::ContentType Osp::Content::ContentManagerUtil::GetContentType | ( | const Osp::Base::String & | contentPath | ) | [static] |
Gets the content type from the content path.
[in] | contentPath | The content path |
E_SUCCESS | The method is successful. |
E_INVALID_ARG | The specified input parameter is invalid. |
static Osp::Content::ImageMetadata* Osp::Content::ContentManagerUtil::GetImageMetaN | ( | const Osp::Base::String & | contentPath | ) | [static] |
Gets the metadata for an image.
null
, if an exception occurs [in] | contentPath | The content path |
E_SUCCESS | The method is successful. |
E_INVALID_ARG | The specified input parameter is invalid. |
E_OUT_OF_MEMORY | The memory is insufficient. |
static Osp::Content::VideoMetadata* Osp::Content::ContentManagerUtil::GetVideoMetaN | ( | const Osp::Base::String & | contentPath | ) | [static] |
Gets the metadata for a video.
null
, if an exception occurs [in] | contentPath | The content path |
E_SUCCESS | The method is successful. |
E_INVALID_ARG | The specified input parameter is invalid. |
E_OUT_OF_MEMORY | The memory is insufficient. |
static result Osp::Content::ContentManagerUtil::MoveToMediaDirectory | ( | const Osp::Base::String & | srcContentPath, |
const Osp::Base::String & | destContentPath | ||
) | [static] |
Changes the path to a new directory.
[in] | srcContentPath | The source content path |
[in] | destContentPath | The destination content path |
E_SUCCESS | The method is successful. |
E_INVALID_ARG | Either of the following conditions has occurred:
|
E_ILLEGAL_ACCESS | Access is denied due to insufficient permission. |
E_FILE_NOT_FOUND | The specified file cannot be found or accessed. |
E_FILE_ALREADY_EXIST | The specified file already exists. |
E_MAX_EXCEEDED | The number of opened files has exceeded the maximum limit. |
E_IO | Either of the following conditions has occurred:
|