mirror of
https://github.com/nasa/trick.git
synced 2025-06-21 08:29:39 +00:00
Introduce Open Dynamics Engine examples
I want Trick to parse and understand ODE header files. The ODE header files include some typedef constructs ICG was skipping. Added code to handle the typedefs we did not handle before. Also made a small change the way TRICK_ICG_EXCLDUE and TRICK_EXCLUDE are used so that they support excluding individual files as well as directories.
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
@ -138,7 +139,13 @@ void HeaderSearchDirs::AddICGExcludeDirs () {
|
||||
if ( ! item.empty() ) {
|
||||
char * resolved_path = realpath(item.c_str(), NULL) ;
|
||||
if ( resolved_path ) {
|
||||
icg_exclude_dirs.push_back(std::string(resolved_path) + std::string("/"));
|
||||
std::ifstream file_or_dir(resolved_path) ;
|
||||
file_or_dir.seekg(0, std::ios::end) ;
|
||||
if ( !file_or_dir.good()) {
|
||||
icg_exclude_dirs.push_back(std::string(resolved_path) + std::string("/"));
|
||||
} else {
|
||||
icg_exclude_dirs.push_back(std::string(resolved_path));
|
||||
}
|
||||
} else {
|
||||
std::cout << "Cannot find TRICK_ICG_EXCLUDE directory " << item << std::endl ;
|
||||
}
|
||||
@ -160,7 +167,13 @@ void HeaderSearchDirs::AddExcludeDirs () {
|
||||
if ( ! item.empty() ) {
|
||||
char * resolved_path = realpath(item.c_str(), NULL) ;
|
||||
if ( resolved_path ) {
|
||||
exclude_dirs.push_back(std::string(resolved_path) + std::string("/"));
|
||||
std::ifstream file_or_dir(resolved_path) ;
|
||||
file_or_dir.seekg(0, std::ios::end) ;
|
||||
if ( !file_or_dir.good()) {
|
||||
exclude_dirs.push_back(std::string(resolved_path) + std::string("/"));
|
||||
} else {
|
||||
exclude_dirs.push_back(std::string(resolved_path));
|
||||
}
|
||||
} else {
|
||||
std::cout << "Cannot find TRICK_ICG_EXCLUDE directory " << item << std::endl ;
|
||||
}
|
||||
|
Reference in New Issue
Block a user