[939] | 1 | /**********************************************************************
|
---|
| 2 | *
|
---|
| 3 | * historydb.h --
|
---|
| 4 | * Copyright (C) 1999 The New Zealand Digital Library Project
|
---|
| 5 | *
|
---|
| 6 | * A component of the Greenstone digital library software
|
---|
| 7 | * from the New Zealand Digital Library Project at the
|
---|
| 8 | * University of Waikato, New Zealand.
|
---|
| 9 | *
|
---|
| 10 | * This program is free software; you can redistribute it and/or modify
|
---|
| 11 | * it under the terms of the GNU General Public License as published by
|
---|
| 12 | * the Free Software Foundation; either version 2 of the License, or
|
---|
| 13 | * (at your option) any later version.
|
---|
| 14 | *
|
---|
| 15 | * This program is distributed in the hope that it will be useful,
|
---|
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
| 18 | * GNU General Public License for more details.
|
---|
| 19 | *
|
---|
| 20 | * You should have received a copy of the GNU General Public License
|
---|
| 21 | * along with this program; if not, write to the Free Software
|
---|
| 22 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
---|
| 23 | *
|
---|
| 24 | *********************************************************************/
|
---|
[928] | 25 |
|
---|
| 26 |
|
---|
[939] | 27 | #ifndef HISTORYDB_H
|
---|
| 28 | #define HISTORYDB_H
|
---|
[928] | 29 |
|
---|
| 30 | #include "text_t.h"
|
---|
| 31 | #include "recptproto.h"
|
---|
[1913] | 32 | #include "cgiargs.h"
|
---|
[928] | 33 |
|
---|
[1913] | 34 | /*
|
---|
[928] | 35 | struct HistRecord {
|
---|
| 36 | text_t entry;
|
---|
| 37 | bool save;
|
---|
| 38 | };
|
---|
| 39 |
|
---|
| 40 | struct ltinttext_t
|
---|
| 41 | {
|
---|
| 42 | bool operator()(const text_t &t1, const text_t &t2) const
|
---|
| 43 | { return t1.getint() < t2.getint(); }
|
---|
| 44 | };
|
---|
| 45 |
|
---|
| 46 |
|
---|
| 47 | typedef map<text_t, HistRecord, ltinttext_t> HistRecordmap;
|
---|
| 48 |
|
---|
[1913] | 49 | */
|
---|
[928] | 50 | // returns true on success (in which case historyinfo will contain
|
---|
| 51 | // the information for this history)
|
---|
[963] | 52 | bool get_history_info (const text_t &userid, text_tarray &historyinfo,
|
---|
| 53 | const text_t &gsdlhome, ostream &logout);
|
---|
[928] | 54 |
|
---|
| 55 | // returns true on success
|
---|
[963] | 56 | bool set_history_info (const text_t &userid, const text_t &historyinfo,
|
---|
[1913] | 57 | const text_t &gsdlhome, bool display);
|
---|
[928] | 58 |
|
---|
[1913] | 59 | // delete all history for one user
|
---|
[963] | 60 | bool delete_all_history_info (const text_t &userid, const text_t &gsdlhome);
|
---|
[928] | 61 |
|
---|
| 62 | // retrieves the value of an arg (key) from a list of cgi args
|
---|
| 63 | // in the form a=q&b=1&...
|
---|
[939] | 64 | void parse_saved_args(text_t &args, text_t key, text_t &value);
|
---|
[928] | 65 |
|
---|
| 66 | // extracts out the components of an entry in the database
|
---|
| 67 | // currently:
|
---|
[1913] | 68 | // numdocs cgiargs
|
---|
| 69 | void split_saved_query(text_t &query, text_t &numdocs, text_t &cgiargs);
|
---|
[928] | 70 |
|
---|
| 71 | // takes the cgiarg string, and outputs it in some form useful
|
---|
| 72 | // to the user
|
---|
| 73 | void format_user_info (text_t &cgiargs, text_t &info,
|
---|
[1913] | 74 | cgiargsclass &args,
|
---|
[928] | 75 | recptprotolistclass *protos, ostream &logout);
|
---|
| 76 |
|
---|
| 77 | #endif
|
---|