From 1c36adab776a900adc7325f412b1c8dd61b1a346 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 7 Mar 2018 15:22:51 +0200 Subject: Setup compilation, command line handling --- bdep/utility.hxx | 79 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 bdep/utility.hxx (limited to 'bdep/utility.hxx') diff --git a/bdep/utility.hxx b/bdep/utility.hxx new file mode 100644 index 0000000..48f168f --- /dev/null +++ b/bdep/utility.hxx @@ -0,0 +1,79 @@ +// file : bdep/utility.hxx -*- C++ -*- +// copyright : Copyright (c) 2014-2017 Code Synthesis Ltd +// license : MIT; see accompanying LICENSE file + +#ifndef BDEP_UTILITY_HXX +#define BDEP_UTILITY_HXX + +#include // make_shared() +#include // to_string() +#include // move(), forward(), declval(), make_pair() +#include // assert() +#include // make_move_iterator() + +#include + +#include // casecmp(), reverse_iterate(), etc + +#include + +#include +#include + +namespace bdep +{ + using std::move; + using std::forward; + using std::declval; + + using std::make_pair; + using std::make_shared; + using std::make_move_iterator; + using std::to_string; + + // + // + using butl::casecmp; + using butl::reverse_iterate; + + using butl::exception_guard; + using butl::make_exception_guard; + + // + // + using butl::auto_rmfile; + using butl::auto_rmdir; + + // Empty string and path. + // + extern const string empty_string; + extern const path empty_path; + extern const dir_path empty_dir_path; + + // Filesystem. + // + bool + exists (const path&, bool ignore_error = false); + + bool + exists (const dir_path&, bool ignore_error = false); + + bool + empty (const dir_path&); + + void + mk (const dir_path&); + + void + mk_p (const dir_path&); + + void + rm (const path&, uint16_t verbosity = 3); + + // Directory extracted from argv[0] (i.e., this process' recall directory) + // or empty if there is none. Can be used as a search fallback. + // + extern dir_path exec_dir; +} + +#endif // BDEP_UTILITY_HXX -- cgit v1.1