pike.git / lib / master.pike.in

version» Context lines:

pike.git/lib/master.pike.in:690:    source_cache[ret] = source;   #ifdef RECUR_COMPILE_DEBUG    DEC_MSG_DEPTH();    werror ("%*s<<< compile_string %O\n", GET_MSG_DEPTH, "", filename);   #endif    return ret;   }      //! @endnamespace    + //! Read a file from the master filesystem.   //! -  + //! The master filesystem defaults to the system filesystem, + //! but additional mountpoints may be added via + //! @[add_filesystem_handler()]. + //! + //! All file I/O performed by the @[MasterObject] is performed + //! via this function and its related functions. + //! + //! @seealso + //! @[add_filesystem_handler()], @[find_handler_for_path()], + //! @[master_get_dir()], @[master_file_stat()]   string master_read_file(string file)   {    string x = find_handler_for_path(file);    if(x)    {    object h = fs_map[x];    file = file[sizeof(x)+1..];       if(h = h->open(fakeroot(file),"r") )    {
pike.git/lib/master.pike.in:843:   //! @param mountpoint   //! the location in the filesystem to mount the handler   //!   //! @param filesystem   //! a filesystem object that will handle requests for the given mountpoint.   //!   //! @example   //! master()->add_filesystem_handler("/foo/bar.zip", Filesystem.Zip("/foo/bar.zip"));   //! master()->add_module_path("/foo/bar.zip/lib");   //! + //! @seealso + //! @[find_handler_for_path()]   mixed add_filesystem_handler(string mountpoint, object /*Filesystem.Base*/ filesystem)   {    mixed rv = fs_map[mountpoint];    fs_map[mountpoint] = filesystem;    return rv;   }    -  + //! Return the mountpoint for the filesystem handler handling the + //! @[file] (if any). + //! + //! @seealso + //! @[add_filesystem_handler()]   string find_handler_for_path(string file)   {   // TODO: maybe some caching would be worthwhile here. maybe.       foreach(reverse(sort(indices(fs_map))); int x; string path)    {    string p = path;    if(p[-1] != '/') p+="/";    if(file[-1] != '/') file+="/";    if(has_prefix(file, p))