Ignore:
Timestamp:
06/03/12 21:39:02 (12 years ago)
Author:
tbretz
Message:
Allow to split command lines without equal signs
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/tools.cc

    r13713 r14054  
    156156//!   one entry then for this entry the euqal sign was missing.
    157157//!
    158 map<string,string> Tools::Split(string &opt)
     158map<string,string> Tools::Split(string &opt, bool allow)
    159159{
    160160    using namespace boost;
     
    176176    map<string,string> rc;
    177177
     178    int i=-1;
     179
    178180    for (; it!=tok.end(); it++)
    179181    {
     182        if (it->empty())
     183            continue;
     184
     185        i++;
     186
    180187        const size_t pos = it->find_first_of('=');
    181188        if (pos==string::npos)
    182189        {
     190            if (allow)
     191            {
     192                rc[to_string(i)] = *it;
     193                continue;
     194            }
     195
    183196            opt = "";
    184197            rc.clear();
Note: See TracChangeset for help on using the changeset viewer.