pip_cmg -H

This commit is contained in:
2022-04-16 01:13:10 +03:00
parent 9fa78a1dbf
commit bef0ac1194

View File

@@ -24,10 +24,47 @@ using namespace PICoutManipulators;
PICodeParser parser; PICodeParser parser;
const char help_string[] =
"-M (Metainfo)\n"
"Generate classes and structs info. It contains\n"
"names, subclass info, all methods and variables.\n"
"Place information:\n"
" * classes and structs - PICodeInfo::classesInfo\n"
" * methods - ClassInfo::functions\n"
" * variables - ClassInfo::variables\n"
"\n"
"-E (Enums)\n"
"Generate enumeration descriptions.\n"
"Useful for GUI integrations, because\n"
"you can obtain enumerators value and name.\n"
" * enums - PICodeInfo::enumsInfo\n"
"\n"
"-S (Stream operators)\n"
"Generate store/restore operators with format\n"
"PIByteArray & operator <<(PIByteArray & s, const <type> & v);\n"
"PIByteArray & operator >>(PIByteArray & s, <type> & v);\n"
"Only public variables used. All variables stored/restored\n"
"using PIChunkStream. IDs are variable number, starting from 1.\n"
"You can override ID with PIMETA(id=<ID>). If in class or struct\n"
"PIMETA(simple-stream) presence, then variables stored/restored\n"
"with simple << and >> operators.\n"
"\n"
"-G (Getter functions)\n"
"Generate anonymous access methods for member typenames and values.\n"
"Every class or struct member typename can be obtained with:\n"
"const char * getMemberType(const char * class_name, const char * member_name)\n"
"Member value can be obtained with:\n"
"PIByteArray getMemberValue(const void * p, const char * class_name, const char * member_name)\n"
"where \"p\" - class or struct pointer, and returns serialized value.\n"
"PIVariant getMemberAsVariant(const void * p, const char * class_name, const char * member_name)\n"
"where \"p\" - class or struct pointer, and returns value as registered PIVariant.\n"
""
;
void header() { void header() {
piCout << Bold << "PIP Code model generator"; piCout << Bold << "PIP Code model generator";
piCout << Cyan << "Version" << Bold << PIPVersion() << NewLine; piCout << Cyan << "Version" << Bold << PIPVersion() << NewLine;
piCout << Green << Bold << "Usage:" << Default << "\"pip_cmg [-hqPpsAMEST] -o <output_file> [-I<include_dir1>] [-I<include_dir1>] [...] [-D<define1>] [-D<define1>] [...] <file1> [<file2>] [<file3>] [...]\"" << NewLine; piCout << Green << Bold << "Usage:" << Default << "\"pip_cmg [-hHqPpsAMESTG] -o <output_file> [-I<include_dir1>] [-I<include_dir1>] [...] [-D<define1>] [-D<define1>] [...] <file1> [<file2>] [<file3>] [...]\"" << NewLine;
} }
void usage() { void usage() {
@@ -60,8 +97,7 @@ void usage() {
void help() { void help() {
header(); header();
piCout << Bold << "Metainfo"; piCout << help_string;
piCout << "-h " << Green << "- display this message and exit";
} }