[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: KDE/kdelibs/kio/tests
From:       Thiago Macieira <thiago () kde ! org>
Date:       2006-11-30 19:53:50
Message-ID: 200611302053.51534.thiago () kde ! org
[Download RAW message or body]


Ralf Habacker wrote:
>If the term 'schema' is refering to the above mentioned protocol, isn't
>the form 

schema == protocol

>
><protocol> '://' mandatory  for an uri ? Couldn't the detector be

The colon is mandatory in any URI

But the double slash is only mandatory in URLs. URIs that aren't URLs 
shouldn't use the double slash to avoid misparsing.

>if( str[0].isLetter() and str[1] == ':' && str[2] == '/' && str[3] !=
> '/' ) file_is_local_file

Your case misses the empty-authority case that some argue is acceptable 
(file:/path, but happens a lot in the KDE ioslaves, like system:/media). 
I think it would be pointless to name a schema/ioslave with a single 
letter, but who knows?

>to catch c:\temp this should be
>
>if( str[0].isLetter() and str[1] == ':' && (str[2] == '\\' || str[2] ==
> '/' && str[3] != '/') ) file_is_local_file

The use of backslash clearly indicates a pathname. The problem is when the 
forward slash is used.

-- 
  Thiago Macieira  -  thiago (AT) macieira.info - thiago (AT) kde.org
    PGP/GPG: 0x6EF45358; fingerprint:
    E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358

[Attachment #3 (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic