博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
FileManager模块分析
阅读量:4045 次
发布时间:2019-05-24

本文共 2486 字,大约阅读时间需要 8 分钟。

一、 External Interface

    
     1.   给其他模块使用的接口函数                    作用
          mmi_fmgr_init                   initialize file manager context
          mmi_fmgr_select_path_and_entry  entry point to file manager for other applications
          mmi_fmgr_reset_app_select       reset selection from other application
          GetFileSystemErrorString        convert file system return error code to error messgae pop up
    
     2.   分析mmi_fmgr_select_path_and_entry, mmi_fmgr_reset_app_selec
          函数原型: void  mmi_fmgr_select_path_and_entry(U8 app_id, U8 sel_type, U32 filter, PS8 start_path, PsFuncPtr callback) ;
          (1) 主要分析callback函数
              A.    excute mmi_fmgr_select_path_and_entry(......)
              start_path
              --->  callback(.....)
              --->  callback内部检查:  N
                    start_path=NULL?  ---> the selection is completed
                          |
                          | Y
                 the selection is aborted
              B.  FMGR_SELECT_REPEAT对于callback函数的影响以及
                  使用FMGR_SELECT_REPEAT可以多次选择文件/文件夹
                  a. Each Select
                     select target
               start_path  
                 ---> callback(......)
                 ---> callback内部检查  N
                      start_path=NULL? ---> user abort ( the selection is aborted )
                            |
                            | Y                       Y
                      reach applications condition? ---> application abort ( the selection is aborted )
                            |
                            |
                      the selection is completed
                  b. 两种abort
                     user abort:
                     will cause a callback with NULL parameter and File Manager will automatically reset ;
                     application abort:
                     needs to call the mmi_fmgr_reset_app_select( ) to terminate the process
          (2) FMGR_SELECT_BROWSE参数
              drive option
              folder option
              file option
    
     3.   Utility Functions
          BOOL  mmi_fmgr_get_default_folder_path(S8 * folder,S8 * path,U16 length);
          void  mmi_fmgr_remove_last_dir(S8 * path);
          S8 *  mmi_fmgr_extract_file_name(S8 * path );
          S8 *  mmi_fmgr_extract_ext_file_name(S8 * path);
          void  mmi_fmgr_hide_ext_name(S8 * path);
                mmi_fmgr_check_file_present
        
        
二、 Cache
     
     1.  First Time Enter a Floder
     A.  一般流程
         first time enter a floder
     --> call fmgr_kenmel: init the cache
     --> load file frome FS until the cache is filled
     --> 不管是否有sort选项, file manager都会获取 file list
     B.  关于 sort API
         当目录项内文件数超过255, file manager cant use sort API to get file list from file system
     but linear find first/find next instead.
     C.  filter
   
    2.  Request for File Info
    A.  Function:  fmgr_kernel_get_file_info
    B.      call fmgr_kernel_get_file_info with a index    
    --> get a structe of data filled with useful file information
    --> this funciton will use the passed in index to see      Y
        if the desired file info is already in chached or not ---> from cache
                               |
                               | N
                               |
                 reload cache and return file info

    3.  Image Cache

    A. File Manger模块的预览图Cache
    B. 一般流程
        Draw Thumb Image
                       Y
    --> Is in cache? -----> Draw it from cache
            |
            | N
            |        
        Decord Image -----> Decord Done -----> Cache the Image -----> Draw it from cache   

转载地址:http://qwedi.baihongyu.com/

你可能感兴趣的文章
Java中数字转大写货币(支持到千亿)
查看>>
Java.nio
查看>>
函数模版类模版和偏特化泛化的总结
查看>>
VMware Workstation Pro虚拟机不可用解决方法
查看>>
最简单的使用redis自带程序实现c程序远程访问redis服务
查看>>
redis学习总结-- 内部数据 字符串 链表 字典 跳跃表
查看>>
iOS 对象序列化与反序列化
查看>>
iOS 序列化与反序列化(runtime) 01
查看>>
iOS AFN 3.0版本前后区别 01
查看>>
iOS ASI和AFN有什么区别
查看>>
iOS QQ侧滑菜单(高仿)
查看>>
iOS 扫一扫功能开发
查看>>
iOS app之间的跳转以及传参数
查看>>
iOS __block和__weak的区别
查看>>
Android(三)数据存储之XML解析技术
查看>>
Spring JTA应用之JOTM配置
查看>>
spring JdbcTemplate 的若干问题
查看>>
Servlet和JSP的线程安全问题
查看>>
GBK编码下jQuery Ajax中文乱码终极暴力解决方案
查看>>
Oracle 物化视图
查看>>