Re: [Interest] equivalent of python glob

2019-08-27 Thread Florian Bruhin
On Mon, Aug 26, 2019 at 11:59:00PM +, Hamish Moffatt wrote: > I think it's a shame there isn't something simpler built in to C++ or Qt > though. There's std::filesystem::path::append in C++17: https://en.cppreference.com/w/cpp/filesystem/path/append Florian -- https://www.qutebrowser.org |

Re: [Interest] equivalent of python glob

2019-08-26 Thread Jérôme Godbout
nterest@qt-project.org Subject: Re: [Interest] equivalent of python glob On 27/8/19 12:33 am, Jérôme Godbout wrote: > This is what I did for pathJoin > > const QString SEPARATOR("/"); > QString FileSystemUtil::pathJoin(const QStringList& paths) Thanks. You could do that sim

Re: [Interest] equivalent of python glob

2019-08-26 Thread Hamish Moffatt
On 27/8/19 12:33 am, Jérôme Godbout wrote: This is what I did for pathJoin const QString SEPARATOR("/"); QString FileSystemUtil::pathJoin(const QStringList& paths) Thanks. You could do that simpler with QDir::cleanPath() and QDir::toNativeSeparators() I think (and not have to hardcode the se

Re: [Interest] equivalent of python glob

2019-08-26 Thread Jérôme Godbout
a Sent: August 26, 2019 1:37 AM To: interest@qt-project.org Subject: Re: [Interest] equivalent of python glob On Sunday, 25 August 2019 16:34:03 PDT Hamish Moffatt wrote: > On a related note, where is the equivalent of os.path.join()? String concatenation. You don't need a funct

Re: [Interest] equivalent of python glob

2019-08-25 Thread Thiago Macieira
On Sunday, 25 August 2019 16:34:03 PDT Hamish Moffatt wrote: > On a related note, where is the equivalent of os.path.join()? String concatenation. You don't need a function to do it for you. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel System Software Products

Re: [Interest] equivalent of python glob

2019-08-25 Thread Hamish Moffatt
On 24/8/19 12:38 am, Bob Hood wrote: On 8/23/2019 12:46 AM, Hamish Moffatt wrote: Hi, In Python one can write the expression: glob.glob("/usr/bin/*") and get a list of such files. I am looking for something similar in Qt (in C++). I have look at QDir::entryList() and entryInfoList(), but it

Re: [Interest] equivalent of python glob

2019-08-23 Thread Bob Hood
On 8/23/2019 9:03 AM, Thiago Macieira wrote: On Friday, 23 August 2019 07:38:56 PDT Bob Hood wrote: e.g., QDirIterator iter(base_folder, QStringList() << "*.*", QDir::Files, QDirIterator::Subdirectories); "*.*" is "all files containing a dot" (and not in the first character) and the vast majori

Re: [Interest] equivalent of python glob

2019-08-23 Thread Thiago Macieira
On Friday, 23 August 2019 07:38:56 PDT Bob Hood wrote: > e.g., QDirIterator iter(base_folder, QStringList() << "*.*", QDir::Files, > QDirIterator::Subdirectories); "*.*" is "all files containing a dot" (and not in the first character) and the vast majority of files in /usr/bin don't. -- Thiago

Re: [Interest] equivalent of python glob

2019-08-23 Thread Bob Hood
On 8/23/2019 12:46 AM, Hamish Moffatt wrote: Hi, In Python one can write the expression: glob.glob("/usr/bin/*") and get a list of such files. I am looking for something similar in Qt (in C++). I have look at QDir::entryList() and entryInfoList(), but it seems I would have to extract the pat

[Interest] equivalent of python glob

2019-08-22 Thread Hamish Moffatt
Hi, In Python one can write the expression: glob.glob("/usr/bin/*") and get a list of such files. I am looking for something similar in Qt (in C++). I have look at QDir::entryList() and entryInfoList(), but it seems I would have to extract the path first and provide it to QDir. I can't use Q