I search information about directory_iterator

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

I search information about directory_iterator

Boost - Users mailing list
I have:
#include <boost/filesystem.hpp>
namespace fs=boost::filesystem;

for (auto& de : fs::directory_iterator("D:\\prog\\alg\\Diff"))
{
    fs::path p = de.path();
    auto ext = fs::extension(p);
}

directory_iterator is object or non-objective method?
How can I write something similar, but database iterator.
I want get information from mySQL. The simplest way is add everything returning by select to vector of vector of string.
But I prefer database iterator. How it write? How is in general directory_iterator as a iterator model?

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users
Reply | Threaded
Open this post in threaded view
|

Re: I search information about directory_iterator

Boost - Users mailing list
On 16/02/2018 05:24, Andy wrote:
> How can I write something similar, but database iterator.
> I want get information from mySQL. The simplest way is add everything
> returning by select to vector of vector of string.
> But I prefer database iterator. How it write? How is in general
> directory_iterator as a iterator model?

http://en.cppreference.com/w/cpp/language/range-for

Essentially you need to return something that can have begin and end
called on it (either as free functions via ADL or as members).

And those need to return something that behaves like an iterator.

The rest is up to you.

_______________________________________________
Boost-users mailing list
[hidden email]
https://lists.boost.org/mailman/listinfo.cgi/boost-users