mirror of
https://github.com/Dushistov/sdcv.git
synced 2025-12-19 11:10:52 +00:00
support of usage colors in sdcv output
This commit is contained in:
@@ -7,17 +7,14 @@
|
||||
#include "lib.hpp"
|
||||
#include "readline.hpp"
|
||||
|
||||
using std::string;
|
||||
using std::vector;
|
||||
|
||||
//this structure is wrapper and it need for unification
|
||||
//results of search whith return Dicts class
|
||||
struct TSearchResult {
|
||||
string bookname;
|
||||
string def;
|
||||
string exp;
|
||||
std::string bookname;
|
||||
std::string def;
|
||||
std::string exp;
|
||||
|
||||
TSearchResult(const string& bookname_, const string& def_, const string& exp_)
|
||||
TSearchResult(const std::string& bookname_, const std::string& def_, const std::string& exp_)
|
||||
: bookname(bookname_), def(def_), exp(exp_)
|
||||
{
|
||||
}
|
||||
@@ -29,17 +26,19 @@ typedef std::vector<TSearchResult> TSearchResultList;
|
||||
//of it
|
||||
class Library : public Libs {
|
||||
public:
|
||||
Library(bool uinput, bool uoutput) :
|
||||
utf8_input(uinput), utf8_output(uoutput) {}
|
||||
Library(bool uinput, bool uoutput, bool colorize_output):
|
||||
utf8_input_(uinput), utf8_output_(uoutput), colorize_output_(colorize_output) {}
|
||||
|
||||
bool process_phrase(const char *loc_str, IReadLine &io, bool force=false);
|
||||
bool process_phrase(const char *loc_str, IReadLine &io, bool force = false);
|
||||
private:
|
||||
bool utf8_input, utf8_output;
|
||||
bool utf8_input_;
|
||||
bool utf8_output_;
|
||||
bool colorize_output_;
|
||||
|
||||
void SimpleLookup(const string &str, TSearchResultList& res_list);
|
||||
void LookupWithFuzzy(const string &str, TSearchResultList& res_list);
|
||||
void LookupWithRule(const string &str, TSearchResultList& res_lsit);
|
||||
void LookupData(const string &str, TSearchResultList& res_list);
|
||||
void SimpleLookup(const std::string &str, TSearchResultList& res_list);
|
||||
void LookupWithFuzzy(const std::string &str, TSearchResultList& res_list);
|
||||
void LookupWithRule(const std::string &str, TSearchResultList& res_lsit);
|
||||
void LookupData(const std::string &str, TSearchResultList& res_list);
|
||||
void print_search_result(FILE *out, const TSearchResult & res);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user