libfilezilla
hostname_lookup.hpp
Go to the documentation of this file.
1 #ifndef LIBFILEZILLA_HOSTNAME_LOOKUP_HEADER
2 #define LIBFILEZILLA_HOSTNAME_LOOKUP_HEADER
3 
8 #include "libfilezilla.hpp"
9 #include "iputils.hpp"
10 #include "event_handler.hpp"
11 
12 namespace fz {
13 class FZ_PUBLIC_SYMBOL hostname_lookup
14 {
15 public:
16  hostname_lookup(thread_pool& pool, event_handler& evt_handler);
17  ~hostname_lookup();
18 
19  hostname_lookup(hostname_lookup const&) = delete;
20  hostname_lookup& operator=(hostname_lookup const&) = delete;
21 
30  bool lookup(native_string const& host, address_type family = address_type::unknown);
31 
32  void reset();
33 
34 private:
35  class impl;
36  impl* impl_{};
37 };
38 
40 struct hostname_lookup_event_type {};
41 
44 }
45 
46 #endif
Simple handler for asynchronous event processing.
Definition: event_handler.hpp:55
Definition: hostname_lookup.hpp:14
bool lookup(native_string const &host, address_type family=address_type::unknown)
Looks up the passed host.
This is the recommended event class.
Definition: event.hpp:68
A dumb thread-pool for asynchronous tasks.
Definition: thread_pool.hpp:64
Declares the event_handler class.
Various functions to deal with IP address strings.
Sets some global macros and further includes string.hpp.
The namespace used by libfilezilla.
Definition: apply.hpp:17
std::wstring native_string
A string in the system's native character type and encoding. Note: This typedef changes depending on...
Definition: string.hpp:34
simple_event< hostname_lookup_event_type, hostname_lookup *, int, std::vector< std::string > > hostname_lookup_event
Results of hostname_lookup. On success, second argument is zero, otherwise an error code.
Definition: hostname_lookup.hpp:43