logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

jsonrpcstub - genearate stubs for the libjson-rpc-cpp framework.

Author

       Peter Spiess-Knafl (dev@spiessknafl.at)

0.7.0                                             7 April 2015                                            man(1)

Bugs

       No known bugs. Please report found bugs as an issue on github or send me an email.

Description

       jsonrpcstub is a tool to generate C++ and JavaScript classes from a procedure specification file.

   SPECIFICATIONSYNTAX
       The specifictaion file is a JSON file containing all available JSON-RPC methods  and  notifications  with
       their corresponding parameters and return values contained in a top-level JSON array.

       [
            {
                 "name": "method_with_positional_params",
                 "params": [3,4],
                 "returns": 7
            },
            {
                 "name": "method_with_named_params",
                 "params": {"param1": 3, "param2": 4},
                 "returns": 7
            },
            {
                 "name": "notification_without_parmas"
            }
       ]

       The  literal  in  each  "params"  and  "returns" section defines the corresponding type.  If the "params"
       contains an array, the parameters are accepted by position, if it contains an object, they  are  accepted
       by name.

Examples

       Generate C++ Stubs for Server and Client, the classes will be named AbstractStubServer and StubClient:

              jsonrpcstubspec.json--cpp-server=AbstractStubServer--cpp-client=StubClient

       Generate JavaScript Client class MyRpcClient into file someclient.js:

              jsonrpcstubspec.json--js-client=MyRpcClient--js-client-file=someclient.js

Exit Status

       This command returns 0 if no error occurred. In any other case, it returns 1.

Name

       jsonrpcstub - genearate stubs for the libjson-rpc-cpp framework.

Options

       -h     Print usage information.

       -v     Print verbose information during generation.

       --version
              Print version info and exit.

       --cpp-server=ClassName
              Creates  a  Abstract  Server  class.  Namespaces  can  be  provided  using  the  :: notation (e.g.
              ns1::ns2::Classname).

       --cpp-server-file=filename.h
              Defines the filename to use when generating the  C++  Abstract  Server  class.   If  this  is  not
              provided, the lowercase classname is used.

       --cpp-client=ClassName
              Creates   a   C++   client  class.  Namespaces  can  be  provided  using  the  ::  notation  (e.g.
              ns1::ns2::Classname).

       --cpp-client-file=filename.h
              Defines the filename to use when generating the C++ client class.  If this is  not  provided,  the
              lowercase classname is used.

       --js-client=ClassName
              Creates a JavaScript client class. No namespaces are supported in this option.

       --js-client-file=filename.js
              Defines the filename to use when generating the JavaScrip client class.

See Also

       https://github.com/cinemast/libjson-rpc-cpp

Synopsis

jsonrpcstubspecfile.json[--cpp-server=namespace::ClassName]
        [--cpp-server-file=classqname.h]    [--cpp-client=namespace::ClassName]  [--cpp-client-file=classname.h]
       [--js-client=ClassName] [--js-client-file=classname.js]  [-h] [-v] [--version]

See Also