Ignore privacy

Moved field offset calculations for inherited classes to when the inherited
classes are processed.  This removes the need to have to remember if fields
were inherited or not, the offset already reflects the correct offset.

refs #218
This commit is contained in:
Alex Lin
2016-04-06 12:06:14 -05:00
parent 7dcc65d0bd
commit 4dad11bf45
11 changed files with 46 additions and 118 deletions

View File

@ -84,7 +84,6 @@ void CommentSaver::getICGField( std::string file_name ) {
/* default the icg_no flags to false */
icg_no_found[file_name] = false ;
icg_no_comment_found[file_name] = false ;
invade_privacy[file_name] = false ;
std::string th_str = getTrickHeaderComment(file_name) ;
if ( ! th_str.empty() ) {
@ -114,10 +113,6 @@ void CommentSaver::getICGField( std::string file_name ) {
exit(-1) ;
}
}
size_t trick_parse_invade_privacy = th_str.find("trick_invade_privacy") ;
if ( trick_parse_invade_privacy != std::string::npos ) {
invade_privacy[file_name] = true ;
}
} else {
std::transform(th_str.begin(), th_str.end(), th_str.begin(), ::toupper) ;
@ -126,14 +121,6 @@ void CommentSaver::getICGField( std::string file_name ) {
regmatch_t pmatch[10] ;
memset(pmatch , 0 , sizeof(pmatch)) ;
ret = regcomp( &reg_expr , "(INVADE[ _]PRIVACY:)" , REG_EXTENDED | REG_ICASE ) ;
ret = regexec( &reg_expr , th_str.c_str() , 10 , pmatch , 0 ) ;
regfree(&reg_expr) ;
if ( ret == 0 ) {
invade_privacy[file_name] = true ;
}
/* POSIX regular expressions are always greedy, making our job harder.
We have to use several regular expressions to get the types. This was
so much easier in perl! */
@ -206,15 +193,6 @@ bool CommentSaver::hasICGNoComment( std::string file_name ) {
return icg_no_comment_found[file_name] ;
}
bool CommentSaver::hasInvadePrivacy( std::string file_name ) {
if ( invade_privacy.find(file_name) == invade_privacy.end() ) {
getICGField(file_name) ;
}
return invade_privacy[file_name] ;
}
std::set< std::string > CommentSaver::getIgnoreTypes( std::string file_name ) {
std::set< std::string > ignore_types ;
std::string th_str = getTrickHeaderComment(file_name) ;