function clang-format-project
{
if [[ ! -f .clang-format ]]
then
echo "$PWD/.clang-format does not exist."
return 1
fi
for dir_to_format in include source src test tests
do
if [[ -d $dir_to_format ]]
then
find $dir_to_format -name "*.[hc]pp" | xargs clang-format.exe -i -style=file:.clang-format --verbose
fi
done
}
export -f clang-format-project