|
a/src/utils/pathut.h |
|
b/src/utils/pathut.h |
|
... |
|
... |
14 |
* Free Software Foundation, Inc.,
|
14 |
* Free Software Foundation, Inc.,
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
15 |
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
16 |
*/
|
16 |
*/
|
17 |
#ifndef _PATHUT_H_INCLUDED_
|
17 |
#ifndef _PATHUT_H_INCLUDED_
|
18 |
#define _PATHUT_H_INCLUDED_
|
18 |
#define _PATHUT_H_INCLUDED_
|
19 |
/* @(#$Id: pathut.h,v 1.10 2006-12-14 13:53:43 dockes Exp $ (C) 2004 J.F.Dockes */
|
19 |
/* @(#$Id: pathut.h,v 1.11 2006-12-16 15:31:51 dockes Exp $ (C) 2004 J.F.Dockes */
|
20 |
|
20 |
|
21 |
#include <string>
|
21 |
#include <string>
|
22 |
#include <list>
|
22 |
#include <list>
|
|
|
23 |
#include "refcntr.h"
|
23 |
|
24 |
|
24 |
#ifndef NO_NAMESPACES
|
25 |
#ifndef NO_NAMESPACES
|
25 |
using std::string;
|
26 |
using std::string;
|
26 |
using std::list;
|
27 |
using std::list;
|
27 |
#endif
|
28 |
#endif
|
|
... |
|
... |
52 |
extern bool path_isdir(const string& path);
|
53 |
extern bool path_isdir(const string& path);
|
53 |
|
54 |
|
54 |
/// Create temporary directory
|
55 |
/// Create temporary directory
|
55 |
extern bool maketmpdir(string& tdir, string& reason);
|
56 |
extern bool maketmpdir(string& tdir, string& reason);
|
56 |
|
57 |
|
|
|
58 |
/// Temporary file class
|
|
|
59 |
class TempFileInternal {
|
|
|
60 |
public:
|
|
|
61 |
TempFileInternal(const string& suffix);
|
|
|
62 |
~TempFileInternal();
|
|
|
63 |
const char *filename() {return m_filename.c_str();}
|
|
|
64 |
const string &getreason() {return m_reason;}
|
|
|
65 |
bool ok() {return !m_filename.empty();}
|
|
|
66 |
private:
|
|
|
67 |
string m_filename;
|
|
|
68 |
string m_reason;
|
|
|
69 |
};
|
|
|
70 |
|
|
|
71 |
typedef RefCntr<TempFileInternal> TempFile;
|
|
|
72 |
|
57 |
#endif /* _PATHUT_H_INCLUDED_ */
|
73 |
#endif /* _PATHUT_H_INCLUDED_ */
|