![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
Inheritance diagram for RoutineAnalyzer::CppWrapperGetRoutine:Public Member Functions | |
| CppWrapperGetRoutine (string sql) | |
| Constructor Performs all initialization of RoutineBase Plus executing the SPROC and using its result to add additional param instances. | |
| override string | GetCode () |
| Should implement creation of the defintion. | |
| override string | GetDeclaration () |
| Gets the declaration associated with this C++ function. | |
Protected Member Functions | |
| override RoutineParamBase | CreateRoutineParam (string sql, int index) |
| Implements generating of objects for parameters, these will be children of RoutineParamBase. | |
Definition at line 8 of file CppWrapperGetRoutine.cs.
| RoutineAnalyzer::CppWrapperGetRoutine::CppWrapperGetRoutine | ( | string | sql | ) | [inline] |
| override RoutineParamBase RoutineAnalyzer::CppWrapperGetRoutine::CreateRoutineParam | ( | string | sql, |
| int | index | ||
| ) | [inline, protected, virtual] |
| sql | |
| index |
Implements RoutineAnalyzer::RoutineBase.
Definition at line 65 of file CppWrapperGetRoutine.cs.
{
return new CppGetRoutineParam(sql, index);
}
| override string RoutineAnalyzer::CppWrapperGetRoutine::GetCode | ( | ) | [inline, virtual] |
Implements RoutineAnalyzer::RoutineBase.
Definition at line 43 of file CppWrapperGetRoutine.cs.
References RoutineAnalyzer::RoutineBase::_name, RoutineAnalyzer::RoutineBase::_params, RoutineAnalyzer::ParseHelper::ConvertUnderscoreToCamelCase(), GetDeclaration(), and RoutineAnalyzer::RoutineParamBase::GetPreExecuteCode().
{
//build the start of the function
StringBuilder builder = new StringBuilder();
builder.AppendLine(GetDeclaration());
builder.AppendLine("{");
//build a call to the C++ implementation, including each parameter
builder.Append(ParseHelper.ConvertUnderscoreToCamelCase(_name));
builder.Append("(");
foreach (RoutineParamBase param in _params)
{
builder.Append(param.GetPreExecuteCode());
builder.Append(",");
}
builder.AppendLine(" queryId);");
//close up the function and return it
builder.AppendLine("}");
return builder.ToString();
}
| override string RoutineAnalyzer::CppWrapperGetRoutine::GetDeclaration | ( | ) | [inline, virtual] |
Implements RoutineAnalyzer::RoutineBase.
Definition at line 25 of file CppWrapperGetRoutine.cs.
References RoutineAnalyzer::RoutineBase::_name, RoutineAnalyzer::RoutineBase::_params, RoutineAnalyzer::ParseHelper::ConvertUnderscoreToCamelCase(), and RoutineAnalyzer::RoutineParamBase::GetDeclaration().
Referenced by GetCode().
{
StringBuilder builder = new StringBuilder();
builder.Append("__declspec(dllexport) void ");
builder.Append(ParseHelper.ConvertUnderscoreToCamelCase(_name));
builder.Append("(");
foreach (RoutineParamBase param in _params)
{
builder.Append(param.GetDeclaration());
builder.Append(", ");
}
builder.Append("int* queryId");
builder.Append(")");
return builder.ToString();
}
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.