4 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Hyunjun Ko <zzoon.ko@samsung.com>, Haejeong Kim <backto.kim@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
23 * This file defines the error code of media service
25 * @file media-svc-util.h
26 * @author Hyunjun Ko <zzoon.ko@samsung.com>
28 * @brief This file defines the error code of media service
33 * @defgroup MEDIA_SVC_UTIL error code table
38 #ifndef _MEDIA_SVC_UTIL_H_
39 #define _MEDIA_SVC_UTIL_H_
48 #define MB_SVC_PATH_PHONE "/opt/media" /**< File path prefix of files stored in phone */
49 #define MB_SVC_PATH_MMC "/opt/storage/sdcard" /**< File path prefix of files stored in mmc card */
53 * @fn int _mb_svc_get_file_display_name (const char* file_path, char* file_name);
54 * This function gets file name by file full path
56 * @return This function returns 0 on success, and -1 on failure.
57 * @param[in] file_path file full path
58 * @param[out] file_name file name
66 _mb_svc_get_file_display_name (const char* file_path, char* file_name);
70 * @fn int _mb_svc_get_file_parent_path(const char* file_path, char* parent_path);
71 * This function gets file parent path
73 * @return This function returns 0 on success, and -1 on failure.
74 * @param[in] file_path file full path
75 * @param[out] parent_path file parent path
83 _mb_svc_get_file_parent_path(const char* file_path, char* parent_path);
86 * @fn int _mb_svc_get_dir_display_name (const char* dir_path, char* dir_name);
87 * This function gets directory name
89 * @return This function returns 0 on success, and -1 on failure.
90 * @param[in] dir_path directory path
91 * @param[out] dir_name directory name
98 _mb_svc_get_dir_display_name (const char* dir_path, char* dir_name);
101 * @fn int _mb_svc_get_dir_parent_path(const char* dir_path, char* parent_path);
102 * This function gets directory parent path
104 * @return This function returns 0 on success, and -1 on failure.
105 * @param[in] dir_path directory path
106 * @param[out] parent_path directory parent path
113 _mb_svc_get_dir_parent_path(const char* dir_path, char* parent_path);
116 * @fn int _mb_svc_get_file_dir_modified_date(const char* full_path);
117 * This function gets file modified date
119 * @return This function returns 0 on success, and -1 on failure.
120 * @param[in] full_path file full path
128 _mb_svc_get_file_dir_modified_date(const char* full_path);
131 * @fn int _mb_svc_get_store_type_by_full(const char* full_path);
132 * This function gets file store type
133 * @return This function returns 0 on success, and -1 on failure.
134 * @param[in] full_path file full path
141 _mb_svc_get_store_type_by_full(const char* full_path);
144 * @fn int _mb_svc_get_rel_path_by_full(const char* full_path, char* path);
145 * This function gets file relative path
147 * @return This function returns 0 on success, and -1 on failure.
148 * @param[in] full_path file full path
149 * @param[out] path file relative path
156 _mb_svc_get_rel_path_by_full(const char* full_path, char* path);
159 * @fn int _mb_svc_get_file_ext (const char* file_path, char* file_ext);
160 * This function gets file extension
162 * @return This function returns 0 on success, and -1 on failure.
163 * @param[in] file_path file full path
164 * @param[out] file_ext pointer to file extention
171 _mb_svc_get_file_ext (const char* file_path, char* file_ext);
174 * @fn int _mb_svc_glist_free(GList** glist, bool is_free_element);
175 * This function frees glist and maybe free each items in glist
177 * @return This function returns 0 on success, and -1 on failure.
178 * @param[in] glist the glist to be freed
179 * @param[in] is_free_element falg to declare if to free items in glist
187 _mb_svc_glist_free(GList** glist, bool is_free_element);
190 * @fn int _mb_svc_get_file_type(char* file_full_path);
191 * This function gets file type
193 * @return This function returns 0 on success, and -1 on failure.
194 * @param[in] file_full_path file full path
202 _mb_svc_get_file_type(const char* file_full_path);
205 _mb_svc_get_path_by_full(const char* full_path, char* path, int max_length);
209 #endif /* __cplusplus */
212 #endif /*_MEDIA_SVC_UTIL_H_*/