Switch to unified view

a/src/query/history.h b/src/query/history.h
1
#ifndef _HISTORY_H_INCLUDED_
1
#ifndef _HISTORY_H_INCLUDED_
2
#define _HISTORY_H_INCLUDED_
2
#define _HISTORY_H_INCLUDED_
3
/* @(#$Id: history.h,v 1.1 2005-11-24 18:21:55 dockes Exp $  (C) 2004 J.F.Dockes */
3
/* @(#$Id: history.h,v 1.2 2005-11-28 15:31:01 dockes Exp $  (C) 2004 J.F.Dockes */
4
4
5
#include <string>
5
#include <string>
6
#include <list>
6
#include <list>
7
#include <utility>
7
#include <utility>
8
8
9
#include "conftree.h"
9
#include "conftree.h"
10
10
11
/** Holder for data returned when querying history */
12
class RclDHistoryEntry {
13
 public:
14
    RclDHistoryEntry() : unixtime(0) {}
15
    long unixtime;
16
    string fn;
17
    string ipath;
18
};
19
11
/** 
20
/** 
12
 * The query and documents history class. This is based on a ConfTree for no 
21
 * The documents history class. This is based on a ConfTree for no
13
 * imperative reason
22
 * imperative reason
14
 */
23
 */
15
class RclQHistory {
24
class RclDHistory {
16
 public:
25
 public:
17
    RclQHistory(const std::string &fn, unsigned int maxsize=1000);
26
    RclDHistory(const std::string &fn, unsigned int maxsize=1000);
18
    bool ok() {return m_data.getStatus() == ConfSimple::STATUS_RW;}
27
    bool ok() {return m_data.getStatus() == ConfSimple::STATUS_RW;}
19
28
20
    bool enterDocument(const std::string fn, const std::string ipath);
29
    bool enterDocument(const std::string fn, const std::string ipath);
21
    std::list< std::pair<std::string, std::string> > getDocHistory();
30
    std::list<RclDHistoryEntry> getDocHistory();
22
31
23
 private:
32
 private:
33
    bool decodeValue(const string &value, RclDHistoryEntry *e);
24
    unsigned int m_mlen;
34
    unsigned int m_mlen;
25
    ConfSimple m_data;
35
    ConfSimple m_data;
26
};
36
};
27
37
28
38