File: insertinto.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 (37 lines) | stat: -rw-r--r-- 742 bytes parent folder | download | duplicates (3)
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
36
37
#include "store.ih"

std::ostream &Store::insertInto(std::ostream &out) const
{
    Arg &arg = Arg::instance();

    bool doSelect;

    string entity;
    if 
    (
        (doSelect = arg.option(&entity, "select"))
        || 
        arg.option(&entity, "select-pattern")
    )
        insert(out, entity, doSelect);
    else
    {
        sort(
            d_defIdx.begin(), d_defIdx.end(), 
            [&](size_t left, size_t right)
            {
                return 
                    strcasecmp(d_xrefVector[left].name(), 
                               d_xrefVector[right].name()) < 0;
            }
        );

        for (auto idx: d_defIdx)    
            insertDefined(idx, out, d_xrefVector);
    }

    return out;
}