Kimono.KMimeType.FindByUrl C# (CSharp) Метод

FindByUrl() публичный статический Метод

Finds a KMimeType with the given url. This function looks at mode_t first. If that does not help it looks at the extension. This is fine for FTP, FILE, TAR and friends, but is not for HTTP ( cgi scripts! ). You should use KRun instead, but this function returns immediately while KRun is async. If no extension matches, then the file contents will be examined if the URL is a local file, or "application/octet-stream" is returned otherwise. name="url" Is the right most URL with a filesystem protocol. It is up to you to find out about that if you have a nested URL. For example "http://localhost/mist.gz#gzip:/decompress" would have to pass the "http://..." URL part, while "file:/tmp/x.tar#tar:/src/test.gz#gzip:/decompress" would have to pass the "tar:/..." part of the URL, since gzip is a filter protocol and not a filesystem protocol. name="mode" the mode of the file (used, for example, to identify executables) name="is_local_file" true if the file is local; false if not, or if you don't know. name="fast_mode" If set to true no disk access is allowed to find out the mimetype. The result may be suboptimal, but it is fast. name="accuracy" if set, the accuracy of the result, between 0 and 100. For instance, when the extension was used to determine the mimetype, the accuracy is set to 80, as per the shared-mime spec. Some 'magic' rules (used when !fast_mode) have an accuracy > 80 (and have priority over the filename, others are < 80).
public static FindByUrl ( Kimono.KUrl url, long mode, bool is_local_file, bool fast_mode, int &accuracy ) : KMimeType
url Kimono.KUrl
mode long
is_local_file bool
fast_mode bool
accuracy int
Результат KMimeType
        public static KMimeType FindByUrl(KUrl url, long mode, bool is_local_file, bool fast_mode, ref int accuracy)
        {
            StackItem[] stack = new StackItem[6];
            #if DEBUG
            stack[1].s_class = (IntPtr) DebugGCHandle.Alloc(url);
            #else
            stack[1].s_class = (IntPtr) GCHandle.Alloc(url);
            #endif
            stack[2].s_long = mode;
            stack[3].s_bool = is_local_file;
            stack[4].s_bool = fast_mode;
            stack[5].s_int = accuracy;
            staticInterceptor.Invoke("findByUrl#$$$$", "findByUrl(const KUrl&, mode_t, bool, bool, int*)", stack);
            #if DEBUG
            DebugGCHandle.Free((GCHandle) stack[1].s_class);
            #else
            ((GCHandle) stack[1].s_class).Free();
            #endif
            accuracy = stack[5].s_int;
            object returnValue = ((GCHandle) stack[0].s_class).Target;
            #if DEBUG
            DebugGCHandle.Free((GCHandle) stack[0].s_class);
            #else
            ((GCHandle) stack[0].s_class).Free();
            #endif
            return (KMimeType) returnValue;
        }

Same methods

KMimeType::FindByUrl ( Kimono.KUrl url ) : KMimeType
KMimeType::FindByUrl ( Kimono.KUrl url, long mode ) : KMimeType
KMimeType::FindByUrl ( Kimono.KUrl url, long mode, bool is_local_file ) : KMimeType
KMimeType::FindByUrl ( Kimono.KUrl url, long mode, bool is_local_file, bool fast_mode ) : KMimeType