source: trunk/gsdl/src/recpt/historydb.h@ 928

Last change on this file since 928 was 928, checked in by kjm18, 24 years ago

search history stuff added.

  • Property svn:keywords set to Author Date Id Revision
File size: 2.1 KB
Line 
1
2
3#ifndef HISTORY_H
4#define HISTORY_H
5
6#include "infodbclass.h"
7#include "text_t.h"
8#include "recptproto.h"
9//#include <vector.h>
10#include <map.h>
11
12struct HistRecord {
13 text_t entry;
14 bool save;
15};
16
17struct ltinttext_t
18{
19 bool operator()(const text_t &t1, const text_t &t2) const
20 { return t1.getint() < t2.getint(); }
21};
22
23
24typedef map<text_t, HistRecord, ltinttext_t> HistRecordmap;
25
26// returns true on success (in which case historyinfo will contain
27// the information for this history)
28bool get_history_info ( const text_t &userid, text_tarray &historyinfo);
29
30// returns true on success
31bool set_history_info (const text_t &userid, const text_t &historyinfo);
32
33bool delete_all_history_info (const text_t &userid);
34
35// deletes only the entries specified
36bool delete_history_info(const text_t &userid, const text_t &deletemode,
37 const text_t &selection);
38
39// takes a text_t with x-y, and retrieves the x and y params
40bool get_selection_params (text_t &data, int &start, int &stop);
41
42bool expand_query(HistRecord &query, HistRecordmap &records);
43
44// combine query looks for #x and replaces it with the query
45// string from the xth entry. THe first one looks up the xth
46// query in the database (used before running a query), the
47// second version looks it up inthe records map (used in
48// delete history -are doing a lotof #x replacing at once.
49bool combine_query(text_t &userid, text_t &query);
50bool combine_query(text_t &userid, HistRecordmap &records);
51
52// retrieves the value of an arg (key) from a list of cgi args
53// in the form a=q&b=1&...
54void parse_saved_args(text_t &args, text_t &key, text_t &value);
55
56// extracts out the components of an entry in the database
57// currently:
58// querynum:numdocs cgiargs
59void split_saved_query(text_t &query, text_t &querynum, text_t &numdocs, text_t &cgiargs);
60
61// just extracts the query number out of the entry
62void get_query_num(text_t &query, text_t &querynum);
63
64// takes the cgiarg string, and outputs it in some form useful
65// to the user
66void format_user_info (text_t &cgiargs, text_t &info,
67 recptprotolistclass *protos, ostream &logout);
68
69#endif
70
71
Note: See TracBrowser for help on using the repository browser.