24 #include "bibdefs.hpp"
25 #include "bibentry.hpp"
32 enum class ShowImages{None, Left, Right};
35 enum class ShowLinks{None, Text, Icon};
42 typedef std::map<std::string, BibAuthors> AuthorMap;
43 typedef std::map<std::string, BibGroup*> GroupMap;
44 typedef std::map<std::string, BibEntry*> EntryMap;
50 void init(
int argc,
char *argv[]);
52 bool interMode()
const {
return interMode_;}
53 bool verboseMode()
const {
return verboseMode_;}
54 bool breakLines()
const {
return breakLines_;}
55 bool showNumbers()
const {
return showNumbers_;}
56 ShowImages showImages()
const {
return showImages_;}
57 ShowLinks showLinks()
const {
return showLinks_;}
59 const std::string& imageDir()
const {
return imageDir_;}
60 const std::string& htmlBegin()
const {
return htmlBegin_;}
61 const std::string& htmlEnd()
const {
return htmlEnd_;}
62 const BibEntries& medias()
const {
return medias_;}
73 BibEntry*
addEntry(
const std::string& bibkey,
const std::string& typeName,
bool isAuxiliary);
90 void select(
const std::string& query_pattern);
100 void sort(
const std::string& sort_pattern);
113 void readBib(
const std::string& fileName,
bool isAuxiliary);
135 BibAuthor* addAuthor(
const std::string& lastname,
const std::string& firstname);
137 BibAuthor* getAuthor(
const std::string& lastname,
const std::string& firstname)
const;
139 const Bib::AuthorMap& authors()
const {
return authorMap_;}
147 void setFormat(
const std::string& options);
150 void setStyle(
const std::string& styleKey);
155 void checkLinks(
const std::string& fieldName);
161 void doCommand(
const std::string& cmd,
const std::string& args,
bool& interFound,
bool& showFound);
164 static void echo(
const std::string& msg);
167 static void error(
const char* command,
const std::string& msg);
173 friend class BibStats;
175 templateSearched_{
false}, hasMedias_{
false},
176 interMode_{
false}, verboseMode_{
false},
177 breakLines_{
true}, showNumbers_{
false};
178 ShowImages showImages_{ShowImages::Left};
179 ShowLinks showLinks_{ShowLinks::Text};
181 std::string imageDir_;
184 std::string htmlBegin_, htmlEnd_;
185 AuthorMap authorMap_;
187 EntryMap entryMap_, styleMap_;
188 BibEntries *selectEntries_{
nullptr}, allEntries_, medias_;
192 #define BIBCOMMANDS \
193 read, aux, images, templ, out, outhtml, outbib, format, all, select, sort,\
194 clear, show, showhtml, showbib, check, stats, help, i, inter, verbose, quit
196 enum ID {BIBCOMMANDS};
197 ccuty::stringset names;
198 Commands() : names(STRINGIFY(BIBCOMMANDS)) {}