Skip to content

invicnaper/MWF

Repository files navigation

GitHub version Code Climate Codeship Status for invicnaper/MWF MWF

alt text

MWF is a web framework written in C++

Github page ==> link

Source code

Download the source code and than build them using :

$make compil

Code Example

Param :

    #include "mwf.h"
    int main(){
        Mwu::Frame frame("Param testing", "description");
        Mw::Html html;
        Mw::Methods m;
        Mw::Function funct;
        int a ;
        if(funct.url_isset()){
                a = m.i_GET("a");
                print << "a = " << a ; 
        }else{
                print << "<b>no param</b>";
        }
        return 0;
    }

this will check if the query string exist and then will print the content of the param "a"

Error Handling

show error type and line of the function that handle this error in the .cpp file

alt text

Mwf lib

Linux :

you can download the .deb package or the mwf installer in libmwflin

Windows :

soon

Documentation

##Mwu::Frame

    void 	init (const char *title, const char *description)
    void 	fload (const char *module)
    void 	end ()
    Frame(const char* title, const char * descr);
	~Frame();

##Mw::List

    SmwList * 	s_init (SmwList *list)
    DmwList * 	d_init (DmwList **list)
    SmwList * 	s_del (SmwList *list)
    DmwList * 	d_del (DmwList **list)
    list * 	sConstruct ()
    list * 	dConstruct ()
    int 	sprint (SmwList *list, char c)
    int 	dprint (DmwList **list, char *string)
    int 	sexec (SmwList *list)
    int 	dexec (DmwList **list)
    SmwList * 	p_sprint (SmwList *list, char c)
    DmwList * 	p_dprint (DmwList **list, char *string)
    SmwList * 	show (SmwList *list)

##Mw::Html

    void 	link (const char *string, const char *href, const char *style)
    void 	p (const char *string, const char *style)
    void 	h (const char *string, int type, const char *style)
    void 	img (const char *src, int heigh, int width)
    void 	css_local (const char *file, const char *type)
    void 	div (const char *style)
    void 	span (const char *style)
    void 	ul (const char *style)
    void 	li (const char *style)
    void 	code (const char *string, const char *style)
    void 	js_local (const char *file)
    void 	css_web (const char *href, const char *type)
    void 	js_web (const char *href)
    void 	checkbox (char *string, const char *style)

##Mw::Methods

    char * 	GET (char *param)
    char * 	POST (const char *param)
    int 	i_GET (char param[1025])
    void 	redirect (const char *href)

##Mw::Time

    clock_t 	load_page ()
    clock_t 	load_composent ()
    clock_t 	load_list (SmwList *list)
    clock_t 	currentTime ()
    double 	loadedTime (clock_t start, clock_t end)
    void 	draw_time (clock_t start, clock_t end, int type)

##Mw::Function

    void 	removeChr (char *str, char c)
    void 	removeNbr (char *str)
    void 	getNbr (char *str)
    void 	removeStr (char *str, const char *r)
    char * 	parsing_url (char *s, char *param)
    int 	url_isset ()
    int 	isset (char *mod)