source: trunk/gsdl/src/recpt/cgiutils.h@ 608

Last change on this file since 608 was 607, checked in by sjboddie, 25 years ago

added ability to escape out '-' in saved args (currently
with a 'Z' ???)

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 3.5 KB
Line 
1/**********************************************************************
2 *
3 * cgiutils.h -- general cgi utilities
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 * $Id: cgiutils.h 607 1999-09-21 11:30:39Z sjboddie $
25 *
26 *********************************************************************/
27
28
29#ifndef CGIUTILS_H
30#define CGIUTILS_H
31
32#include "gsdlconf.h"
33#include "text_t.h"
34#include "cgiargs.h"
35
36
37// convert %xx and + to their appropriate equivalents
38void decode_cgi_arg (text_t &argstr);
39
40// split up the cgi arguments
41void split_cgi_args (text_t argstr, cgiargsclass &args);
42
43// turns any '-' in a cgi argument into "(-)"
44text_t minus_safe (const text_t &intext);
45
46// returns the encoded version of a cgi argument
47text_t cgi_safe (const text_t &intext);
48
49// check_save_conf_str checks the configuration string for
50// the saved args and makes sure it does not conflict with
51// the information about the arguments. If an error is encountered
52// it will return false and the program should not produce any
53// output.
54bool check_save_conf_str (const text_t &saveconf,
55 const cgiargsinfoclass &argsinfo,
56 ostream &logout);
57
58// create_save_conf_str will create a configuration string
59// based on the information in argsinfo. This method of configuration
60// is not recomended as small changes can produce large changes in
61// the resulting configuration string (for instance a totally different
62// ordering). Only arguments which "must" be saved are included in
63// the resulting string.
64text_t create_save_conf_str (const cgiargsinfoclass &argsinfo,
65 ostream &logout);
66
67// expand_compress_args will expand the compressed arguments based
68// on compressconf placing the results in args if they are not
69// already defined. If it encounters an error it will return false
70// and output more information to logout.
71bool expand_save_args (const cgiargsinfoclass &argsinfo,
72 const text_t &saveconf,
73 cgiargsclass &args,
74 ostream &logout);
75
76// adds the default values for those arguments which have not
77// been specified
78void add_default_args (const cgiargsinfoclass &argsinfo,
79 cgiargsclass &args,
80 ostream &logout);
81
82// compress_save_args will compress the arguments and return
83// them in compressed_args. If an error was encountered
84// compressed_args will be set to to "", an error will be
85// written to logout, and the function will return false.
86bool compress_save_args (const cgiargsinfoclass &argsinfo,
87 const text_t &saveconf,
88 cgiargsclass &args,
89 text_t &compressed_args,
90 outconvertclass &outconvert,
91 ostream &logout);
92
93// args_tounicode converts any arguments which are not in unicode
94// to unicode using inconvert
95void args_tounicode (cgiargsclass &args, inconvertclass &inconvert);
96
97#endif
Note: See TracBrowser for help on using the repository browser.