MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / print_usage

Function print_usage

CMakeModules/bin2cpp.cpp:37–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35typedef map<string, string> opt_t;
36
37void print_usage() {
38 cout << R"delimiter(BIN2CPP
39Converts files from a binary file to C++ headers. It is similar to bin2c and
40xxd but adds support for namespaces.
41
42| --name | name of the variable (default: var) |
43| --file | input file |
44| --output | output file (If no output is specified then it prints to stdout |
45| --type | Type of variable (default: char) |
46| --binary | If the file contents are in binary form |
47| --nullterm | Add a null character to the end of the file |
48| --namespace | A space seperated list of namespaces |
49| --formatted | Tabs for formatting |
50| --version | Prints my name |
51| --help | Prints usage info |
52
53Example
54-------
55Command:
56./bin2cpp --file blah.txt --namespace blah detail --formatted --name blah_var
57
58Will produce:
59#pragma once
60#include <common/util.hpp>
61#include <cstddef>
62namespace blah {
63 namespace detail {
64 static const unsigned char blah_var_uchar [] = {
65 0x2f, 0x2f, 0x20, 0x62, 0x6c, 0x61, 0x68, 0x2e, 0x74, 0x78,
66 0x74, 0xa, 0x62, 0x6c, 0x61, 0x68, 0x20, 0x62, 0x6c, 0x61,
67 0x68, 0x20, 0x62, 0x6c, 0x61, 0x68, 0xa, };
68 static const char *blah_var = (const char*)blah_var_uchar;
69 static const size_t blah_var_len = 27;
70 static const size_t blah_var_hash = 12345678901234567890ULL;
71 static const common::Source blah_var_src = {
72 blah_var,
73 blah_var_len,
74 blah_var_hash
75 };
76 }
77})delimiter";
78 exit(0);
79}
80
81static bool formatted;
82static bool binary = false;

Callers 2

parse_optionsFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected