Skip to content

d1vanov/QEverCloudGenerator

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

QEverCloudGenerator

Generator of unofficial Qt-friendly Evernote SDK

master

What's this

Evernote delivers its API to thirdparty developers in the form of SDKs for various programming languages. All these SDKs actually consist of automatically generated code, maybe just slightly adjusted by hand after the fact. The real source for all the automatically generated code is the set of Thrift IDL files where IDL stands for "interface definition language". The Thrift software framework mentored by the Apache Software Foundation contains a code generation engine capable of creating source code in various programming languages from the same set of Thrift IDL files. That engine can generate the C++ code as well and Evernote does ship the official C++ SDK but it is not very comfortable to use along with Qt framework because it uses a lot of non-Qt data types so that the SDK client has to convert between std::string and QString here and there + that official C++ SDK has runtime dependencies on Thrift libraries.

QEverCloudGenerator's purpose is to generate the Qt-friendly SDK code from Evernote's Thrift IDL files. In addition to Qt friendliness, it also removes the additional dependencies. The source code generated by QEverCloudGenerator is used in QEverCloud library.

Note that QEverCloudGenerator is not a general purpose Thrift parser & code generator, it is an ad-hoc solution for a very particular set of very particular Thrift IDL files. If you think that it has the potential to become such a general purpose tool and want to help with making it happen, feel free to open issues for discussions firts and to send pull requests with agreed changes next.

How to build

The only dependency is Qt5Core module for Qt5.

The project uses CMake build system which can be used as simply as follows (example for Unix platforms):

mkdir build
cd build
cmake ../
make

How to use

Once QEverCloudGenerator is built, you can invoke it in the following way from your build directory (example for Unix platforms):

thrift_parser/QEverCloudGenerator <path to Evernote Thrift IDL files> <path to the place where to put the generated files>

As long as QEverCloudGenerator includes the Evernote Thrift IDL files as a submodule, you can use it even simpler:

thrift_parser/QEverCloudGenerator ../thrift/src <path to the place where to put the generated files>

Historical notes

This repository is a fork of original mgsxx's code. The original project used qmake build system and relied on some very esoteric qmake trickery which was so esoteric that qmake from Qt 5.5 on Linux kept crashing for me on attempt to use it. Given that circumstance, my personal prefence for CMake build system and my desire to be able to use the generator, here is this fork.

The change of the build system was only the first difference between this fork and the original project. Other differences include:

  • Simplification and minimization of the project; the QEverCloud library is no longer a subproject of the generator.
  • Upgrade of the generator for the handling of most recent Evernote API version - 1.29.

Project structure

QEverCloudGenerator uses lemon LALR(1) parser generator to generate the parser for Thrift IDL files. The parser generator given the config file thrift_lemon.y produces two generated files - thrift_lemon.h header and thrift_lemon source which contain the implementation of parser for Thrift IDL files. Then QEverCloudGenerator uses this implementation to actually parse the Thrift IDL files.

The project's source tree contains several subdirs:

  • lemon - here the lemon parser generator is built from souce + custom CMake command copies the template driver lempar.c to the build directory where the lemon parser generator is actually invoked
  • thrift_parser - here the actual parsing and code generation takes place

Packages

No packages published

Languages

  • Thrift 46.0%
  • C++ 30.2%
  • C 21.7%
  • Yacc 1.5%
  • CMake 0.6%