[cmake-commits] alex committed cmFileCommand.h 1.24 1.25 cmFileCommand.cxx 1.83 1.84

cmake-commits at cmake.org cmake-commits at cmake.org
Thu Jun 7 13:51:19 EDT 2007


Update of /cvsroot/CMake/CMake/Source
In directory public:/mounts/ram/cvs-serv8759/Source

Modified Files:
	cmFileCommand.h cmFileCommand.cxx 
Log Message:

STYLE: remove out commented code

Alex


Index: cmFileCommand.h
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFileCommand.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- cmFileCommand.h	25 May 2007 20:46:50 -0000	1.24
+++ cmFileCommand.h	7 Jun 2007 17:51:17 -0000	1.25
@@ -9,8 +9,8 @@
   Copyright (c) 2002 Kitware, Inc., Insight Consortium.  All rights reserved.
   See Copyright.txt or http://www.cmake.org/HTML/Copyright.html for details.
 
-     This software is distributed WITHOUT ANY WARRANTY; without even 
-     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
      PURPOSE.  See the above copyright notices for more information.
 
 =========================================================================*/
@@ -31,7 +31,7 @@
   /**
    * This is a virtual constructor for the command.
    */
-  virtual cmCommand* Clone() 
+  virtual cmCommand* Clone()
     {
     return new cmFileCommand;
     }
@@ -55,11 +55,11 @@
   /**
    * Succinct documentation.
    */
-  virtual const char* GetTerseDocumentation() 
+  virtual const char* GetTerseDocumentation()
     {
     return "File manipulation command.";
     }
-  
+
   /**
    * More documentation.
    */
@@ -74,7 +74,6 @@
       "       [LENGTH_MINIMUM numBytes] [LENGTH_MAXIMUM numBytes]\n"
       "       [NEWLINE_CONSUME] [REGEX regex]\n"
       "       [NO_HEX_CONVERSION])\n"
-      "  FILE(HEX_TO_BIN inputfile outputfile)\n"
       "  FILE(GLOB variable [RELATIVE path] [globbing expressions]...)\n"
       "  FILE(GLOB_RECURSE variable [RELATIVE path] \n"
       "       [globbing expressions]...)\n"
@@ -100,9 +99,6 @@
       "return (CR) characters are ignored. It works also for Intel Hex and "
       "Motorola S-record files, which are automatically converted to binary "
       "format when reading them. Disable this using NO_HEX_CONVERSION.\n "
-/*      "HEX_TO_BIN will convert an Intel hex file or Motorola S-record file "
-      "to a binary file. If the input file is no such file it will simply "
-      "be copied. \n"*/
       "LIMIT_COUNT sets the maximum number of strings to return. "
       "LIMIT_INPUT sets the maximum number of bytes to read from "
       "the input file. "
@@ -145,7 +141,7 @@
       " a cmake style path into the native path style \\ for windows and / "
       "for UNIX.";
     }
-  
+
   cmTypeMacro(cmFileCommand, cmCommand);
 
 protected:
@@ -153,15 +149,14 @@
   bool HandleWriteCommand(std::vector<std::string> const& args, bool append);
   bool HandleReadCommand(std::vector<std::string> const& args);
   bool HandleStringsCommand(std::vector<std::string> const& args);
-//  bool HandleHex2BinCommand(std::vector<std::string> const& args);
   bool HandleGlobCommand(std::vector<std::string> const& args, bool recurse);
   bool HandleMakeDirectoryCommand(std::vector<std::string> const& args);
-  
+
   bool HandleRelativePathCommand(std::vector<std::string> const& args);
   bool HandleCMakePathCommand(std::vector<std::string> const& args,
                               bool nativePath);
   void ComputeVersionedName(std::string& name, const char* version);
-  
+
   // FILE(INSTALL ...) related functions
   bool HandleInstallCommand(std::vector<std::string> const& args);
   bool ParseInstallArgs(std::vector<std::string> const& args,
@@ -186,9 +181,9 @@
                  const bool optional
                 );
   void GetTargetTypeFromString(const std::string& stype, int& itype) const;
