Skip to content

Commit 4465ae3

Browse files
committed
Renamed lookupStringTemplateVariable() to lookupStringVariable().
Renamed `lookupStreamTemplateVariable()` to `lookupStreamVariable()`.
1 parent 0ef1a82 commit 4465ae3

File tree

7 files changed

+13
-13
lines changed

7 files changed

+13
-13
lines changed

src/bin2cpp/BaseGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ namespace bin2cpp
5656
return mContext;
5757
}
5858

59-
bool BaseGenerator::lookupStringTemplateVariable(const std::string& name, std::string& output)
59+
bool BaseGenerator::lookupStringVariable(const std::string& name, std::string& output)
6060
{
6161
if ( name == "bin2cpp_output_file_macro_guard" ) { output = getCppIncludeGuardMacroName(mContext.headerFilename); return true; }
6262
if ( name == "bin2cpp_output_file_header" ) { output = getHeaderTemplate(); return true; }
@@ -109,7 +109,7 @@ namespace bin2cpp
109109
return false;
110110
}
111111

112-
bool BaseGenerator::lookupStreamTemplateVariable(const std::string& name, std::ostream& output)
112+
bool BaseGenerator::lookupStreamVariable(const std::string& name, std::ostream& output)
113113
{
114114
if ( name == "bin2cpp_insert_input_file_as_code" )
115115
{

src/bin2cpp/BaseGenerator.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ namespace bin2cpp
4545
virtual const Context & getContext() const;
4646

4747
//ITemplateVariableLookup methods
48-
virtual bool lookupStringTemplateVariable(const std::string& name, std::string& output);
49-
virtual bool lookupStreamTemplateVariable(const std::string& name, std::ostream& output);
48+
virtual bool lookupStringVariable(const std::string& name, std::string& output);
49+
virtual bool lookupStreamVariable(const std::string& name, std::ostream& output);
5050

5151
//same header file for all generators
5252
virtual bool createCppHeaderFile(const char * header_file_path);

src/bin2cpp/ITemplateVariableLookup.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace bin2cpp
4444
///<param name="name">The name of the template variable.</param>
4545
///<param name="output">The output string for getting the value or the template variable.</param>
4646
///<return>Returns true when the template variable is handled by the instance. Returns false otherwise.<return>
47-
virtual bool lookupStringTemplateVariable(const std::string& name, std::string& output) = 0;
47+
virtual bool lookupStringVariable(const std::string& name, std::string& output) = 0;
4848

4949
///<summary>
5050
///Lookup the string value for a given template variable name.
@@ -54,7 +54,7 @@ namespace bin2cpp
5454
///<param name="name">The name of the template variable.</param>
5555
///<param name="output">The output string for getting the value or the template variable.</param>
5656
///<return>Returns true when the template variable is handled by the instance. Returns false otherwise.<return>
57-
virtual bool lookupStreamTemplateVariable(const std::string& name, std::ostream& output) = 0;
57+
virtual bool lookupStreamVariable(const std::string& name, std::ostream& output) = 0;
5858

5959
};
6060

src/bin2cpp/TemplateProcessor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ namespace bin2cpp
126126

127127
// Check if template variable is a string and do the variable expansion
128128
std::string expanded_value;
129-
bool found_as_string = mVariableLookup->lookupStringTemplateVariable(variable_name, expanded_value);
129+
bool found_as_string = mVariableLookup->lookupStringVariable(variable_name, expanded_value);
130130

131131
// Proceed with the recursive handling
132132
if ( found_as_string )
@@ -144,7 +144,7 @@ namespace bin2cpp
144144
{
145145
// Check if template variable is a stream
146146
// Stream based template variables do not support recursive lookup and tracking
147-
bool found_as_stream = mVariableLookup->lookupStreamTemplateVariable(variable_name, output_stream);
147+
bool found_as_stream = mVariableLookup->lookupStreamVariable(variable_name, output_stream);
148148
}
149149

150150
pos = end_pos + 1;

src/bin2cpp/Win32ResourceGenerator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -376,13 +376,13 @@ namespace bin2cpp
376376
return false; // not supported
377377
}
378378

379-
bool Win32ResourceGenerator::lookupStringTemplateVariable(const std::string& name, std::string& output)
379+
bool Win32ResourceGenerator::lookupStringVariable(const std::string& name, std::string& output)
380380
{
381381
if ( name == "bin2cpp_win32_resource_random_identifier" ) { output = getRandomIdentifier(mContext.inputFilePath.c_str()); return true; }
382382
if ( name == "bin2cpp_win32_local_info_struct_name" ) { output = getLocalInfoStructName(); return true; }
383383

384384
// Unknown name
385-
return this->BaseGenerator::lookupStringTemplateVariable(name, output);
385+
return this->BaseGenerator::lookupStringVariable(name, output);
386386
}
387387

388388
std::string Win32ResourceGenerator::getLocalInfoStructName()

src/bin2cpp/Win32ResourceGenerator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ namespace bin2cpp
4444
virtual bool printFileContent();
4545

4646
//ITemplateVariableLookup methods
47-
virtual bool lookupStringTemplateVariable(const std::string& name, std::string& output);
47+
virtual bool lookupStringVariable(const std::string& name, std::string& output);
4848

4949
protected:
5050
virtual std::string getResourceFilePath(const char * file_path);

test/bin2cpp_unittest/TestTemplateProcessor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
class SampleVariableLookup : public bin2cpp::ITemplateVariableLookup
3636
{
3737
public:
38-
bool lookupStringTemplateVariable(const std::string& name, std::string& output) override
38+
bool lookupStringVariable(const std::string& name, std::string& output) override
3939
{
4040
if ( name == "first-name" ) { output = "Luke"; return true; }
4141
if ( name == "last-name" ) { output = "Skywalker"; return true; }
@@ -49,7 +49,7 @@ class SampleVariableLookup : public bin2cpp::ITemplateVariableLookup
4949
return false;
5050
}
5151

52-
bool lookupStreamTemplateVariable(const std::string& name, std::ostream& output) override
52+
bool lookupStreamVariable(const std::string& name, std::ostream& output) override
5353
{
5454
return false;
5555
}

0 commit comments

Comments
 (0)