| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
#ifndef PDFGREP_H |
| 22 |
#define PDFGREP_H |
| 23 |
|
| 24 |
#include "config.h" |
| 25 |
#include "exclude.h" |
| 26 |
#include "intervals.h" |
| 27 |
|
| 28 |
#include <vector> |
| 29 |
#include <string> |
| 30 |
|
| 31 |
|
| 32 |
enum { |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
EXIT_NOT_FOUND = 1, |
| 37 |
|
| 38 |
EXIT_ERROR = 2, |
| 39 |
}; |
| 40 |
|
| 41 |
enum class Recursion { |
| 42 |
NONE, |
| 43 |
FOLLOW_SYMLINKS, |
| 44 |
DONT_FOLLOW_SYMLINKS |
| 45 |
}; |
| 46 |
|
| 47 |
struct Colorconf { |
| 48 |
char *filename; |
| 49 |
char *pagenum; |
| 50 |
char *highlight; |
| 51 |
char *separator; |
| 52 |
}; |
| 53 |
|
| 54 |
enum class PagenumType { INDEX, LABEL }; |
| 55 |
|
| 56 |
|
| 57 |
struct Outconf { |
| 58 |
bool filename = false; |
| 59 |
bool pagenum = false; |
| 60 |
PagenumType pagenum_type = PagenumType::INDEX; |
| 61 |
bool color = false; |
| 62 |
bool only_matching = false; |
| 63 |
bool null_byte_sep = false; |
| 64 |
std::string prefix_sep = ":"; |
| 65 |
|
| 66 |
|
| 67 |
bool context_mode = false; |
| 68 |
int context_before = 0; |
| 69 |
int context_after = 0; |
| 70 |
|
| 71 |
Colorconf colors; |
| 72 |
}; |
| 73 |
|
| 74 |
enum class OnlyFilenames { |
| 75 |
NOPE, |
| 76 |
WITH_MATCHES, |
| 77 |
WITHOUT_MATCH |
| 78 |
}; |
| 79 |
|
| 80 |
struct Options { |
| 81 |
bool ignore_case = false; |
| 82 |
Recursion recursive = Recursion::NONE; |
| 83 |
bool count = false; |
| 84 |
bool pagecount = false; |
| 85 |
bool quiet = false; |
| 86 |
|
| 87 |
std::vector<std::string> passwords; |
| 88 |
int max_count = 0; |
| 89 |
bool debug = 0; |
| 90 |
bool warn_empty = false; |
| 91 |
#ifdef HAVE_UNAC |
| 92 |
bool use_unac = false; |
| 93 |
#endif |
| 94 |
Outconf outconf; |
| 95 |
ExcludeList excludes; |
| 96 |
ExcludeList includes; |
| 97 |
bool use_cache = false; |
| 98 |
std::string cache_directory; |
| 99 |
IntervalContainer page_range; |
| 100 |
OnlyFilenames only_filenames = OnlyFilenames::NOPE; |
| 101 |
}; |
| 102 |
|
| 103 |
#ifdef HAVE_UNAC |
| 104 |
|
| 105 |
std::string simple_unac(const Options &opts, const std::string str); |
| 106 |
#endif |
| 107 |
|
| 108 |
#endif |
| 109 |
|
| 110 |
|
| 111 |
|
| 112 |
|