Skip to content

Commit

Permalink
make std:: optional when converting iostream stuff to QgsDebugMsg
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@11985 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Nov 7, 2009
1 parent 8cc6b3f commit 6bb08d8
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions scripts/qgsloggermig.pl
Expand Up @@ -60,7 +60,7 @@
$lastinclude = scalar(@file)+1;
}

if(/std::(cout|cerr)/) {
if(/(std::)?(cout|cerr)/) {
die "nested? [$file]" if defined $output;
$output = "";
}
Expand All @@ -72,7 +72,7 @@
$output =~ s/$le/\n/g;

my $level = 0;
if($output =~ /^\s*\/\/\s*(std::(cout|cerr))/) {
if($output =~ /^\s*\/\/\s*((std::)?(cout|cerr))/) {
$level = 3;
$output =~ s/^\s*\/\///;
$output =~ s/\n\s*\/\//\n /g;
Expand All @@ -89,7 +89,7 @@
next;
}
unless( $arr[0] =~ /^std::(cout|cerr)$/ ) {
unless( $arr[0] =~ /^(std::)?(cout|cerr)$/ ) {
die "std::(cerr|cout) expected [$file]: |" . $arr[0] . "|";
}
Expand All @@ -102,14 +102,14 @@
$arr[-1] = "std::endl;";
}
if( $arr[-1] =~ /^std::flush;$/ &&
$arr[-2] =~ /^std::endl$/ ) {
if( $arr[-1] =~ /^(std::)?flush;$/ &&
$arr[-2] =~ /^(std::)?endl$/ ) {
pop @arr;
pop @arr;
push @arr, "std::endl;";
}
unless( $arr[-1] =~ /^std::endl;$/ ) {
unless( $arr[-1] =~ /^(std::)?endl;$/ ) {
die "std::endl; expected [$file]: |" . $arr[-1] . "|";
}
Expand Down

0 comments on commit 6bb08d8

Please sign in to comment.