This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KUrl "find-like" behavior

Tags: None
(comma "," separated)
fluca1978
Registered Member
Posts
81
Karma
0
OS

KUrl "find-like" behavior

Thu May 24, 2012 12:32 pm
Hi all,
maybe something similar has already been done, or maybe is impossible: I'd like to check a local URL (i.e., a file:///) against a regexp or something similar to see if the URL can lead to the file that matches the regexp. For instance, imagine I've got a file hierachy as follows:

Code: Select all
/dev
      /proj1
              a.java
              b.java
      /proj2
              a.java
              b.cpp


and imagine I've got a KUrl that points to file:///dev and I want to search for all *.java files, so that I get a list of KUrl for
  • /dev/proj1/a.java
  • /dev/proj1/b.java
  • /dev/proj2/a.java

Is there any library implementing this behavior in the KDE space? Otherwise any suggestion about how to handle the searching for/ pattern matching efficiently?

Thanks.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: KUrl "find-like" behavior  Topic is solved

Sat May 26, 2012 8:29 am
You probably want to take a look at QRegExp. KUrl supports converting the url to a string (I can't recall if it inherits QUrl), so it should be possible to use it with QRegExp.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft