manpage 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. .\" Manpage for jsonrpcstub.
  2. .\" Contact psk@autistici.org to correct errors or typos.
  3. .TH man 1 "7 April 2015" "0.7.0" "jsonrpcstub man page"
  4. .SH NAME
  5. jsonrpcstub \- genearate stubs for the libjson\-rpc\-cpp framework.
  6. .SH SYNOPSIS
  7. .B
  8. jsonrpcstub specfile.json [\-\-cpp\-server=namespace::ClassName]
  9. [\-\-cpp\-server\-file=classqname.h] [\-\-cpp\-client=namespace::ClassName]
  10. [\-\-cpp\-client-file=classname.h] [\-\-js\-client=ClassName]
  11. [\-\-js-client-file=classname.js] [\-h] [\-v] [\-\-version]
  12. .PP
  13. .SH DESCRIPTION
  14. .PP
  15. jsonrpcstub is a tool to generate C++ and JavaScript classes from a procedure specification file.
  16. .SS SPECIFICATION SYNTAX
  17. .PP
  18. The specifictaion file is a JSON file containing all available JSON\-RPC methods and notifications
  19. with their corresponding parameters and return values contained in a top\-level JSON array.
  20. .PP
  21. .nf
  22. [
  23. {
  24. "name": "method_with_positional_params",
  25. "params": [3,4],
  26. "returns": 7
  27. },
  28. {
  29. "name": "method_with_named_params",
  30. "params": {"param1": 3, "param2": 4},
  31. "returns": 7
  32. },
  33. {
  34. "name": "notification_without_parmas"
  35. }
  36. ]
  37. .fi
  38. .PP
  39. The literal in each \fB"params"\fP and \fB"returns"\fP section defines the corresponding type.
  40. If the \fb"params"\fP contains an array, the parameters are accepted by position,
  41. if it contains an object, they are accepted by name.
  42. .SH OPTIONS
  43. .IP \-h
  44. Print usage information.
  45. .IP \-v
  46. Print verbose information during generation.
  47. .IP \-\-version
  48. Print version info and exit.
  49. .IP \-\-cpp\-server=ClassName
  50. Creates a Abstract Server class. Namespaces can be provided using the :: notation
  51. (e.g. ns1::ns2::Classname).
  52. .IP \-\-cpp\-server\-file=filename.h
  53. Defines the filename to use when generating the C++ Abstract Server class.
  54. If this is not provided, the lowercase classname is used.
  55. .IP \-\-cpp\-client=ClassName
  56. Creates a C++ client class. Namespaces can be provided using the :: notation
  57. (e.g. ns1::ns2::Classname).
  58. .IP \-\-cpp\-client\-file=filename.h
  59. Defines the filename to use when generating the C++ client class.
  60. If this is not provided, the lowercase classname is used.
  61. .IP \-\-js\-client=ClassName
  62. Creates a JavaScript client class. No namespaces are supported in this option.
  63. .IP \-\-js\-client-file=filename.js
  64. Defines the filename to use when generating the JavaScrip client class.
  65. .SH EXAMPLES
  66. .PP
  67. Generate C++ Stubs for Server and Client, the classes will be named AbstractStubServer and StubClient:
  68. .P P
  69. .B
  70. \& jsonrpcstub spec.json \-\-cpp\-server=AbstractStubServer \-\-cpp\-client=StubClient
  71. .B
  72. .PP
  73. Generate JavaScript Client class MyRpcClient into file someclient.js:
  74. .PP
  75. .B
  76. \& jsonrpcstub spec.json \-\-js\-client=MyRpcClient \-\-js\-client\-file=someclient.js
  77. .B
  78. .SH EXIT STATUS
  79. This command returns 0 if no error occurred. In any other case, it returns 1.
  80. .SH SEE ALSO
  81. https://github.com/cinemast/libjson\-rpc\-cpp
  82. .SH BUGS
  83. No known bugs. Please report found bugs as an issue on github or send me an email.
  84. .SH COPYRIGHT
  85. Copyright (C) 2011\-2015 Peter Spiess\-Knafl
  86. Permission is hereby granted, free of charge, to any person obtaining a copy of
  87. this software and associated documentation files (the "Software"), to deal in the
  88. Software without restriction, including without limitation the rights to
  89. use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
  90. the Software, and to permit persons to whom the Software is furnished to do so,
  91. subject to the following conditions:
  92. The above copyright notice and this permission notice shall be included in all
  93. copies or substantial portions of the Software.
  94. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  95. INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
  96. PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
  97. LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  98. TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
  99. OR OTHER DEALINGS IN THE SOFTWARE.
  100. .SH AUTHOR
  101. Peter Spiess\-Knafl (dev@spiessknafl.at)