Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

pandatool/src/cvscopy/testCopy.cxx

Go to the documentation of this file.
00001 // Filename: testCopy.cxx
00002 // Created by:  drose (31Oct00)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #include "testCopy.h"
00020 #include "cvsSourceDirectory.h"
00021 
00022 ////////////////////////////////////////////////////////////////////
00023 //     Function: TestCopy::Constructor
00024 //       Access: Public
00025 //  Description:
00026 ////////////////////////////////////////////////////////////////////
00027 TestCopy::
00028 TestCopy() {
00029   set_program_description
00030     ("This program copies one or more files into a CVS source hierarchy.  "
00031      "Rather than copying the named files immediately into the current "
00032      "directory, it first scans the entire source hierarchy, identifying all "
00033      "the already-existing files.  If the named file to copy matches the "
00034      "name of an already-existing file in the current directory or elsewhere "
00035      "in the hierarchy, that file is overwritten.\n\n"
00036 
00037      "This is primarily useful as a test program for libcvscopy.");
00038 }
00039 
00040 ////////////////////////////////////////////////////////////////////
00041 //     Function: TestCopy::run
00042 //       Access: Public
00043 //  Description:
00044 ////////////////////////////////////////////////////////////////////
00045 void TestCopy::
00046 run() {
00047   SourceFiles::iterator fi;
00048   for (fi = _source_files.begin(); fi != _source_files.end(); ++fi) {
00049     CVSSourceDirectory *dest = import(*fi, 0, _model_dir);
00050     if (dest == (CVSSourceDirectory *)NULL) {
00051       exit(1);
00052     }
00053   }
00054 }
00055 
00056 ////////////////////////////////////////////////////////////////////
00057 //     Function: TestCopy::copy_file
00058 //       Access: Protected, Virtual
00059 //  Description: Called by import() if the timestamps indicate that a
00060 //               file needs to be copied.  This does the actual copy
00061 //               of a file from source to destination.  If new_file is
00062 //               true, then dest does not already exist.
00063 ////////////////////////////////////////////////////////////////////
00064 bool TestCopy::
00065 copy_file(const Filename &source, const Filename &dest,
00066           CVSSourceDirectory *, void *, bool) {
00067   return copy_binary_file(source, dest);
00068 }
00069 
00070 
00071 int main(int argc, char *argv[]) {
00072   TestCopy prog;
00073   prog.parse_command_line(argc, argv);
00074   prog.run();
00075   return 0;
00076 }

Generated on Fri May 2 03:17:03 2003 for Panda-Tool by doxygen1.3