comments
This commit is contained in:
parent
8462d517cf
commit
348b4bc717
@ -1,5 +1,5 @@
|
||||
#ifndef lint
|
||||
static char rcsid[] = "@(#$Id: internfile.cpp,v 1.32 2007-06-19 12:27:52 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
static char rcsid[] = "@(#$Id: internfile.cpp,v 1.33 2007-06-26 16:09:19 dockes Exp $ (C) 2004 J.F.Dockes";
|
||||
#endif
|
||||
/*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -536,20 +536,26 @@ class DirWiper {
|
||||
}
|
||||
};
|
||||
|
||||
// Extract subdoc out of multidoc into temporary file.
|
||||
// We do the usual internfile stuff: create a temporary directory,
|
||||
// then create an interner and call internfile.
|
||||
// We then write the data out of the resulting document into the output file.
|
||||
bool FileInterner::idocTempFile(TempFile& otemp, RclConfig *cnf,
|
||||
const string& fn,
|
||||
const string& ipath,
|
||||
const string& mtype)
|
||||
{
|
||||
string tmpdir, reason;
|
||||
if (!maketmpdir(tmpdir, reason))
|
||||
return false;
|
||||
DirWiper wiper(tmpdir);
|
||||
struct stat st;
|
||||
if (stat(fn.c_str(), &st) < 0) {
|
||||
LOGERR(("FileInterner::idocTempFile: can't stat [%s]\n", fn.c_str()));
|
||||
return false;
|
||||
}
|
||||
|
||||
string tmpdir, reason;
|
||||
if (!maketmpdir(tmpdir, reason))
|
||||
return false;
|
||||
DirWiper wiper(tmpdir);
|
||||
|
||||
FileInterner interner(fn, &st, cnf, tmpdir, &mtype);
|
||||
interner.setTargetMType(mtype);
|
||||
Rcl::Doc doc;
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
*/
|
||||
#ifndef _INTERNFILE_H_INCLUDED_
|
||||
#define _INTERNFILE_H_INCLUDED_
|
||||
/* @(#$Id: internfile.h,v 1.15 2007-06-19 12:27:52 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
/* @(#$Id: internfile.h,v 1.16 2007-06-26 16:09:19 dockes Exp $ (C) 2004 J.F.Dockes */
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -87,7 +87,17 @@ class FileInterner {
|
||||
*/
|
||||
void setTargetMType(const string& tp) {m_targetMType = tp;}
|
||||
|
||||
/** Utility function: extract internal document and make temporary file */
|
||||
/** Utility function: extract internal document into temporary file.
|
||||
* This is used mainly for starting an external viewer for a
|
||||
* subdocument (ie: mail attachment).
|
||||
* @return true for success.
|
||||
* @param temp output reference-counted temp file object (goes
|
||||
* away magically)
|
||||
* @param cnf The recoll config
|
||||
* @param fn The main document from which to extract
|
||||
* @param ipath The internal path to the subdoc
|
||||
* @param mtype The target mime type (we don't want to decode to text!)
|
||||
*/
|
||||
static bool idocTempFile(TempFile& temp, RclConfig *cnf, const string& fn,
|
||||
const string& ipath, const string& mtype);
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user