bool vp_play_util_app_resume(void);
bool vp_play_util_check_white_space(char *szText);
-bool vp_play_util_check_valid_file_name(const char *szFileName);
unsigned long long vp_play_util_get_disk_available_space(const char
*szFilePath);
-unsigned long long vp_play_util_get_file_size(const char *szFilePath);
-
bool vp_play_util_get_city(const char *szLocation, char **szCity);
bool vp_play_util_is_Xwindow_focused(Ecore_X_Window nXwinID);
* limitations under the License.
*/
-#include <regex.h>
#include <efl_extension.h>
#include <errno.h>
#include <notification.h>
/**
*
- * @param szFileName
- * @return
- */
-bool vp_play_util_check_valid_file_name(const char *szFileName)
-{
- if (szFileName == NULL) {
- VideoLogError("szFileName is NULL");
- return FALSE;
- }
-
- char *pattern = NULL;
- int z, cflags = 0;
- bool bReturn = FALSE;
- char ebuf[128];
- regex_t reg;
- regmatch_t pm[1];
- const size_t nmatch = 1;
-
- /*ToDo: ignore the file star with . */
- if (strncmp(szFileName, ".", 1) == 0) {
- return FALSE;
- }
-
- pattern = VP_PLAY_NAME_PATTERN;
- z = regcomp(®, pattern, cflags);
-
- if (z != 0) {
- regerror(z, ®, ebuf, sizeof(ebuf));
- VideoLogError("%s: pattern '%s'", ebuf, pattern);
- return FALSE;
- }
-
- z = regexec(®, szFileName, nmatch, pm, 0);
- if (z == REG_NOMATCH) {
- bReturn = TRUE;
- } else {
- bReturn = FALSE;
- }
- regfree(®);
-
- return bReturn;
-}
-
-/**
- *
* @param szFilePath
*/
unsigned long long vp_play_util_get_disk_available_space(const char
/**
*
- * @param szFilePath
- */
-unsigned long long vp_play_util_get_file_size(const char *szFilePath)
-{
- if (szFilePath == NULL) {
- VideoLogError("szFilePath is NULL");
- return 0;
- }
-
- unsigned long long lSize = 0;
-
- lSize = (unsigned long long) vp_file_size(szFilePath);
-
- return lSize;
-}
-
-/**
- *
* @param szLocation
* @param szCity
* @return