Probably null change: make sure that all classes with destructors also have copy constructors and assignment operators
This commit is contained in:
@@ -46,7 +46,6 @@ class HtmlParser {
|
||||
virtual void parse_html(const string &text);
|
||||
virtual void do_eof() {}
|
||||
HtmlParser();
|
||||
virtual ~HtmlParser() { }
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+15
-16
@@ -50,10 +50,11 @@ public:
|
||||
FIMissingStore() {}
|
||||
FIMissingStore(const string& in);
|
||||
virtual ~FIMissingStore() {}
|
||||
virtual void addMissing(const string& prog, const string& mt)
|
||||
{
|
||||
m_typesForMissing[prog].insert(mt);
|
||||
}
|
||||
FIMissingStore(const FIMissingStore&) = delete;
|
||||
FIMissingStore& operator=(const FIMissingStore&) = delete;
|
||||
virtual void addMissing(const string& prog, const string& mt) {
|
||||
m_typesForMissing[prog].insert(mt);
|
||||
}
|
||||
// Get simple progs list string
|
||||
virtual void getMissingExternal(string& out);
|
||||
// Get progs + assoc mtypes description string
|
||||
@@ -137,6 +138,8 @@ public:
|
||||
FileInterner(const Rcl::Doc& idoc, RclConfig *cnf, int flags);
|
||||
|
||||
~FileInterner();
|
||||
FileInterner(const FileInterner&) = delete;
|
||||
FileInterner& operator=(const FileInterner&) = delete;
|
||||
|
||||
void setMissingStore(FIMissingStore *st) {
|
||||
m_missingdatap = st;
|
||||
@@ -183,14 +186,12 @@ public:
|
||||
we keep it around to save work for our caller, which can get it here */
|
||||
TempFile get_imgtmp() {return m_imgtmp;}
|
||||
|
||||
const string& getReason() const
|
||||
{
|
||||
return m_reason;
|
||||
}
|
||||
bool ok() const
|
||||
{
|
||||
return m_ok;
|
||||
}
|
||||
const string& getReason() const {
|
||||
return m_reason;
|
||||
}
|
||||
bool ok() const {
|
||||
return m_ok;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get UDI for immediate parent for document.
|
||||
@@ -206,8 +207,7 @@ public:
|
||||
static std::string getLastIpathElt(const std::string& ipath);
|
||||
|
||||
/** Check that 2nd param is child of first */
|
||||
static bool ipathContains(const std::string& parent,
|
||||
const std::string& child);
|
||||
static bool ipathContains(const std::string& parent, const std::string& child);
|
||||
/**
|
||||
* Build sig for doc coming from rcldb. This is here because we know how
|
||||
* to query the right backend. Used to check up-to-dateness at query time */
|
||||
@@ -250,8 +250,7 @@ public:
|
||||
/** Try to get a top level reason after an operation failed. This
|
||||
* is just for "simple" issues, like file missing, permissions,
|
||||
* etc. */
|
||||
enum ErrorPossibleCause{FetchMissing, FetchPerm, FetchNoBackend,
|
||||
InternfileOther};
|
||||
enum ErrorPossibleCause{FetchMissing, FetchPerm, FetchNoBackend, InternfileOther};
|
||||
static ErrorPossibleCause tryGetReason(RclConfig *, const Rcl::Doc&);
|
||||
|
||||
private:
|
||||
|
||||
@@ -107,6 +107,8 @@ class MimeHandlerExecMultiple : public MimeHandlerExec {
|
||||
}
|
||||
// No resources to clean up, the ExecCmd destructor does it.
|
||||
virtual ~MimeHandlerExecMultiple() {}
|
||||
MimeHandlerExecMultiple(const MimeHandlerExecMultiple&) = delete;
|
||||
MimeHandlerExecMultiple& operator=(const MimeHandlerExecMultiple&) = delete;
|
||||
|
||||
virtual bool next_document() override;
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ public:
|
||||
: RecollFilter(cnf, id) {
|
||||
}
|
||||
virtual ~MimeHandlerHtml() {}
|
||||
MimeHandlerHtml(const MimeHandlerHtml&) = delete;
|
||||
MimeHandlerHtml& operator=(const MimeHandlerHtml&) = delete;
|
||||
|
||||
virtual bool is_data_input_ok(DataInput input) const override {
|
||||
if (input == DOCUMENT_FILE_NAME || input == DOCUMENT_STRING)
|
||||
|
||||
@@ -37,6 +37,8 @@ class MimeHandlerMail : public RecollFilter {
|
||||
public:
|
||||
MimeHandlerMail(RclConfig *cnf, const std::string &id);
|
||||
virtual ~MimeHandlerMail();
|
||||
MimeHandlerMail(const MimeHandlerMail&) = delete;
|
||||
MimeHandlerMail& operator=(const MimeHandlerMail&) = delete;
|
||||
virtual bool is_data_input_ok(DataInput input) const override {
|
||||
return (input == DOCUMENT_FILE_NAME || input == DOCUMENT_STRING);
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ class MimeHandlerMbox : public RecollFilter {
|
||||
public:
|
||||
MimeHandlerMbox(RclConfig *cnf, const std::string& id);
|
||||
virtual ~MimeHandlerMbox();
|
||||
MimeHandlerMbox(const MimeHandlerMbox&) = delete;
|
||||
MimeHandlerMbox& operator=(const MimeHandlerMbox&) = delete;
|
||||
virtual bool next_document() override;
|
||||
virtual bool skip_to_document(const std::string& ipath) override;
|
||||
virtual void clear_impl() override;
|
||||
|
||||
@@ -38,6 +38,8 @@ class MimeHandlerNull : public RecollFilter {
|
||||
: RecollFilter(cnf, id) {
|
||||
}
|
||||
virtual ~MimeHandlerNull() {}
|
||||
MimeHandlerNull(const MimeHandlerNull&) = delete;
|
||||
MimeHandlerNull& operator=(const MimeHandlerNull&) = delete;
|
||||
|
||||
virtual bool is_data_input_ok(DataInput) const {
|
||||
return true;
|
||||
|
||||
+22
-21
@@ -34,35 +34,36 @@
|
||||
* to enable.
|
||||
*/
|
||||
class MimeHandlerSymlink : public RecollFilter {
|
||||
public:
|
||||
public:
|
||||
MimeHandlerSymlink(RclConfig *cnf, const std::string& id)
|
||||
: RecollFilter(cnf, id) {
|
||||
: RecollFilter(cnf, id) {
|
||||
}
|
||||
virtual ~MimeHandlerSymlink() {}
|
||||
MimeHandlerSymlink(const MimeHandlerSymlink&) = delete;
|
||||
MimeHandlerSymlink& operator=(const MimeHandlerSymlink&) = delete;
|
||||
|
||||
virtual bool next_document()
|
||||
{
|
||||
if (m_havedoc == false)
|
||||
return false;
|
||||
m_havedoc = false;
|
||||
m_metaData[cstr_dj_keycontent] = cstr_null;
|
||||
char lc[1024];
|
||||
ssize_t bytes = readlink(m_fn.c_str(), lc, 1024);
|
||||
if (bytes != (ssize_t)-1) {
|
||||
string slc(lc, bytes);
|
||||
transcode(path_getsimple(slc), m_metaData[cstr_dj_keycontent],
|
||||
m_config->getDefCharset(true), "UTF-8");
|
||||
} else {
|
||||
LOGDEB("Symlink: readlink [" << m_fn << "] failed, errno " <<
|
||||
virtual bool next_document() {
|
||||
if (m_havedoc == false)
|
||||
return false;
|
||||
m_havedoc = false;
|
||||
m_metaData[cstr_dj_keycontent] = cstr_null;
|
||||
char lc[1024];
|
||||
ssize_t bytes = readlink(m_fn.c_str(), lc, 1024);
|
||||
if (bytes != (ssize_t)-1) {
|
||||
string slc(lc, bytes);
|
||||
transcode(path_getsimple(slc), m_metaData[cstr_dj_keycontent],
|
||||
m_config->getDefCharset(true), "UTF-8");
|
||||
} else {
|
||||
LOGDEB("Symlink: readlink [" << m_fn << "] failed, errno " <<
|
||||
errno << "\n");
|
||||
}
|
||||
m_metaData[cstr_dj_keymt] = cstr_textplain;
|
||||
return true;
|
||||
}
|
||||
m_metaData[cstr_dj_keymt] = cstr_textplain;
|
||||
return true;
|
||||
}
|
||||
protected:
|
||||
virtual bool set_document_file_impl(const string&, const string& fn) {
|
||||
m_fn = fn;
|
||||
return m_havedoc = true;
|
||||
m_fn = fn;
|
||||
return m_havedoc = true;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
@@ -35,6 +35,8 @@ public:
|
||||
: RecollFilter(cnf, id), m_paging(false), m_offs(0), m_pagesz(0) {
|
||||
}
|
||||
virtual ~MimeHandlerText() {}
|
||||
MimeHandlerText(const MimeHandlerText&) = delete;
|
||||
MimeHandlerText& operator=(const MimeHandlerText&) = delete;
|
||||
|
||||
virtual bool is_data_input_ok(DataInput input) const override {
|
||||
if (input == DOCUMENT_FILE_NAME || input == DOCUMENT_STRING)
|
||||
|
||||
@@ -27,22 +27,24 @@
|
||||
*
|
||||
*/
|
||||
class MimeHandlerUnknown : public RecollFilter {
|
||||
public:
|
||||
public:
|
||||
MimeHandlerUnknown(RclConfig *cnf, const string& id)
|
||||
: RecollFilter(cnf, id) {
|
||||
: RecollFilter(cnf, id) {
|
||||
}
|
||||
virtual ~MimeHandlerUnknown() {}
|
||||
MimeHandlerUnknown(const MimeHandlerUnknown&) = delete;
|
||||
MimeHandlerUnknown& operator=(const MimeHandlerUnknown&) = delete;
|
||||
virtual bool is_data_input_ok(DataInput) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
virtual bool next_document() {
|
||||
if (m_havedoc == false)
|
||||
return false;
|
||||
m_havedoc = false;
|
||||
m_metaData[cstr_dj_keycontent] = cstr_null;
|
||||
m_metaData[cstr_dj_keymt] = cstr_textplain;
|
||||
return true;
|
||||
if (m_havedoc == false)
|
||||
return false;
|
||||
m_havedoc = false;
|
||||
m_metaData[cstr_dj_keycontent] = cstr_null;
|
||||
m_metaData[cstr_dj_keymt] = cstr_textplain;
|
||||
return true;
|
||||
}
|
||||
virtual bool is_unknown() {return true;}
|
||||
};
|
||||
|
||||
@@ -26,6 +26,8 @@ class MimeHandlerXslt : public RecollFilter {
|
||||
MimeHandlerXslt(RclConfig *cnf, const std::string& id,
|
||||
const std::vector<std::string>& params);
|
||||
virtual ~MimeHandlerXslt();
|
||||
MimeHandlerXslt(const MimeHandlerXslt&) = delete;
|
||||
MimeHandlerXslt& operator=(const MimeHandlerXslt&) = delete;
|
||||
|
||||
virtual bool next_document() override;
|
||||
virtual void clear_impl() override;
|
||||
|
||||
@@ -34,6 +34,8 @@ public:
|
||||
: m_config(config), m_id(id) {
|
||||
}
|
||||
virtual ~RecollFilter() {}
|
||||
RecollFilter(const RecollFilter&) = delete;
|
||||
RecollFilter& operator=(const RecollFilter&) = delete;
|
||||
|
||||
virtual void setConfig(RclConfig *config) override {
|
||||
m_config = config;
|
||||
|
||||
@@ -33,7 +33,7 @@ using std::map;
|
||||
#define WHITESPACE " \t\n\r"
|
||||
|
||||
class MyHtmlParser : public HtmlParser {
|
||||
public:
|
||||
public:
|
||||
bool in_script_tag;
|
||||
bool in_style_tag;
|
||||
bool in_pre_tag;
|
||||
@@ -60,10 +60,9 @@ class MyHtmlParser : public HtmlParser {
|
||||
void do_eof();
|
||||
void decode_entities(string &s);
|
||||
void reset_charsets() {fromcharset = tocharset = "";}
|
||||
void set_charsets(const string& f, const string& t)
|
||||
{
|
||||
fromcharset = f;
|
||||
tocharset = t;
|
||||
void set_charsets(const string& f, const string& t) {
|
||||
fromcharset = f;
|
||||
tocharset = t;
|
||||
}
|
||||
// Return charset as determined from html
|
||||
const string& get_charset() {return charset;}
|
||||
|
||||
@@ -29,6 +29,8 @@ class Uncomp {
|
||||
public:
|
||||
explicit Uncomp(bool docache = false);
|
||||
~Uncomp();
|
||||
Uncomp(const Uncomp&) = delete;
|
||||
Uncomp& operator=(const Uncomp&) = delete;
|
||||
|
||||
/** Uncompress the input file into a temporary one, by executing the
|
||||
* script given as input.
|
||||
@@ -52,6 +54,8 @@ private:
|
||||
~UncompCache() {
|
||||
delete m_dir;
|
||||
}
|
||||
UncompCache(const UncompCache&) = delete;
|
||||
UncompCache& operator=(const UncompCache&) = delete;
|
||||
std::mutex m_lock;
|
||||
TempDir *m_dir{0};
|
||||
std::string m_tfile;
|
||||
|
||||
Reference in New Issue
Block a user