File: setcooked.cc

package info (click to toggle)
oxref 2.02.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 692 kB
  • sloc: cpp: 1,282; makefile: 131; sh: 48
file content (35 lines) | stat: -rw-r--r-- 743 bytes parent folder | download | duplicates (6)
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
31
32
33
34
35
#include "xrefdata.ih"

void  XrefData::setCooked() 
{
    d_cooked = d_refName;

    size_t begin = d_cooked.find('(', d_nameIndex);
    size_t end = d_cooked.rfind(')');

    if (begin == string::npos || end == string::npos)   // no parentheses ???
        return;                                         // so be it...

    Arg &arg = Arg::instance();

    string option;
    if (not arg.option(&option, 'a'))
        return;                                         // no -a option

    if (option == "count")
        reduceToCount(begin, end);
    else if (option == "first")
        keepFirst(begin);
    else
    {
        size_t len = stoul(option);

        if (len < 5)
            len = 5;

        reduceLen(begin, len);
    }
}