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:
Alex Lin
2016-01-29 09:27:41 -06:00
parent 68ffd04dff
commit 71dab9ed45
3 changed files with 40 additions and 4 deletions

View File

@ -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 ;
}