1 #ifndef RECURSIVE_FILE_COPY_CLASS
2 #define RECURSIVE_FILE_COPY_CLASS
4 /*****************************************************************************\
6 * Name : recursive file copy *
7 * Author : Chris Koeritz *
9 *******************************************************************************
10 * Copyright (c) 2005-$now By Author. This program is free software; you can *
11 * redistribute it and/or modify it under the terms of the GNU General Public *
12 * License as published by the Free Software Foundation; either version 2 of *
13 * the License or (at your option) any later version. This is online at: *
14 * http://www.fsf.org/copyleft/gpl.html *
15 * Please send any updates to: fred@gruntose.com *
16 \*****************************************************************************/
18 #include <basis/astring.h>
19 #include <basis/contracts.h>
20 #include <filesystem/filename_list.h>
24 //! Copies entire hierarchies in the file system from one place to another.
26 class recursive_file_copy
29 virtual ~recursive_file_copy();
31 DEFINE_CLASS_NAME("recursive_file_copy");
34 OKAY = basis::common::OKAY,
35 BAD_INPUT = basis::common::BAD_INPUT,
36 GARBAGE = basis::common::GARBAGE,
37 NOT_FOUND = basis::common::NOT_FOUND,
38 NONE_READY = basis::common::NONE_READY,
39 FAILURE = basis::common::FAILURE
41 static const char *outcome_name(const basis::outcome &to_name);
43 //hmmm: need an option to specify the logging that we are currently doing in here.
45 //! copies a directory hierarchy starting at "source_dir" into "target_dir".
46 /*! the "transfer_mode" is a combination of mode values from the file_transfer_tentacle class,
47 and dictates how the files to copy will be decided. the "includes" is a list of files that will
48 be included. if that is an empty array, then all files will be included. the "source_start"
49 is a subdirectory within the source to start copying at; only items there and below will be
51 static basis::outcome copy_hierarchy(int transfer_mode, const basis::astring &source_dir,
52 const basis::astring &target_dir, const structures::string_array &includes,
53 const basis::astring &source_start = basis::astring::empty_string());