You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
class directory_iterator {
public:
typedef directory_entry value_type;
typedef ptrdiff_t difference_type;
typedef value_type const* pointer;
typedef value_type const& reference;
typedef input_iterator_tag iterator_category;
public:
//ctor & dtor
directory_iterator() noexcept {}
explicit directory_iterator(const path& __p)
: directory_iterator(__p, nullptr) {}
directory_iterator(const path& __p, directory_options __opts)
: directory_iterator(__p, nullptr, __opts) {}
directory_iterator(const path& __p, error_code& __ec)
: directory_iterator(__p, &__ec) {}
directory_iterator(const path& __p, directory_options __opts,
error_code& __ec)
: directory_iterator(__p, &__ec, __opts) {}
directory_iterator(const directory_iterator&) = default;
directory_iterator(directory_iterator&&) = default;
directory_iterator& operator=(const directory_iterator&) = default;
directory_iterator& operator=(directory_iterator&& __o) noexcept {
// non-default implementation provided to support self-move assign.
if (this != &__o) {
_imp = _VSTD::move(__o._imp);
}
return *this;
}
~directory_iterator() = default;
const directory_entry& operator*() const {
_LIBCPP_ASSERT(_imp, "The end iterator cannot be dereferenced");
return __dereference();
}
const directory_entry* operator->() const { return &**this; }
directory_iterator& operator++() { return __increment(); }
__dir_element_proxy operator++(int) {
__dir_element_proxy __p(**this);
__increment();
return __p;
}
directory_iterator& increment(error_code& __ec) { return __increment(&__ec); }
private:
inline _LIBCPP_INLINE_VISIBILITY friend bool
operator==(const directory_iterator& __lhs,
const directory_iterator& __rhs) noexcept;
// construct the dir_stream
_LIBCPP_FUNC_VIS
directory_iterator(const path&, error_code*,
directory_options = directory_options::none);
_LIBCPP_FUNC_VIS
directory_iterator& __increment(error_code* __ec = nullptr);
_LIBCPP_FUNC_VIS
const directory_entry& __dereference() const;
private:
shared_ptr<__dir_stream> _imp;
};
比如这个类,我可以hook directory_iterator(const path& __p) 这类函数吗?
Beta Was this translation helpful? Give feedback.
All reactions