File: keepfirst.cc

package info (click to toggle)
oxref 0.90.10-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 400 kB
  • sloc: cpp: 786; makefile: 141
file content (30 lines) | stat: -rw-r--r-- 1,169 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "xrefdata.ih"

void XrefData::keepFirst(size_t openParIdx)
{
//cout << d_cooked << "\n";

    size_t begin = openParIdx;
  
    while (d_cooked[begin] != ')')
    {
        ++begin;                                    // beyond the separator

        if (d_cooked[begin] == ' ')                 // keep blank after sep.
            ++begin;

        size_t next = d_cooked.find_first_not_of(" \t", begin); // erase extra
        d_cooked.erase(begin, next - begin);                    // blanks

                                                    // find end of 1st word:
                                                    //  < begins template
                                                    //  , ends argument
                                                    //  ) ends parlist
                                                    //  blank ends 1st word
        begin = d_cooked.find_first_of("*&<,) \t", begin);
        
        begin = eraseParam(begin);                  // erase the param. from
                                                    // 'begin', return , or )
                                                    // position
    }
}