Changeset 8453


Ignore:
Timestamp:
2004-11-04T17:21:06+13:00 (19 years ago)
Author:
jrm21
Message:

accept the 'collectionmacro' keyword for configure() from collect.cfg
and store any/all macros into the ColInfoResponse_t struct.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/colservr/collectserver.cpp

    r6584 r8453  
    8585    else if (key == "numwords") collectinfo.numWords = value.getint();
    8686    else if (key == "numbytes") collectinfo.numBytes = value.getint();
    87     else if (key == "collectionmeta" && cfgline.size() == 2)
    88       collectinfo.collectionmeta[cfgline[0]] = cfgline[1];
    89     else if (key == "collectionmeta" && cfgline.size() == 3 && collectinfo.collectionmeta[cfgline[0]].empty() )
    90       collectinfo.collectionmeta[cfgline[0]] = cfgline[2];
    91     else if (key == "format" && cfgline.size() == 2)
     87    else if (key == "collectionmeta") {
     88      if (cfgline.size() == 2)
     89    collectinfo.collectionmeta[cfgline[0]] = cfgline[1];
     90      else if (cfgline.size() == 3 &&
     91           collectinfo.collectionmeta[cfgline[0]].empty() )
     92    collectinfo.collectionmeta[cfgline[0]] = cfgline[2];
     93    } else if (key == "collectionmacro") {
     94      if (cfgline.size() == 2) // no params for this macro
     95    collectinfo.collection_macros
     96      .insert( make_pair(cfgline[0], make_pair(g_EmptyText,cfgline[1])) );
     97      else if (cfgline.size() == 3) {// has params
     98    // strip [ ] brackets from params
     99    text_t::const_iterator first=cfgline[1].begin()+1;
     100    text_t::const_iterator last=cfgline[1].end()-1;
     101    text_t nobrackets=substr(first, last);
     102    collectinfo.collection_macros
     103      .insert( make_pair(cfgline[0], make_pair(nobrackets,cfgline[2])) );
     104      }
     105    } else if (key == "format" && cfgline.size() == 2)
    92106      collectinfo.format[cfgline[0]] = cfgline[1];
    93107    else if (key == "building" && cfgline.size() == 2)
Note: See TracChangeset for help on using the changeset viewer.