summaryrefslogtreecommitdiff
path: root/src/mask.cc
blob: 02cac880e6278eecd1690efa35fea288c60c5ffa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include "mask.h"

namespace ledger {

mask_t::mask_t(const string& pat) : exclude(false)
{
  const char * p = pat.c_str();

  if (*p == '-') {
    exclude = true;
    p++;
    while (std::isspace(*p))
      p++;
  }
  else if (*p == '+') {
    p++;
    while (std::isspace(*p))
      p++;
  }

  expr.assign(p);
}

} // namespace ledger