All Projects → ZFFramework → ZFFramework

ZFFramework / ZFFramework

Licence: MIT license
cross-platform C++ application framework, do 80% work at 20% cost

Programming Languages

C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language
java
68154 projects - #9 most used programming language
Objective-C++
1391 projects
QMake
1090 projects
CMake
9771 projects

Projects that are alternatives of or similar to ZFFramework

Prefser
Wrapper for Android SharedPreferences with object serialization and RxJava Observables
Stars: ✭ 228 (+250.77%)
Mutual labels:  serialization
Unicorn
A Sitecore utility designed to simplify deployment of Sitecore items across environments automatically
Stars: ✭ 252 (+287.69%)
Mutual labels:  serialization
FlexBuffersSwift
Swift implementation of FlexBuffers - a sub project of FlatBuffers
Stars: ✭ 24 (-63.08%)
Mutual labels:  serialization
Hprose Html5
Hprose is a cross-language RPC. This project is Hprose 2.0 Client for HTML5
Stars: ✭ 237 (+264.62%)
Mutual labels:  serialization
Depot.js
📦 depot.js is a storage library with a simple API
Stars: ✭ 247 (+280%)
Mutual labels:  serialization
json to cpp
Generate C++ class from JSON data
Stars: ✭ 42 (-35.38%)
Mutual labels:  serialization
Hyperion
Polymorphic serialization for .NET
Stars: ✭ 225 (+246.15%)
Mutual labels:  serialization
pony-capnp
Cap’n Proto plugin for generating serializable Pony classes. 🐴 - 🎩'n 🅿️
Stars: ✭ 19 (-70.77%)
Mutual labels:  serialization
Cbor
CBOR RFC 7049 (Go/Golang) - safe & fast with standard API + toarray & keyasint, CBOR tags, float64/32/16, fuzz tested.
Stars: ✭ 250 (+284.62%)
Mutual labels:  serialization
dubbo-hessian-lite
Hessian Lite for Apache Dubbo
Stars: ✭ 45 (-30.77%)
Mutual labels:  serialization
Parse5
HTML parsing/serialization toolset for Node.js. WHATWG HTML Living Standard (aka HTML5)-compliant.
Stars: ✭ 2,778 (+4173.85%)
Mutual labels:  serialization
Jsonapi Rails
Rails gem for fast jsonapi-compliant APIs.
Stars: ✭ 242 (+272.31%)
Mutual labels:  serialization
roswasm suite
Libraries for compiling C++ ROS nodes to Webassembly using Emscripten
Stars: ✭ 62 (-4.62%)
Mutual labels:  serialization
Django Data Wizard
🧙⚙️ Import structured data (e.g. Excel, CSV, XML, JSON) into one or more Django models via an interactive web-based wizard
Stars: ✭ 227 (+249.23%)
Mutual labels:  serialization
SafeParcel
Helper library and format description for SafeParcel, a version-agnostic parcelable serializer
Stars: ✭ 29 (-55.38%)
Mutual labels:  serialization
Qs
Quick serialization of R objects
Stars: ✭ 225 (+246.15%)
Mutual labels:  serialization
Cereal
A C++11 library for serialization
Stars: ✭ 2,986 (+4493.85%)
Mutual labels:  serialization
avro-serde-php
Avro Serialisation/Deserialisation (SerDe) library for PHP 7.3+ & 8.0 with a Symfony Serializer integration
Stars: ✭ 43 (-33.85%)
Mutual labels:  serialization
serdepp
c++ serialize and deserialize adaptor library like rust serde.rs
Stars: ✭ 70 (+7.69%)
Mutual labels:  serialization
iris
Lightweight Component Model and Messaging Framework based on ØMQ
Stars: ✭ 50 (-23.08%)
Mutual labels:  serialization

Introduction

welcome to ZFFramework, a cross-platform and powerful application framework in C++

everything here starts with "ZF", which stands for "Zero Framework"

  • it's not a traditional framework, can be loaded like a dynamic library, plug and play
  • designed to be able to run at any platform that supplies C++03 compatible implementation

Homepage:

Quick overview

cpp hello world

this piece of code shows how to show a hello world on UI and log output

#include "ZFUIWidget.h" // for common UI module
ZFMAIN_ENTRY() // app starts from here
{
    // show a hello world to log output
    zfLogT() << "hello wolrd";

    // show a window (full screen by default)
    zfblockedAlloc(ZFUIWindow, window);
    window->windowShow();

    // show a hello world as a text view
    zfblockedAlloc(ZFUITextView, textView);
    window->childAdd(textView)->c_alignTop()->c_margin(40);
    textView->text("hello world");

    // button and click (as observer)
    zfblockedAlloc(ZFUIButtonBasic, button);
    window->childAdd(button)->c_alignBottom()->c_margin(40);
    button->label()->text("click me");
    ZFLISTENER(onClick) {
        ZFUIButtonBasic *button = zfargs.senderT();
        zfLogTrimT() << "button clicked:" << button;
    } ZFLISTENER_END(onClick)
    button->onClick(onClick);
}

