Ignore:
Timestamp:
2006-08-24T11:06:42+12:00 (18 years ago)
Author:
kjdon
Message:

Added Stefan's fileupload code to replace use of cgicc by depositor. Changed the signature of some methods; added fileupload_t; cgiargsclass now has fileupload_t variable; cgiargsinfoclass now has 'bool fileupload' variable; added some more debug print methods; in addarginfo, if logout is null I write the error message to stderr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/cgiargs.h

    r7594 r12512  
    5353enum response_t {location, content, fullcontent, undecided_location};
    5454
     55struct fileupload_t {
     56  void clear();
     57  fileupload_t() {clear();}
     58 
     59  text_t name;
     60  text_t type;
     61  int size;
     62  text_t tmp_name;
     63};
     64
     65typedef map<text_t, fileupload_t, lttext_t> fileupload_tmap;
    5566
    5667struct cgiarg_t {
     
    6374  text_t value;
    6475  source_t source;
    65 };
     76  fileupload_t fileupload;
     77};
     78
     79ostream &operator<<(ostream &outs, const fileupload_t &fu);
    6680
    6781bool operator==(const cgiarg_t &x, const cgiarg_t &y);
     
    126140  void setdefaultcarg (const text_t &key, unsigned short c,
    127141               cgiarg_t::source_t source=cgiarg_t::default_arg);
     142  void setargfile (const text_t &key, const fileupload_t &fileupload);
    128143  text_t *getarg (const text_t &key);
    129144  int getintarg (const text_t &key);
     145  fileupload_t *getargfile (const text_t &key);
    130146  text_t &operator[] (const text_t &key) {return args[key].value;}
    131147  cgiarg_t &lookupcgiarg (const text_t &key) {return args[key];}
     
    157173  // use the same name)
    158174  bool multiplevalue;
     175
     176  // fileupload should be set if the argument is to be used to upload files
     177  bool fileupload;
    159178
    160179  // defaultstatus_t indicates how good the default is when different
     
    224243  // processing with the arguments should be done if this happens
    225244  // as the results will be meaningless.
    226   bool addarginfo (ostream *logout, const cgiarginfo &info);
    227   bool addarginfo (ostream *logout, const cgiargsinfoclass &info);
     245  bool addarginfo (ostream *logout, cgiarginfo &info);
     246  bool addarginfo (ostream *logout, cgiargsinfoclass &info);
    228247
    229248  // addarginfo will override args info with info loaded from config files
    230249  // if the args do not exists will be created
    231250  bool addarginfo (ostream *logout, const text_t& argshortname, const text_tmap& mapinfo);
    232   bool addarginfo (ostream *logout, const confcgiarg_tmap& info);
     251  bool addarginfo (ostream *logout, confcgiarg_tmap& info);
    233252
    234253  cgiarginfo *getarginfo (const text_t &key);
     
    237256};
    238257
     258ostream &operator<<(ostream &outs, const cgiargsinfoclass &argsinfo);
    239259
    240260#endif
Note: See TracChangeset for help on using the changeset viewer.