TestGrammar/src/ParseObjects.cpp
// one line could have two types "array;dictionary" 
// function returns index into the "array" based on obj's type
// returns -1 if type doesn't exist in string
one line could have two types "array;dictionary"
function returns index into the "array" based on obj's type
returns -1 if type doesn't exist in string
one line could have two types " array ; dictionary " function returns index into the " array " based on obj ' s type returns - 1 if type doesn ' t exist in string
int CParsePDF::get_type_index(PdsObject *obj, std::string types) {
  std::vector<std::string> opt = split(types, ';');
  for (auto i = 0; i < (int)opt.size(); i++) {
    std::string function;
    opt[i] = extract_function(opt[i], function);
    if ((obj->GetObjectType() == kPdsBoolean) && (opt[i] == "BOOLEAN"))
      return i;
    if ((obj->GetObjectType() == kPdsNumber) && ((opt[i] == "NUMBER") || (opt[i] == "INTEGER") || (opt[i] == "BITMASK")))
      return i;
    if ((obj->GetObjectType() == kPdsName) && (opt[i] == "NAME"))
      return i;
    if ((obj->GetObjectType() == kPdsNull) && (opt[i] == "NULL"))
      return i;
    if ((obj->GetObjectType() == kPdsStream) && (opt[i] == "STREAM"))
      return i;
    if ((obj->GetObjectType() == kPdsString) && ((opt[i] == "STRING") || (opt[i] == "DATE") || (opt[i] == "STRING-BYTE") || (opt[i] == "STRING-TEXT") || (opt[i] == "STRING-ASCII")))
      return i;
    if ((obj->GetObjectType() == kPdsArray) && ((opt[i] == "ARRAY") || (opt[i] == "RECTANGLE") || (opt[i] == "MATRIX")))
      return i;
    if ((obj->GetObjectType() == kPdsDictionary) && ((opt[i] == "DICTIONARY") || (opt[i] == "NUMBER-TREE") || (opt[i] == "NAME-TREE")))
      return i;
  }
  return -1;
}
int CParsePDF :: get_type_index ( PdsObject * obj , std :: string types ) { std :: vector < std :: string > opt = split ( types , ' ' ) ; for ( auto i = 0 ; i < ( int ) opt . size ( ) ; i ++ ) { std :: string function ; opt [ i ] = extract_function ( opt [ i ] , function ) ; if ( ( obj -> GetObjectType ( ) == kPdsBoolean ) && ( opt [ i ] == " " ) ) return i ; if ( ( obj -> GetObjectType ( ) == kPdsNumber ) && ( ( opt [ i ] == " " ) || ( opt [ i ] == " " ) || ( opt [ i ] == " " ) ) ) return i ; if ( ( obj -> GetObjectType ( ) == kPdsName ) && ( opt [ i ] == " " ) ) return i ; if ( ( obj -> GetObjectType ( ) == kPdsNull ) && ( opt [ i ] == " " ) ) return i ; if ( ( obj -> GetObjectType ( ) == kPdsStream ) && ( opt [ i ] == " " ) ) return i ; if ( ( obj -> GetObjectType ( ) == kPdsString ) && ( ( opt [ i ] == " " ) || ( opt [ i ] == " " ) || ( opt [ i ] == " " ) || ( opt [ i ] == " " ) || ( opt [ i ] == " " ) ) ) return i ; if ( ( obj -> GetObjectType ( ) == kPdsArray ) && ( ( opt [ i ] == " " ) || ( opt [ i ] == " " ) || ( opt [ i ] == " " ) ) ) return i ; if ( ( obj -> GetObjectType ( ) == kPdsDictionary ) && ( ( opt [ i ] == " " ) || ( opt [ i ] == " " ) || ( opt [ i ] == " " ) ) ) return i ; } return -1 ; }
one line could have two types "array;dictionary"
function returns index into the "array" based on obj's type
returns -1 if type doesn't exist in string
one line could have two types " array ; dictionary " function returns index into the " array " based on obj ' s type returns - 1 if type doesn ' t exist in string