Ignore:
Timestamp:
01/08/06 16:35:04 (6 years ago)
Author:
pfp
Message:

Added ability to do compression.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/applications/NXtranslate/xml_parser.cpp

    r783 r800  
    4040typedef NodeVector* NodeVectorP; 
    4141typedef Ptr<Retriever> RetrieverPtr; 
     42typedef tree<Node> NodeTree; 
    4243 
    4344static const int    GROUP_STRING_LEN  = 128; 
     
    4748static const string SOURCE            = "NXS:source"; 
    4849static const string LOCATION          = "NXS:location"; 
     50static const string COMPRESSION       = "NXS:compression"; 
    4951static const string LINK              = "NAPIlink"; 
    5052static const string TARGET            = "target"; 
     
    190192 
    191193  // check for "name", "type", "source", "mime_type", "location", 
    192   // "target" attributes 
     194  // "target", "compression" attributes 
    193195  string source; 
    194196  string mime_type; 
    195197  string location; 
     198  string compression; 
    196199  string type; 
    197200  bool update_dims=false; 
     
    199202  for( StrVector::iterator it=str_attrs.begin() ; it!=str_attrs.end() ; it+=2){ 
    200203    if( (*it==SOURCE) || (*it==MIME_TYPE) || (*it==LOCATION) || (*it==TYPE) 
    201              || ((*it==TARGET) && (is_link)) || (*it==NAME) ){ 
     204        || ((*it==TARGET) && (is_link)) || (*it==NAME) || (*it==COMPRESSION) ){ 
    202205      if(*it==SOURCE){ 
    203206        source=*(it+1); 
     
    206209      }else if(*it==LOCATION){ 
    207210        location=*(it+1); 
     211      }else if(*it==COMPRESSION){ 
     212        compression=*(it+1); 
    208213      }else if(*it==NAME){ 
    209214        type=str_name; 
     
    316321  } 
    317322 
     323  // set the compression flag 
     324  if(!compression.empty()){ 
     325    if(node_from_retriever){ 
     326      for( NodeTree::iterator it=tree.begin() ; it!=tree.end() ; ++it ){ 
     327        it->set_comp(compression); 
     328      } 
     329    }else{ 
     330      node.set_comp(compression); 
     331    } 
     332  } 
     333 
    318334  // mutate the attributes if necessary 
    319335  if(node_attrs.size()>0) 
Note: See TracChangeset for help on using the changeset viewer.