feisty meow concerns codebase  2.140
recursive_file_copy.h
Go to the documentation of this file.
1 #ifndef RECURSIVE_FILE_COPY_CLASS
2 #define RECURSIVE_FILE_COPY_CLASS
3 
4 /*****************************************************************************\
5 * *
6 * Name : recursive file copy *
7 * Author : Chris Koeritz *
8 * *
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 \*****************************************************************************/
17 
18 #include <basis/astring.h>
19 #include <basis/contracts.h>
21 
22 namespace octopi {
23 
25 
27 {
28 public:
29  virtual ~recursive_file_copy();
30 
31  DEFINE_CLASS_NAME("recursive_file_copy");
32 
33  enum outcomes {
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
40  };
41  static const char *outcome_name(const basis::outcome &to_name);
42 
43 //hmmm: need an option to specify the logging that we are currently doing in here.
44 
46 
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());
54 };
55 
56 } //namespace.
57 
58 #endif
59 
Provides a dynamically resizable ASCII character string.
Definition: astring.h:35
static const astring & empty_string()
useful wherever empty strings are needed, e.g., function defaults.
Definition: astring.cpp:128
Outcomes describe the state of completion for an operation.
Definition: outcome.h:31
Copies entire hierarchies in the file system from one place to another.
DEFINE_CLASS_NAME("recursive_file_copy")
static const char * outcome_name(const basis::outcome &to_name)
static basis::outcome copy_hierarchy(int transfer_mode, const basis::astring &source_dir, const basis::astring &target_dir, const structures::string_array &includes, const basis::astring &source_start=basis::astring::empty_string())
copies a directory hierarchy starting at "source_dir" into "target_dir".
An array of strings with some additional helpful methods.
Definition: string_array.h:32