Skip to content

Commit e440dd0

Browse files
committed
Modified SegmentGenerator to use TemplateProcessor.
1 parent 2bb2255 commit e440dd0

File tree

4 files changed

+179
-265
lines changed

4 files changed

+179
-265
lines changed

src/bin2cpp/ArrayGenerator.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ namespace bin2cpp
7171
" virtual const char * getFilePath() const { ${bin2cpp_cpp_get_file_path_impl} }\n"
7272
" virtual const char * getBuffer() const\n"
7373
" {\n"
74-
" static const unsigned char buffer[] = {\n${bin2cpp_insert_input_file_as_code}"
74+
" static const unsigned char buffer[] = {\n${bin2cpp_insert_input_file_as_code}" // INPUT FILE AS CODE HERE
7575
" };\n"
7676
" return (const char *)buffer;\n"
7777
" }\n"
@@ -123,7 +123,7 @@ namespace bin2cpp
123123
"{\n"
124124
" if ( ${bin2cpp_function_identifier_lowercase}_file.buffer )\n"
125125
" return true;\n"
126-
" static const unsigned char static_buffer[] = {\n${bin2cpp_insert_input_file_as_code}"
126+
" static const unsigned char static_buffer[] = {\n${bin2cpp_insert_input_file_as_code}" // INPUT FILE AS CODE HERE
127127
" };\n"
128128
"\n"
129129
" ${bin2cpp_function_identifier_lowercase}_file.buffer = static_buffer;\n"
@@ -176,8 +176,7 @@ namespace bin2cpp
176176
" ${bin2cpp_function_identifier_lowercase}_init();\n"
177177
" return &${bin2cpp_function_identifier_lowercase}_file;\n"
178178
"}\n"
179-
"${bin2cpp_c_file_manager_registration_implementation}"
180-
;
179+
"${bin2cpp_c_file_manager_registration_implementation}";
181180

182181
TemplateProcessor processor(&text);
183182
processor.setTemplateVariableLookup(this);

src/bin2cpp/ArrayGenerator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ namespace bin2cpp
4040
ArrayGenerator();
4141
virtual ~ArrayGenerator();
4242
virtual const char * getName() const;
43-
virtual bool createCppSourceFile(const char * cpp_file_path);
44-
virtual bool createCSourceFile(const char * cpp_file_path);
43+
virtual bool createCppSourceFile(const char * file_path);
44+
virtual bool createCSourceFile(const char * file_path);
4545
virtual bool printFileContent();
4646
virtual std::string getInputFileChunkAsCode(const unsigned char * buffer, size_t buffer_size, size_t index, size_t count, bool is_last_chunk);
4747
};

0 commit comments

Comments
 (0)