コード例 #1
0
 bool next()
 {
    if(N == -1)
       return false;
    if(N+1 < (int)subs.size())
    {
       ++N;
       result =((subs[N] == -1) ? what.prefix() : what[subs[N]]);
       return true;
    }
    //if(what.prefix().first != what[0].second)
    //   flags |= match_prev_avail | regex_constants::match_not_bob;
    BidirectionalIterator last_end(what[0].second);
    if(u32regex_search(last_end, end, what, re, ((what[0].first == what[0].second) ? flags | regex_constants::match_not_initial_null : flags), base))
    {
       N =0;
       result =((subs[N] == -1) ? what.prefix() : what[subs[N]]);
       return true;
    }
    else if((last_end != end) && (subs[0] == -1))
    {
       N =-1;
       result.first = last_end;
       result.second = end;
       result.matched = (last_end != end);
       return true;
    }
    return false;
 }
コード例 #2
0
 bool next()
 {
    //if(what.prefix().first != what[0].second)
    //   flags |= match_prev_avail;
    BidirectionalIterator next_start = what[0].second;
    match_flag_type f(flags);
    if(!what.length())
       f |= regex_constants::match_not_initial_null;
    //if(base != next_start)
    //   f |= regex_constants::match_not_bob;
    bool result = u32regex_search(next_start, end, what, re, f, base);
    if(result)
       what.set_base(base);
    return result;
 }
コード例 #3
0
 bool init(BidirectionalIterator first)
 {
    base = first;
    N = 0;
    if(u32regex_search(first, end, what, re, flags, base) == true)
    {
       N = 0;
       result = ((subs[N] == -1) ? what.prefix() : what[(int)subs[N]]);
       return true;
    }
    else if((subs[N] == -1) && (first != end))
    {
       result.first = first;
       result.second = end;
       result.matched = (first != end);
       N = -1;
       return true;
    }
    return false;
 }
コード例 #4
0
 bool init(BidirectionalIterator first)
 {
    base = first;
    return u32regex_search(first, end, what, re, flags, base);
 }