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

Last change on this file since 411 was 294, checked in by rjmcnab, 25 years ago

Added encoding and decoding of multibyte compresesd arguments.

  • Property svn:executable set to *
  • Property svn:keywords set to Author Date Id Revision
File size: 2.6 KB
Line 
1/**********************************************************************
2 *
3 * cgiutils.h -- general cgi utilities
4 * Copyright (C) 1999 The New Zealand Digital Library Project
5 *
6 * PUT COPYRIGHT NOTICE HERE
7 *
8 * $Id: cgiutils.h 294 1999-06-26 01:08:36Z rjmcnab $
9 *
10 *********************************************************************/
11
12
13#ifndef CGIUTILS_H
14#define CGIUTILS_H
15
16#include "gsdlconf.h"
17#include "text_t.h"
18#include "cgiargs.h"
19
20
21// convert %xx and + to their appropriate equivalents
22void decode_cgi_arg (text_t &argstr);
23
24// split up the cgi arguments
25void split_cgi_args (text_t argstr, cgiargsclass &args);
26
27// returns the encoded version of a cgi argument
28text_t cgi_safe (const text_t &intext);
29
30// check_save_conf_str checks the configuration string for
31// the saved args and makes sure it does not conflict with
32// the information about the arguments. If an error is encountered
33// it will return false and the program should not produce any
34// output.
35bool check_save_conf_str (const text_t &saveconf,
36 const cgiargsinfoclass &argsinfo,
37 ostream &logout);
38
39// create_save_conf_str will create a configuration string
40// based on the information in argsinfo. This method of configuration
41// is not recomended as small changes can produce large changes in
42// the resulting configuration string (for instance a totally different
43// ordering). Only arguments which "must" be saved are included in
44// the resulting string.
45text_t create_save_conf_str (const cgiargsinfoclass &argsinfo,
46 ostream &logout);
47
48// expand_compress_args will expand the compressed arguments based
49// on compressconf placing the results in args if they are not
50// already defined. If it encounters an error it will return false
51// and output more information to logout.
52bool expand_save_args (const cgiargsinfoclass &argsinfo,
53 const text_t &saveconf,
54 cgiargsclass &args,
55 ostream &logout);
56
57// adds the default values for those arguments which have not
58// been specified
59void add_default_args (const cgiargsinfoclass &argsinfo,
60 cgiargsclass &args,
61 ostream &logout);
62
63// compress_save_args will compress the arguments and return
64// them in compressed_args. If an error was encountered
65// compressed_args will be set to to "", an error will be
66// written to logout, and the function will return false.
67bool compress_save_args (const cgiargsinfoclass &argsinfo,
68 const text_t &saveconf,
69 cgiargsclass &args,
70 text_t &compressed_args,
71 outconvertclass &outconvert,
72 ostream &logout);
73
74// args_tounicode converts any arguments which are not in unicode
75// to unicode using inconvert
76void args_tounicode (cgiargsclass &args, inconvertclass &inconvert);
77
78#endif
Note: See TracBrowser for help on using the repository browser.