Changeset 126 for trunk/lib


Ignore:
Timestamp:
Aug 2, 2006, 1:05:52 AM (15 years ago)
Author:
Jari Häkkinen
Message:

Changed createdir to mkdir, removed the ugly force option from the function.

Location:
trunk/lib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/Directory.cc

    r118 r126  
    134134  void Directory::print(const bool verbose) const
    135135  {
    136     createdir(output_name());
     136    mkdir(output_name());
    137137    std::string output(output_name() + "/index.html");
    138138    if (verbose)
  • trunk/lib/utility.cc

    r125 r126  
    3131#include <string>
    3232#include <sys/param.h>
    33 #include <sys/stat.h>
    3433#include <unistd.h>
    3534
     
    4645      std::cerr << "Error: svn blame " << path << std::endl;     
    4746    return system_return;
    48   }
    49 
    50   int createdir(const std::string& dir, bool force)
    51   {
    52     struct stat buf;
    53     if (force && !stat(dir.c_str(),&buf))
    54       rmdirhier(dir);
    55 
    56     return mkdir(dir.c_str(),0777);
    5747  }
    5848
  • trunk/lib/utility.h

    r118 r126  
    1313  svnstat is distributed in the hope that it will be useful, but
    1414  WITHOUT ANY WARRANTY; without even the implied warranty of
    15   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    1616  General Public License for more details.
    1717
     
    3333#include <vector>
    3434
     35#include <sys/stat.h>
     36
    3537namespace theplu{
    3638namespace svnstat{
     
    4042  ///
    4143  int blame(const std::string&);
    42  
     44
    4345  ///
    4446  /// Create directory \a dir. The call can fail in many ways, cf. 'man
    45   /// mkdir'. If the \a dir exists, setting \a force to true will
    46   /// trigger a recursive removal of the target \a dir.
     47  /// mkdir'.
    4748  ///
    48   int createdir(const std::string& dir, bool force=false);
     49  inline int mkdir(const std::string& dir) { return ::mkdir(dir.c_str(),0777); }
    4950
    5051  ///
     
    126127  };
    127128
    128   ///
    129   /// @return resulting vector
    130   ///
    131   template <typename Key, typename T>
     129  ///
     130  /// @return resulting vector
     131  ///
     132  template <typename Key, typename T>
    132133  struct PairValuePlus :
    133134    public std::binary_function<std::vector<T>,
     
    162163  };
    163164
    164 }}
     165}} // end of namespace svnstat end of namespace theplu
    165166
    166 // end of namespace svnstat end of namespace theplu
    167167#endif
Note: See TracChangeset for help on using the changeset viewer.