view Apps/updateDeDupe.cpp @ 102:5906661c0421

New attempt on getting correct encodings.
author Tom Fredrik Blenning Klaussen <bfg@bfgconsult.no>
date Thu, 13 Feb 2014 15:20:37 +0100
parents c17475848bf4
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);
  }

}