Skip to content

Commit 49de81b

Browse files
committed
Finalized usage string and README.md.
1 parent ef523a2 commit 49de81b

File tree

2 files changed

+38
-38
lines changed

2 files changed

+38
-38
lines changed

README.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ The main features of the project are:
5858
* File's originals `size`, `filename` and `directory` properties available from generated source code.
5959
* Control generated source code: choose your custom _File_ interface and namespace.
6060
* Print a file encoded content to stdout. Useful for scripts and integration with third party application.
61-
* Generated code is C++98 standard-compliant
61+
* Generated code is C++98 standard-compliant.
6262

6363

6464

@@ -100,28 +100,28 @@ bin2cpp --help
100100
bin2cpp --version
101101
```
102102

103-
| Argument | Description |
104-
|---------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
105-
| --help | Display this help message. |
106-
| --version | Display this application version. |
107-
| --file=<path> | Path of the input file used for embedding as C++ source code. |
108-
| --dir=<path> | Path of the input directory used for embedding all files of the directory as C++ source code. When specified, the parameters 'headerfile' and 'identifier' are automatically calculated and cannot be manually specified. |
109-
| --output=<path> | Path of the output directory where to create generated code. ie: ./generated_files |
110-
| --headerfile=<name> | File name or relative path of the generated C++ header file. ie: SplashScreen.h. If a relative path from the output directory is specified, the #include statement in the generated cpp file will match the relative path. |
111-
| --identifier=<name> | Identifier of the function name that is used to get an instance of the file. ie: SplashScreen |
112-
| --generator=<name> | Name of the generator to use. Possible values are 'segment', 'string', 'array' and 'win32'. [default: segment]. |
113-
| --encoding=<name> | Name of the binary to string literal encoding to use. Possible values are 'oct' and 'hex'. [default: oct]. |
114-
| --chunksize=<value> | Size in bytes of each string segments (bytes per row). [default: 200]. |
115-
| --baseclass=<name> | The name of the interface for embedded files. [default: File]. |
116-
| --namespace=<name> | The namespace of the generated source code [default: bin2cpp]. |
117-
| --managerfile=<name> | File name of the generated C++ header file for the FileManager class. ie: FileManager.h. |
118-
| --registerfile | Register the generated file to the FileManager class. This flags is automatically set when parameter 'managerfile' is specified. [default: false]. |
119-
| --keepdirs | Keep the directory structure. Forces the output files to have the same directory structure as the input files. Valid only when --dir is used. |
120-
| --reportedfilepath=<name> | The relative reported path of the File. Path returned when calling method getFilePath() of the File class. ie: images/DCIM/IMG_0001.jpg. Automatically calculated when --dir mode is used. |
121-
| --plainoutput | Print the encoded string in plain format to stdout. Useful for scripts and integration with third party application. |
122-
| --override | Tells bin2cpp to overwrite the destination files. |
123-
| --noheader | Do not print program header to standard output. |
124-
| --quiet | Do not log any message to standard output. |
103+
| Argument | Description |
104+
|---------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
105+
| --help | Display this help message. |
106+
| --version | Display this application version. |
107+
| --file=<path> | Path of the input file used for embedding as C++ source code. |
108+
| --dir=<path> | Path of the input directory used for embedding all files of the directory as C++ source code. |
109+
| --output=&lt;path&gt; | Path of the output directory where to create generated code.<br>ie: ./generated_files |
110+
| --headerfile=&lt;name&gt; | File name or relative path of the generated C++ header file. If a relative path from the output directory is specified, the #include statement in the generated cpp file will match the relative path. <br>ie: SplashScreen.h<br>Default value: input file name (without extension) |
111+
| --identifier=&lt;name&gt; | Identifier of the function name that is used to get an instance of the file.<br>ie: SplashScreen<br>Default value is based on input file with format 'NameExt'. |
112+
| --generator=&lt;name&gt; | Name of the generator to use. Possible values are 'segment', 'string', 'array' and 'win32'.<br>[default: segment] |
113+
| --encoding=&lt;name&gt; | Name of the binary to string literal encoding to use. Possible values are 'oct' and 'hex'.<br>[default: oct] |
114+
| --chunksize=&lt;value&gt; | Size in bytes of each string segments (bytes per LoC).<br>[default: 200] |
115+
| --baseclass=&lt;name&gt; | The name of the interface for embedded files.<br>[default: File] |
116+
| --namespace=&lt;name&gt; | The namespace of the generated source code.<br>[default: bin2cpp] |
117+
| --reportedfilepath=&lt;path&gt; | The relative reported path of the File. Path returned when calling method getFilePath() of the File class. Automatically calculated when --dir mode is used.<br>ie: images/DCIM/IMG_0001.jpg |
118+
| --managerfile=&lt;path&gt; | File name or relative path of the generated C++ header file for the FileManager class.<br>ie: FileManager.h. |
119+
| --registerfile | Register the generated file to the FileManager class. This flags is automatically set when parameter 'managerfile' is specified. |
120+
| --keepdirs | Keep the directory structure. Forces the output files to have the same directory structure as the input files. Valid only when --dir is used. |
121+
| --plainoutput | Print the encoded string in plain format to stdout. Useful for scripts and integration with third party application. |
122+
| --override | Tells bin2cpp to overwrite the destination files. |
123+
| --noheader | Do not print program header to standard output. |
124+
| --quiet | Do not log any message to standard output. |
125125

126126

127127

@@ -189,7 +189,6 @@ namespace bin2cpp
189189
{
190190
public:
191191
virtual size_t getSize() const = 0;
192-
/* DEPRECATED */ virtual inline const char * getFilename() const { return getFileName(); }
193192
virtual const char * getFileName() const = 0;
194193
virtual const char * getFilePath() const = 0;
195194
virtual const char * getBuffer() const = 0;
@@ -617,7 +616,7 @@ saved
617616
The executed code above has extracted the files above with the following directory structure:
618617
619618
```
620-
C:\Users\foobar\AppData\Local\Temp\www
619+
C:\Users\username\AppData\Local\Temp\www
621620
├── blog
622621
│ ├── how-to-create-a-web-site
623622
│ │ └── index.html

