a/src/internfile/uncomp.h b/src/internfile/uncomp.h
...
...
25
#include "rclutil.h"
25
#include "rclutil.h"
26
26
27
/// Uncompression script interface.
27
/// Uncompression script interface.
28
class Uncomp {
28
class Uncomp {
29
public:
29
public:
30
    Uncomp(bool docache = false)
30
    explicit Uncomp(bool docache = false);
31
  : m_dir(0), m_docache(docache)
32
    {
33
    }
34
    ~Uncomp();
31
    ~Uncomp();
35
32
36
    /** Uncompress the input file into a temporary one, by executing the
33
    /** Uncompress the input file into a temporary one, by executing the
37
     * script given as input. 
34
     * script given as input. 
38
     * Return the path to the uncompressed file (which is inside a 
35
     * Return the path to the uncompressed file (which is inside a 
39
     * temporary directory).
36
     * temporary directory).
40
     */
37
     */
41
    bool uncompressfile(const std::string& ifn, 
38
    bool uncompressfile(const std::string& ifn, 
42
            const std::vector<std::string>& cmdv,
39
            const std::vector<std::string>& cmdv,
43
            std::string& tfile);
40
            std::string& tfile);
44
41
    static void clearcache();
42
    
45
private:
43
private:
46
    TempDir *m_dir;
44
    TempDir *m_dir{0};
47
    std::string   m_tfile;
45
    std::string   m_tfile;
48
    std::string   m_srcpath;
46
    std::string   m_srcpath;
49
    bool m_docache;
47
    bool m_docache;
50
48
51
    class UncompCache {
49
    class UncompCache {
52
    public:
50
    public:
53
    UncompCache()
51
    UncompCache() {}
54
      : m_dir(0)
55
  {
56
  }
57
    ~UncompCache()
52
    ~UncompCache() {
58
  {
59
        delete m_dir;
53
        delete m_dir;
60
    }
54
    }
61
        std::mutex m_lock;
55
        std::mutex m_lock;
62
    TempDir *m_dir;
56
    TempDir *m_dir{0};
63
    std::string   m_tfile;
57
    std::string   m_tfile;
64
    std::string   m_srcpath;
58
    std::string   m_srcpath;
65
    };
59
    };
66
    static UncompCache o_cache;
60
    static UncompCache o_cache;
67
};
61
};