MyCSS ( a CSS parser ) Introduction














































MyCSS ( a CSS parser ) Introduction



Introduction

MyCSS is a fast CSS Parser with the ability to build without dependencies..
 
Few Features::

 Modules: CSS Syntax, Selectors Level 4, Namespace, Values, Box and other
 Two API - high and low-level.
 Supports parsing by chunks.
 Supports detect encodings.
 
A Sample Program::

#include <iostream>
#include <string>
#include <mycss/api>
#include<string.h>

int main(int argc, const char * argv[])
{
    char *css = "#ident [name=\"Hello\"] {rgba(1, 0.1, 0.1, 0.1);}";
   
    // base init
    mycss_t *mycss = mycss_create();
    mycss_status_t status = mycss_init(mycss);
    
    // current entry, work init
    mycss_entry_t *entry = mycss_entry_create();
    status = mycss_entry_init(mycss, entry);
    
    mycss_parse(entry, MyHTML_ENCODING_UTF_8, css, strlen(css));
    
    // free the resources memory
    mycss_entry_destroy(entry, true);
    mycss_destroy(mycss, true);
    
    return 0;
}

Comments