-  bool HandleInstallDestination(cmFileInstaller& installer, 
+  bool HandleInstallDestination(cmFileInstaller& installer,
                                 std::string& destination);
-  void HandleInstallPermissions(cmFileInstaller& installer, 
+  void HandleInstallPermissions(cmFileInstaller& installer,
                                 mode_t& permissions_file,
                                 mode_t& permissions_dir,
                                 int itype,

Index: cmFileCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFileCommand.cxx,v
retrieving revision 1.83
retrieving revision 1.84
diff -u -d -r1.83 -r1.84
--- cmFileCommand.cxx	25 May 2007 20:46:50 -0000	1.83
+++ cmFileCommand.cxx	7 Jun 2007 17:51:17 -0000	1.84
@@ -76,10 +76,6 @@
     {
     return this->HandleStringsCommand(args);
     }
-/*  else if ( subCommand == "HEX_TO_BIN" )
-    {
-    return this->HandleHex2BinCommand(args);
-    }*/
   else if ( subCommand == "GLOB" )
     {
     return this->HandleGlobCommand(args, false);
@@ -236,7 +232,7 @@
   std::string line;
   bool has_newline = false;
   while (sizeLimit != 0 &&
-         cmSystemTools::GetLineFromStream(file, line, &has_newline, 
+         cmSystemTools::GetLineFromStream(file, line, &has_newline,
                                           sizeLimit) )
     {
     if (sizeLimit > 0)
@@ -262,53 +258,6 @@
 }
 
 //----------------------------------------------------------------------------
-/*bool cmFileCommand::HandleHex2BinCommand(std::vector<std::string> const& args)
-{
-  if(args.size() != 3)
-    {
-    this->SetError("HEX_TO_BIN requires an input and an output file name");
-    return false;
-    }
-  // Get the file to read.
-  std::string inFileName = args[1];
-  if(!cmsys::SystemTools::FileIsFullPath(inFileName.c_str()))
-    {
-    inFileName = this->Makefile->GetCurrentDirectory();
-    inFileName += "/" + args[1];
-    }
-
-  // Get the file to write.
-  std::string outFileName = args[2];
-  if(!cmsys::SystemTools::FileIsFullPath(outFileName.c_str()))
-    {
-    outFileName = this->Makefile->GetCurrentDirectory();
-    outFileName += "/" + args[2];
-    }
-
-  if ( !this->Makefile->CanIWriteThisFile(outFileName.c_str()) )
-    {
-    std::string e
-      = "attempted to write a file: " + outFileName +
-      " into a source directory.";
-    this->SetError(e.c_str());
-    cmSystemTools::SetFatalErrorOccured();
-    return false;
-    }
-
-  std::string dir = cmSystemTools::GetFilenamePath(outFileName);
-  cmSystemTools::MakeDirectory(dir.c_str());
-
-  bool success = cmHexFileConverter::TryConvert(inFileName.c_str(), 
-                                                outFileName.c_str());
-  if (!success)
-    {
-    success = cmSystemTools::CopyFileAlways(inFileName.c_str(), 
-                                            outFileName.c_str());
-    }
-  return success;
-} */
-
-//----------------------------------------------------------------------------
 bool cmFileCommand::HandleStringsCommand(std::vector<std::string> const& args)
 {
   if(args.size() < 3)
@@ -485,7 +434,7 @@
       fileName = binaryFileName;
       }
     }
-    
+
   // Open the specified file.
 #if defined(_WIN32) || defined(__CYGWIN__)
   std::ifstream fin(fileName.c_str(), std::ios::in | std::ios::binary);
@@ -1089,7 +1038,7 @@
 }
 
 //----------------------------------------------------------------------------
-void cmFileCommand::HandleInstallPermissions(cmFileInstaller& installer, 
+void cmFileCommand::HandleInstallPermissions(cmFileInstaller& installer,
                               mode_t& permissions_file,
                               mode_t& permissions_dir,
                               int itype,
@@ -1190,7 +1139,7 @@
 
 
 //----------------------------------------------------------------------------
-bool cmFileCommand::HandleInstallDestination(cmFileInstaller& installer, 
+bool cmFileCommand::HandleInstallDestination(cmFileInstaller& installer,
                                              std::string& destination)
 {
   if ( destination.size() < 2 )
@@ -1199,7 +1148,7 @@
         "No DESTINATION provided or .");
     return false;
     }
-    
+
   const char* destdir = cmSystemTools::GetEnv("DESTDIR");
   if ( destdir && *destdir )
     {
@@ -1299,9 +1248,9 @@
 
   std::map<cmStdString, const char*> properties;
   bool optional = false;
-  bool result = this->ParseInstallArgs(args, installer, components, 
-                                       configurations, properties, 
-                                       itype, rename, destination, files, 
+  bool result = this->ParseInstallArgs(args, installer, components,
+                                       configurations, properties,
+                                       itype, rename, destination, files,
                                        optional);
   if (result == true)
     {
@@ -1640,7 +1589,7 @@
 
     this->GetTargetTypeFromString(stype, itype);
 
-    this->HandleInstallPermissions(installer, 
+    this->HandleInstallPermissions(installer,
                              permissions_file,
                              permissions_dir,
                              itype,
@@ -1759,10 +1708,10 @@
           cmSystemTools::RemoveFile(soname.c_str());
           cmSystemTools::RemoveFile(libname.c_str());
 
-          if (!cmSystemTools::CreateSymlink(soname_nopath.c_str(), 
+          if (!cmSystemTools::CreateSymlink(soname_nopath.c_str(),
                                             libname.c_str()) )
             {
-            std::string errstring = "error when creating symlink from: " 
+            std::string errstring = "error when creating symlink from: "
               + libname + " to " + soname_nopath;
             this->SetError(errstring.c_str());
             return false;
@@ -1770,10 +1719,10 @@
           installer.ManifestAppend(libname);
           if ( toFile != soname )
             {
-            if ( !cmSystemTools::CreateSymlink(fromName.c_str(), 
+            if ( !cmSystemTools::CreateSymlink(fromName.c_str(),
                                                soname.c_str()) )
               {
-              std::string errstring = "error when creating symlink from: " 
+              std::string errstring = "error when creating symlink from: "
                 + soname + " to " + fromName;
               this->SetError(errstring.c_str());
               return false;
@@ -1805,10 +1754,10 @@
 
           cmSystemTools::RemoveFile(exename.c_str());
 
-          if (!cmSystemTools::CreateSymlink(exename_nopath.c_str(), 
+          if (!cmSystemTools::CreateSymlink(exename_nopath.c_str(),
                                             exename.c_str()) )
             {
-            std::string errstring = "error when creating symlink from: " 
+            std::string errstring = "error when creating symlink from: "
               + exename + " to " + exename_nopath;
             this->SetError(errstring.c_str());
             return false;
@@ -1901,22 +1850,22 @@
 
   if(!cmSystemTools::FileIsFullPath(directoryName.c_str()))
     {
-    std::string errstring = 
-      "RelativePath must be passed a full path to the directory: " 
+    std::string errstring =
+      "RelativePath must be passed a full path to the directory: "
       + directoryName;
     this->SetError(errstring.c_str());
     return false;
     }
   if(!cmSystemTools::FileIsFullPath(fileName.c_str()))
     {
-    std::string errstring = 
-      "RelativePath must be passed a full path to the file: " 
+    std::string errstring =
+      "RelativePath must be passed a full path to the file: "
       + fileName;
     this->SetError(errstring.c_str());
     return false;
     }
 
-  std::string res = cmSystemTools::RelativePath(directoryName.c_str(), 
+  std::string res = cmSystemTools::RelativePath(directoryName.c_str(),
                                                 fileName.c_str());
   this->Makefile->AddDefinition(outVar.c_str(),
     res.c_str());
@@ -1949,7 +1898,7 @@
 
 //----------------------------------------------------------------------------
 bool cmFileCommand::HandleCMakePathCommand(std::vector<std::string>
-                                           const& args, 
+                                           const& args,
                                            bool nativePath)
 {
   std::vector<std::string>::const_iterator i = args.begin();
@@ -1965,7 +1914,7 @@
 #else
   char pathSep = ':';
 #endif
-  std::vector<cmsys::String> path = cmSystemTools::SplitString(i->c_str(), 
+  std::vector<cmsys::String> path = cmSystemTools::SplitString(i->c_str(),
                                                              pathSep);
   i++;
   const char* var =  i->c_str();
@@ -1986,7 +1935,7 @@
       *j = cmSystemTools::ConvertToOutputPath(j->c_str());
       // remove double quotes in the path
       cmsys::String& s = *j;
-      
+
       if(s.size() > 1 && s[0] == '\"' && s[s.size()-1] == '\"')
         {
         s = s.substr(1,s.size()-2);



More information about the Cmake-commits mailing list