Annotation of parser3/src/types/pa_vform.h, revision 1.47

1.10      paf         1: /** @file
1.16      paf         2:        Parser: @b form class decls.
1.10      paf         3: 
1.46      paf         4:        Copyright (c) 2001-2003 ArtLebedev Group (http://www.artlebedev.com)
1.33      paf         5:        Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.1       paf         6: */
                      7: 
                      8: #ifndef PA_VFORM_H
                      9: #define PA_VFORM_H
1.36      paf        10: 
1.47    ! paf        11: static const char * const IDENT_VFORM_H="$Date: 2003/07/24 11:31:26 $";
1.46      paf        12: 
                     13: // includes
1.1       paf        14: 
1.19      paf        15: #include "classes.h"
1.8       paf        16: #include "pa_common.h"
1.46      paf        17: #include "pa_value.h"
                     18: 
                     19: // defines
1.17      paf        20: 
1.22      parser     21: #define FORM_FIELDS_ELEMENT_NAME "fields"
1.24      parser     22: #define FORM_TABLES_ELEMENT_NAME "tables"
1.42      paf        23: #define FORM_IMAP_ELEMENT_NAME "imap"
1.22      parser     24: 
1.46      paf        25: // forwards
                     26: 
                     27: class Request_info;
                     28: class Request_charsets;
1.4       paf        29: 
1.10      paf        30: /**
1.13      paf        31:        derivates from VStateless_class so that :CLASS element referred to @a this.
1.10      paf        32: 
                     33:        and users could do such tricks:
                     34:        @verbatim
                     35:                ^rem{pass somebody something with elements}
                     36: 
                     37:                ^rem{this time that would be elements of a form}
1.12      paf        38:                ^somebody[$form:CLASS]
1.10      paf        39: 
                     40:                ^rem{this time that would be elements of a table record}
                     41:                $news[^table:sql[select * from news]]
                     42:                ^somebody[^news.record[]]
                     43:        @endverbatim
                     44: */
1.46      paf        45: class VForm: public VStateless_class {
1.1       paf        46: public: // Value
                     47:        
1.46      paf        48:        const char* type() const { return "form"; }
1.24      parser     49:        
1.35      paf        50:        // form: CLASS,method,field,tables field
1.46      paf        51:        Value* get_element(const String& aname, Value& aself, bool /*looking_up*/);
1.1       paf        52: 
                     53: public: // usage
                     54: 
1.46      paf        55:        VForm();
1.31      paf        56:        
1.46      paf        57:        void fill_fields_and_tables(Request_charsets& acharsets, Request_info& request_info);
1.7       paf        58: 
1.6       paf        59: private:
                     60: 
1.46      paf        61:        Request_charsets* fcharsets;
                     62: 
                     63:        char *strpart(const char* str, size_t len);
                     64:        char *getAttributeValue(const char* data,char *attr,size_t len);
                     65:        void UnescapeChars(char **sp, const char* cp, size_t len);
                     66:        void ParseGetFormInput(const char* query_string, size_t length);
                     67:        void ParseFormInput(const char* data, size_t length);
                     68:        void ParseMimeInput(char *content_type, const char* data, size_t length);
1.6       paf        69:        void AppendFormEntry(
1.46      paf        70:                const char* cname_cstr, 
                     71:                const char* raw_cvalue_ptr, const size_t raw_cvalue_size,
                     72:                const char* copy_me_file_name_cstr=0);
1.1       paf        73: 
                     74: private:
                     75: 
1.34      paf        76:        bool filled;
1.46      paf        77:        HashStringValue fields;
                     78:        HashStringValue tables;
                     79:        HashStringValue imap;
1.30      paf        80: 
                     81: private:
                     82: 
1.46      paf        83:        String::C transcode(const char* client, size_t client_size);
1.1       paf        84: 
                     85: };
                     86: 
                     87: #endif

E-mail: