Skip to content

ENH: rename txx files to hxx

Manuel Grizonnet requested to merge txx_to_hxx into develop

OTB followed since the beginning the ITK convention and use .txx extension for all template classes. Nevertheless, some development tools do not recognize .txx file extension. Other tool like GitHub can't do in-browser syntax highlighting for txx files I think.

The root problem is the use of the txx which should be changed to hxx (or hpp).

In 2011, after an in-depth discussion near April 20, 2011 on the Insight-Developers mailing list, ITK rename all txx files to hxx (and event prevent the push of .txx files with a pre-commit hook). It happens is major release v4.

You can find some arguments in the discussion about the change and also in other projects related to ITK which applied the same modification, see for instance VXL:

This commit apply now the same modification for OTB.

I understand that it will change some habit for developers and don't bring new features but I think that in general it is better to stay align with ITK guidelines.

In my opinion, it always facilitate the use of OTB and ITK together if we share when we can the same code architecture, directory organization, naming conventions...

What I've done:

update develop

git checkout develop git pull

delete branch

git branch -D txx_to_hxx

create branch

git checkout -b txx_to_hxx

Move hxx file to txx (That won't work for files containing .txx twice, but whatever)

for f in do git mv "f" "{f/.txx/.hxx}" done

echo "Rename txx in hxx in the source now..."

Rename txx to hxx in the code exclude (binary image, release note , licence

find . -type f -not -path "./.git/" -not -path "./Documentation/SoftwareGuide/Art/" -not -path "./Documentation/Cookbook/Art/" -not -path "./RELEASE_NOTES.txt" -not -path "./LICENSE" -not -path "./NOTICE" -not -path "./Packaging/Files/.zip" | xargs perl -pi -e 's/txx/hxx/g' find . -type f -not -path "./.git/" -not -path "./Documentation/SoftwareGuide/Art/" -not -path "./Documentation/Cookbook/Art/" -not -path "./RELEASE_NOTES.txt" -not -path "./LICENSE" -not -path "./NOTICE" -not -path "./Packaging/Files/.zip" | xargs perl -pi -e 's/TXX/HXX/g'

Edited by Manuel Grizonnet

Merge request reports