lua hello world

this piece of code shows equivalent lua code to use ZFFramework, all the lua bindings are automatically done by reflection!

zfLog('hello world')

local window = ZFUIWindow()
window:windowShow()

local textView = zfAlloc('ZFUITextView')
window:childAdd(textView):alignTop():margin(40)
textView:text('hello wolrd')

local button = ZFUIButtonBasic.ClassData():newInstance()
window:childAdd(button):alignBottom():margin(40)
button:label():text('click me')
button:onClick(
    function (zfargs)
        zfLog('button clicked: %s', zfargs:sender())
    end,
    button:objectHolder())

further more, it's easy to run lua code in thread (real native thread, not lua coroutine):

local capture = 123
zfLog('thread: %s, capture: %s', ZFThread.currentThread(), capture)
zfasync(function(zfargs)
        zfLog('thread: %s, capture: %s', ZFThread.currentThread(), capture)
    end)

powerful dynamic register

both lua and cpp can dynamic register class and method

#include "ZFLua.h"
ZFMAIN_ENTRY()
{
    ZFDynamic()
        .classBegin("MyBaseView", "ZFUIView")
            .method("void", "testFunc", ZFMP()
                .mp("zfstring", "testParam0")
                , [](const ZFArgs &zfargs) {
                    ZFMethodInvokeData *m = zfargs.param0T();
                    zfLogTrimT() << m->invokerMethod << "called, param0:" << m->param0;
                })
        .classEnd();

    ZFLuaExecute(
        "ZFDynamic()\n"
        "    :classBegin('MyChildView', 'MyBaseView')\n"
        "        :method('void', 'testFunc', ZFMP()\n"
        "            :mp('zfstring', 'testParam0')\n"
        "            , function(zfargs)\n"
        "                local m = zfargs:param0()\n"
        "                m:callSuper()\n"
        "                zfLogTrim('%s called, param0: %s', m:invokerMethod(), m:param0())\n"
        "            end)\n"
        "    :classEnd()\n"
        "\n"
        "local myView = MyChildView()\n"
        "myView:testFunc('luaParam0')\n"
    );

    zfautoObject obj = ZFClass::classForName("MyChildView")->newInstance();
    obj->invoke("testFunc", zflineAlloc(v_zfstring, "cppParam0"));

    ZFMethodAlias(ZFMethodForName("MyChildView", "testFunc"), "testAliased");
    ZFLuaExecute(
        "local myView = MyChildView()\n"
        "myView:testAliased('luaParam0')\n"
    );
}

powerful abstract IO

chain http file and zip file, and R/W contents in the zip file just like normal local file

#include "ZFCore.h"
ZFMAIN_ENTRY()
{
    ZFResExtPathAdd("ZFCompress:http:http://192.168.xxx.xxx/xxx.zip|");
    ZFInputReadAll(zfLogTrimT(), ZFInputForRes("path/in/zip/file.txt"));
    ZFPathInfoTreePrint(ZFPathInfo("res:"));
}

Getting started

  • Download necessary files
  • Setup set up necessary environment for ZFFramework
  • Tutorial quick tutorial to code with ZFFramework
  • FAQ

Detailed

Requirement

  • for the core modlue:

    • C++03 compatible compiler (require templates, no boost/RTTI/exceptions required)
    • STL containers (require: map/unordered_map/vector/deque/list), or supply custom wrapper
  • for the implementation module:

    • depends on the actual platform implementation

Main features

  • minimum requirement

  • powerful reflection, serialzation, styleable logic

    • for how powerful ZFFramework is, you may refer to Feature page
    • automatic lua binding, no extra bind code or config are necessary
    • automatic serialization
    • enhanced global event observer and event filter
  • fully modularization, "core + protocol + dynamic implementation" design

    support any platform if you are able to supply a native C++ implementation, most of implementation can be replaced easily, and implementation is required only if its owner module being used

  • easy to communicate with native code

    even to embed UI elements and native UI elements with each other

  • UI module to write cross-platform UI easily

  • built-in auto scale logic to support multiple screen size

    you have no need to write size-dependent code in both app and implementation

Current status

  • finished
    • core module (memory management, reflection, serialization)
    • basic UI module (view, window, label, image view, button, layout, scroll view, list view)
    • basic algorithm (xml, json, regexp, md5, base64, crc32, encryption, compression)
    • common platform implementations (iOS, Android, Qt)
    • auto lua binding by reflection
  • working
    • more useful UI modules
    • basic network module
    • basic database module
  • future
    • standalone visual UI editor
    • more IDE / compile env integrations
    • more platform implementations

What we do

  • aiming to be portable and can be ported easily, aiming to be lightweighted and able to be embeded easily, you may simply drag and drop all src files to your build system
  • fully dynamic, extensible

License

ZFFramework is under MIT license (see here), feel free to copy or modify or use it

if you like my work, buy me a coffee?

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].