mirror of
https://github.com/nasa/trick.git
synced 2024-12-19 21:27:54 +00:00
1201 icg nocomment file and dir (#1202)
* #1201 make icg_nocomment variable work with files as well as dirs closes #1201
This commit is contained in:
parent
4b2dc2f8ec
commit
1315db14a4
@ -302,28 +302,21 @@ bool HeaderSearchDirs::isPathInExtLib (const std::string& in_dir ) {
|
||||
return false ;
|
||||
}
|
||||
|
||||
bool HeaderSearchDirs::isPathInICGNoComment (const std::string& in_file ) {
|
||||
|
||||
char * resolved_path = almostRealPath(in_file.c_str() ) ;
|
||||
|
||||
if ( resolved_path != NULL ) {
|
||||
std::string dir = std::string(dirname(resolved_path)) + "/";
|
||||
|
||||
if ( icg_nocomment_files.find(dir) == icg_nocomment_files.end() ) {
|
||||
|
||||
icg_nocomment_files[dir] = false ;
|
||||
std::vector<std::string>::iterator vit ;
|
||||
for ( vit = icg_nocomment_dirs.begin() ; vit != icg_nocomment_dirs.end() ; vit++ ) {
|
||||
if ( ! dir.compare(0, (*vit).size(), (*vit))) {
|
||||
icg_nocomment_files[dir] = true ;
|
||||
break ;
|
||||
}
|
||||
bool HeaderSearchDirs::isPathInICGNoComment (const std::string& in_dir ) {
|
||||
if ( icg_nocomment_files.find(in_dir) != icg_nocomment_files.end() ) {
|
||||
return icg_nocomment_files[in_dir] ;
|
||||
}
|
||||
else {
|
||||
std::vector<std::string>::iterator vit ;
|
||||
for ( vit = icg_nocomment_dirs.begin() ; vit != icg_nocomment_dirs.end() ; vit++ ) {
|
||||
if ( ! in_dir.compare(0, (*vit).size(), (*vit))) {
|
||||
icg_nocomment_files[in_dir] = true ;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
free(resolved_path) ;
|
||||
return icg_nocomment_files[dir] ;
|
||||
}
|
||||
return false ;
|
||||
icg_nocomment_files[in_dir] = false ;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool HeaderSearchDirs::isPathInCompat15 (const std::string& in_dir ) {
|
||||
|
Loading…
Reference in New Issue
Block a user