view Apps/updateDeDupe.cpp @ 106:95fb1bcf7e24

Constant for turning follow symlinks on and off.
author Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no>
date Tue, 18 Feb 2014 17:05:48 +0100
parents 5906661c0421
children 27e628852401
line wrap: on
line source



#include "DataController.hpp"

#include "Exception/Exception.hpp"

#include <iostream>
#include <QtCore/QList>
#include <boost/foreach.hpp>
#include <boost/archive/detail/utf8_codecvt_facet.hpp>
#include <locale>
#include <boost/archive/add_facet.hpp>
//#include <codecvt>

int main(int argc, char *argv[]) {

  QStringList paths;

  /*
  typedef wchar_t ucs4_t;

  std::locale old_locale;
  std::locale utf8_locale(old_locale, new utf8_codecvt_facet<ucs4_t>);

  // Set a New global locale
  //std::locale::global(utf8_locale);
  */
  for (int i = 1; i < argc; ++i) {
    char path_buf[PATH_MAX];
    realpath(argv[i], path_buf);
    paths.push_back(path_buf);
  }

  try {
    if (paths.empty()) {
      DataController dc(false);
    }
    else {
      foreach(const QString& path, paths) {
	DataController dc(path, false);
      }
    }
  }
  catch (Exception& e) {
    std::cerr << "Unrecoverable error: " << e.toString().toStdString();
    exit(1);
  }

}