xaizek / zograscope (License: AGPLv3 only) (since 2018-12-07)
Mainly a syntax-aware diff that also provides a number of additional tools.
Commit 68cff0c2f63efe9dc2d5d1ec1f22a1d87c1c8099

Don't depend on boost::make_iterator_range()
Looks like it's gone in Boost 1.84 (or rather renamed to
iterator_range()), just write an equivalent to not worry about it and
not break compatibility with older Boost releases.
Author: xaizek
Author date (UTC): 2024-01-13 13:53
Committer name: xaizek
Committer date (UTC): 2024-01-13 13:53
Parent(s): 652fb94373e026b5f5f5cc6450306deb4e37cf7c
Signing key: 99DC5E4DB05F6BE2
Tree: fd0e717c0630583236dea606876c62fa5828f1de
File Lines added Lines deleted
src/tooling/Traverser.cpp 2 4
src/utils/iterators.hpp 22 15
File src/tooling/Traverser.cpp changed (mode: 100644) (index 654e13e..a7b02e3)
18 18
19 19 #include <boost/filesystem/operations.hpp> #include <boost/filesystem/operations.hpp>
20 20 #include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
21 #include <boost/range/adaptors.hpp>
22 21
23 22 #include <functional> #include <functional>
24 23 #include <string> #include <string>
 
26 25 #include <vector> #include <vector>
27 26
28 27 #include "tooling/Config.hpp" #include "tooling/Config.hpp"
28 #include "utils/iterators.hpp"
29 29 #include "Language.hpp" #include "Language.hpp"
30 30
31 31 namespace fs = boost::filesystem; namespace fs = boost::filesystem;
 
... ... Traverser::search(const boost::filesystem::path &path)
69 69 return match(path.string(), /*passedIn=*/true); return match(path.string(), /*passedIn=*/true);
70 70 } }
71 71
72 using it = fs::directory_iterator;
73
74 72 bool found = false; bool found = false;
75 for (fs::directory_entry &e : boost::make_iterator_range(it(path), it())) {
73 for (fs::directory_entry &e : rangeFrom<fs::directory_iterator>(path)) {
76 74 const fs::path &path = e.path(); const fs::path &path = e.path();
77 75 if (fs::is_directory(path)) { if (fs::is_directory(path)) {
78 76 if (config.shouldVisitDirectory(path.string())) { if (config.shouldVisitDirectory(path.string())) {
File src/utils/iterators.hpp copied from file tools/tui/views/DumpView.hpp (similarity 57%) (mode: 100644) (index e0ac515..e4122da)
1 // Copyright (C) 2019 xaizek <xaizek@posteo.net>
1 // Copyright (C) 2024 xaizek <xaizek@posteo.net>
2 2 // //
3 3 // This file is part of zograscope. // This file is part of zograscope.
4 4 // //
 
14 14 // You should have received a copy of the GNU Affero General Public License // You should have received a copy of the GNU Affero General Public License
15 15 // along with zograscope. If not, see <http://www.gnu.org/licenses/>. // along with zograscope. If not, see <http://www.gnu.org/licenses/>.
16 16
17 #ifndef ZOGRASCOPE_TOOLS_TUI_VIEWS_DUMPVIEW_HPP_
18 #define ZOGRASCOPE_TOOLS_TUI_VIEWS_DUMPVIEW_HPP_
17 #ifndef ZOGRASCOPE_UTILS_ITERATORS_HPP_
18 #define ZOGRASCOPE_UTILS_ITERATORS_HPP_
19 19
20 #include "cursed/Text.hpp"
20 #include <utility>
21 21
22 #include "../ViewManager.hpp"
23
24 class DumpView : public View
22 namespace guts
25 23 { {
26 public:
27 explicit DumpView(ViewManager &manager);
28 24
29 public:
30 virtual vle::Mode buildMode() override;
31 virtual void update() override;
25 template <typename I>
26 struct ItPair
27 {
28 I from;
29 I to;
32 30
33 private:
34 cursed::Text text;
31 I & begin() { return from; }
32 I & end() { return to; }
35 33 }; };
36 34
37 #endif // ZOGRASCOPE_TOOLS_TUI_VIEWS_DUMPVIEW_HPP_
35 }
36
37 template <typename I, typename... Args>
38 guts::ItPair<I>
39 rangeFrom(Args &&...args)
40 {
41 return guts::ItPair<I>{ I(std::forward<Args>(args)...), I() };
42 }
43
44 #endif // ZOGRASCOPE_UTILS_ITERATORS_HPP_
Hints

Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://code.reversed.top/user/xaizek/zograscope

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@code.reversed.top/user/xaizek/zograscope

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a pull request:
... clone the repository ...
... make some changes and some commits ...
git push origin master