medInria/medInria-public — pull request #139 by rdebroiz (2014-01-17 11:13:03+00:00)
Title: #include's use <> everywhere.

Except when including templated files (.txx), Export files (someLibNameExport.h) and the header file of a classe in its implementation file (.cpp).

I use the folowing scripts :

```perl
#!/usr/bin/env perl
##############################################################################################
# Purpose: alwayse use angle brackets to #include, except when including the header of
# a class in the corresponding .cpp and when including Export headers
# Usage: "includeWithAngleBrackets.pl *.h"
# or "find . -name \*.h | xargs includeWithAngleBrackets.pl"

use warnings;
use strict;
use autodie;

use File::Copy qw(move);
use File::Spec ();
use File::Temp ();
use IO::Handle;

sub processSingleFile
{
my $filename = shift;
my ($volume, $dir, $basename) = File::Spec->splitpath($filename);
my ($name, $ext) = split(/\./, $basename);

open my $in, '<', $filename;
my $out = File::Temp->new(DIR => $volume . $dir);

while ( <$in> )
{
s/^#include *"(.*)"/#include <$1>/ig
if (!m/^#include *"((\Q$name\E(_p)?|.*Export)\.h|.*\.txx)/ig);
print $out $_;
}
$out->flush();
move($out->filename, $filename);
}

for (@ARGV)
{
processSingleFile $_;
}
```