summaryrefslogtreecommitdiff
path: root/src/abbrev.h
blob: ad880e45e949b8103d3e66c8dca5b5b1247c364a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#ifndef _ABBREV_H
#define _ABBREV_H

#include "utils.h"

namespace ledger {

enum elision_style_t {
  TRUNCATE_TRAILING,
  TRUNCATE_MIDDLE,
  TRUNCATE_LEADING,
  ABBREVIATE
};

string abbreviate(const string&	  str,
		  unsigned int	  width,
		  elision_style_t elision_style = TRUNCATE_TRAILING,
		  const bool	  is_account	= false,
		  int		  abbrev_length = 2);

} // namespace ledger

#endif // _ABBREV_H