File: README

package info (click to toggle)
cxxtools 3.0.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,960 kB
  • sloc: cpp: 68,550; ansic: 15,641; sh: 4,239; makefile: 841
file content (179 lines) | stat: -rw-r--r-- 5,515 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
This directory contains some demonstrations for cxxtools.

The examples are as minimal as possible to demonstrate simple usage-patterns.

arg
===
Demonstration of template `cxxtools::Arg`.

dir
===
Print contents of a directory. Try `./dir .`.

dlloader
========
Load shared library and call a function. Useful to create plugins in your
applications.

getini
======
Read value from ini-file.

Try `./getini test.ini sec1 value`

hdstream
========
Just a little hexdumper. To print a hexdump of a file use `./hexdump filename`

log
===
Demonstration of cxxtools-logging-library.

It uses a configurationfile log.xml or log.properties to determine the amount of
logging.

A sample configuration file log.xml can be created with the command
`cxxtools-config --logxml cxxtools >log.xml`.

md5sum
======
Calculate md5sum of files. Try `./md5sum file1 file2`

multifstream
============
Concatenate multipe files to stdout. Try `./multiifstream file1 file2`.

netcat/netecho
==============
Demonstration of a simple network-server and -client.

Netcat listens to a port (default 1234) and prints all input to stdout.

Netecho connects to netcat and copies stdin to netcat.

To try out enter `./netcat` in one terminal and then `./netcat <netcat.cpp`
in another. Netcat prints the sourcecode of netcat.cpp. If netcat runs
on another machine, you need to tell netcat the ip-address of the netcat-server
with `./netcat -i host`.

netio
=====
Network-performance tool.

Netio has 2 modes: server and client. To enable server-mode start with option
-s. It waits for a incoming connection on port 1234 (adjustable with -p).

In client-mode you need to give netio the ip-address (or hostname) of the
server with -i. The clients sends random data with different package-sizes to
the server and computes the network-througput. It starts with 256 bytes and
doubles until 64k. Each package-size is sent for 1 second (adjustable with -t).
With -B you can specify a single fixed block-size.

pipestream
==========
This demo shows, how to create a child-process, use a pipe to signal
from child to parent and another pipe to send a datastream.

pool
====
Demonstration of template pool. Example connectionpool. Useful for
multithreaded applications.

serialization/deseriaization
============================
Show how to convert C++ objects to json, xml or csv and back.

`serialization` creates a vector of 2 C++ objects and depending on the command
line option prints them as json, xml or csv.

If called with option -x, the output is xml. Giving option -c prints csv.
Without those, json is printed.

The option -b formats the output nicely. It has no effect on csv.

`deserialization` reads formatted input from stdin and converts them to C++. It
expects the same list of objects as the `serialization` demo program prints. The
formatting options `-x` and `-c` are also valid for `deserialization` to tell
the process, what format it should read.

To try the programs out, you can call:

    ./serialization|./deserialization

    ./serialization -x|./deserialization -x

    ./serialization -c|./deserialization -c

msgclient/msgserver
===================
This shows a little messaging client and server.

The server starts and waits for a incoming connection. When a connection
arrives it sends 2 messages to the client.

The client connects on startup to the server and reads messages until the
socket is closed.

The messages are serialized using binary serialization. It is easy to send and
receive more complex messages over a socket. It is easy to change the
serialization format to xml or json using the suitable serializer and
deserializer.

saml2
=====
Demonstrate how to create dynamically xml using `cxxtools::xml::XmlWriter`.

It prints a SAML2 document to stdout.

insrv
=====
The demo shows asyncronous I/O with cxxtools::IOStream and use of
`cxxtools::StdinDevice`, which implements a cxxtools::IODevice to `stdin`.

The demo starts a tcp server using `cxxtools::net::TcpServer` and waits for
incoming connection. A `cxxtools::StdinDevices` is created and attached to a
`cxxtools::IOStream`.  When new connections arrive they are accepted by
creating a `cxxtools::net::TcpStream`. All that is done in the same event loop
using non blocking I/O.

When the demo is started it reads input from stdin and sends it to all
attached clients.

It can be tried out using telnet:
    telnet localhost 1234

Or with the netcat demo:
    ./netcat -r </dev/null

siconvert
=========
Converts files from one serialization format to another using
`cxxtools::SerializationInfo`.

It reads a file in binary, xml, json or csv format and outputs to those
formats. The input files are specified either on command line or read from
stdin when no file is specified.

For reading the flags `-b` (binary), `-x` (xml), `-j` (json) or `-c` (csv) are
used to tell, which deserializer to use.

For output the flags `-B` (binary), `-X` (xml), `-J` (json) or `-C` (csv) are
used. Additionally there is `-Y` for simplified xml without attributes and `-n`
to print just the number of nodes on the first level.

Note that converting a file to the same format is possible but mostly do not
result in the very same file since not all formats has all serialization
informations available to restore the original file.

The flag `-d` enables *beautification* for xml and json output, which adds
indentation for better readability.

Example:

convert a csv file to json:

    siconvert -cJ foo.csv

convert a xml file to json

    siconvert -xJ data.xml