src/bin2cpp/main.cpp

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,23 +189,24 @@ void printUsage()
189189
" --version Display this application version.\n"
190190
" --file=<path> Path of the input file used for embedding as C++ source code.\n"
191191
" --dir=<path> Path of the input directory used for embedding all files of the directory as C++ source code.\n"
192-
" When specified, the parameters 'headerfile' and 'identifier' are automatically calculated and cannot be manually specified.\n"
193-
" --output=<path> Path of the output directory where to create generated code. ie: ." SEPARATOR "generated_files.\n"
194-
" --headerfile=<name> File name or relative path of the generated C++ Header file. ie: SplashScreen.h\n"
195-
" If a relative path from the output directory is specified, the #include statement in the generated cpp file will match the relative path.\n"
192+
" --output=<path> Path of the output directory where to create generated code. ie: ." SEPARATOR "generated_files\n"
193+
" --headerfile=<path> File name or relative path of the generated C++ header file. If a relative path from the output directory is specified,\n"
194+
" the #include statement in the generated cpp file will match the relative path. ie: SplashScreen.h\n"
195+
" Default value: input file name (without extension)\n"
196196
" --identifier=<name> Identifier of the function name that is used to get an instance of the file. ie: SplashScreen\n"
197-
" --generator=<name> Name of the generator to use. Possible values are 'segment', 'string', 'array' and 'win32'. [default: segment].\n"
198-
" --encoding=<name> Name of the binary to string literal encoding to use. Possible values are 'oct' and 'hex'. [default: oct].\n"
199-
" --chunksize=<value> Size in bytes of each string segments (bytes per row). [default: 200].\n"
200-
" --baseclass=<value> The name of the interface for embedded files. [default: File].\n"
201-
" --namespace=<value> The namespace of the generated source code [default: bin2cpp].\n"
202-
" --managerfile=<name> File name of the generated C++ header file for the FileManager class. ie: FileManager.h\n"
203-
" --registerfile Register the generated file to the FileManager class. [default: false].\n"
197+
" Default value is based on input file with format 'NameExt'.\n"
198+
" --generator=<name> Name of the generator to use. Possible values are 'segment', 'string', 'array' and 'win32'. [default: segment]\n"
199+
" --encoding=<name> Name of the binary to string literal encoding to use. Possible values are 'oct' and 'hex'. [default: oct]\n"
200+
" --chunksize=<value> Size in bytes of each string segments (bytes per LoC). [default: 200]\n"
201+
" --baseclass=<name> The name of the interface for embedded files. [default: File]\n"
202+
" --namespace=<name> The namespace of the generated source code. [default: bin2cpp]\n"
203+
" --reportedfilepath=<path> The relative reported path of the File. Path returned when calling method getFilePath() of the File class. ie: images" SEPARATOR "DCIM" SEPARATOR "IMG_0001.jpg.\n"
204+
" Automatically calculated when --dir mode is used.\n"
205+
" --managerfile=<path> File name or relative path of the generated C++ header file for the FileManager class. ie: FileManager.h\n"
206+
" --registerfile Register the generated file to the FileManager class.\n"
204207
" This flags is automatically set when parameter 'managerfile' is specified.\n"
205208
" --keepdirs Keep the directory structure. Forces the output files to have the same\n"
206209
" directory structure as the input files. Valid only when --dir is used.\n"
207-
" --reportedfilepath=<name> The relative reported path of the File. Path returned when calling method getFilePath() of the File class. ie: images" SEPARATOR "DCIM" SEPARATOR "IMG_0001.jpg.\n"
208-
" Automatically calculated when --dir mode is used.\n"
209210
" --plainoutput Print the encoded string in plain format to stdout. Useful for scripts and integration with third party application.\n"
210211
" --override Tells bin2cpp to overwrite the destination files.\n"
211212
" --noheader Do not print program header to standard output.\n"

0 commit comments

Comments
 (0)