Public Member Functions | Static Public Member Functions
Osp::Content::ContentManagerUtil Class Reference
Inheritance diagram for Osp::Content::ContentManagerUtil:
Osp::Base::Object

Since:
1.0

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;
 }

List of all members.

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)

Constructor & Destructor Documentation

Osp::Content::ContentManagerUtil::ContentManagerUtil ( void  )

This is the default constructor for this class.

Since:
1.0
virtual Osp::Content::ContentManagerUtil::~ContentManagerUtil ( void  ) [virtual]

This is the destructor for this class.

Since:
1.0

Member Function Documentation

static Osp::Content::ContentType Osp::Content::ContentManagerUtil::CheckContentType ( const Osp::Base::String contentPath) [static]

Checks the content type from the content path.

Since:
1.1
Returns:
The content type
Parameters:
[in]contentPathThe content path
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_ARGThe specified input parameter is invalid, or the length of the specified path is 0 or exceeds system limitations.
E_FILE_NOT_FOUNDThe specified file cannot be found.
E_UNSUPPORTED_FORMATThe specified format is invalid or not supported.
Remarks:
The content file path should start with '/Home', '/Media', or '/Storagecard/Media'.
The specific error code can be accessed using the GetLastResult() method.
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.

Deprecated:
This method is deprecated because a new method has been added.
Instead of using this method, use CreateContent(const Osp::Base::String& sourcePath, const Osp::Base::String& destinationPath, bool deleteSource, const ContentInfo* pContentInfo = null) of the ContentManager class.
Since:
1.0
Returns:
An error code
Parameters:
[in]srcContentPathThe source content path
[in]destContentPathThe destination content path
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_ARGEither of the following conditions has occurred:
  • The length of the specified path is equal to 0 or exceeds system limitations.
  • The specified path contains prohibited character(s).
  • The specified path is invalid.
E_ILLEGAL_ACCESSAccess is denied due to insufficient permission.
E_FILE_NOT_FOUNDThe specified file cannot be found or accessed.
E_FILE_ALREADY_EXISTThe specified file already exists.
E_MAX_EXCEEDEDThe number of opened files has exceeded the maximum limit.
E_IOEither of the following conditions has occurred:
  • An unexpected device failure has occurred as the media ejected suddenly.
  • File corruption is detected.
  • The volume or quota is no more available.
Remarks:
The source file in the system region cannot be copied.
The destination file path should start with '/Media' or '/Storagecard/Media'.
To manage the content, use CreateContent() of the ContentManager class.
static Osp::Content::AudioMetadata* Osp::Content::ContentManagerUtil::GetAudioMetaN ( const Osp::Base::String contentPath) [static]

Gets the metadata for an audio.

Since:
1.0
Returns:
A pointer to AudioMetadata
null, if an exception occurs
Parameters:
[in]contentPathThe content path
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_ARGThe specified input parameter is invalid.
E_OUT_OF_MEMORYThe memory is insufficient.
Remarks:
The content file path should start with '/Home', '/Media', or '/Storagecard/Media'. The supported formats are 'mp3', 'wav', 'aac', 'wma', 'm4a', 'xmf', '3ga', or 'mmf'.
The specific error code can be accessed using the GetLastResult() method.
static Osp::Content::ContentType Osp::Content::ContentManagerUtil::GetContentType ( const Osp::Base::String contentPath) [static]

Gets the content type from the content path.

Deprecated:
This method is deprecated as it may return an improper result.
Instead of using this method, use the CheckContentType(const Osp::Base::String& contentPath) method.
Since:
1.0
Returns:
The content type
Parameters:
[in]contentPathThe content path
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_ARGThe specified input parameter is invalid.
Remarks:
The specific error code can be accessed using the GetLastResult() method.
static Osp::Content::ImageMetadata* Osp::Content::ContentManagerUtil::GetImageMetaN ( const Osp::Base::String contentPath) [static]

Gets the metadata for an image.

Since:
1.0
Returns:
A pointer to ImageMetadata
null, if an exception occurs
Parameters:
[in]contentPathThe content path
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_ARGThe specified input parameter is invalid.
E_OUT_OF_MEMORYThe memory is insufficient.
Remarks:
The content file path should start with '/Home', '/Media', or '/Storagecard/Media'. The supported formats are 'jpg', 'jpeg', 'gif', 'png', 'bmp', 'wbmp', or 'tiff'.
The specific error code can be accessed using the GetLastResult() method.
static Osp::Content::VideoMetadata* Osp::Content::ContentManagerUtil::GetVideoMetaN ( const Osp::Base::String contentPath) [static]

Gets the metadata for a video.

Since:
1.0
Returns:
A pointer to VideoMetadata
null, if an exception occurs
Parameters:
[in]contentPathThe content path
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_ARGThe specified input parameter is invalid.
E_OUT_OF_MEMORYThe memory is insufficient.
Remarks:
The content file path should start with '/Home', '/Media', or '/Storagecard/Media'. The supported formats are 'wmv', 'asf', 'mp4', '3gp', or 'avi'.
The specific error code can be accessed using the GetLastResult() method.
static result Osp::Content::ContentManagerUtil::MoveToMediaDirectory ( const Osp::Base::String srcContentPath,
const Osp::Base::String destContentPath 
) [static]

Changes the path to a new directory.

Deprecated:
This method is deprecated because a new method has been added.
Instead of using this method, use CreateContent(const Osp::Base::String& sourcePath, const Osp::Base::String& destinationPath, bool deleteSource, const ContentInfo* pContentInfo = null) of the ContentManager class.
Since:
1.0
Returns:
An error code
Parameters:
[in]srcContentPathThe source content path
[in]destContentPathThe destination content path
Exceptions:
E_SUCCESSThe method is successful.
E_INVALID_ARGEither of the following conditions has occurred:
  • The length of the specified path is equal to 0 or exceeds system limitations.
  • The specified path contains prohibited character(s).
  • The specified path is invalid.
E_ILLEGAL_ACCESSAccess is denied due to insufficient permission.
E_FILE_NOT_FOUNDThe specified file cannot be found or accessed.
E_FILE_ALREADY_EXISTThe specified file already exists.
E_MAX_EXCEEDEDThe number of opened files has exceeded the maximum limit.
E_IOEither of the following conditions has occurred:
  • An unexpected device failure has occurred as the media ejected suddenly.
  • File corruption is detected.
  • The volume or quota is no more available.
Remarks:
The source file in the system region cannot be copied.
The destination file path should start with '/Media' or '/Storagecard/Media'.
To manage the content, use CreateContent() of the ContentManager class.

The documentation for this class was generated from the following file:

Copyright © 2011 Samsung Electronics Co., Ltd. All rights reserved.