![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
Inheritance diagram for RoutineAnalyzer::CppWrapperSetRoutineParam:Public Member Functions | |
| CppWrapperSetRoutineParam (string sql, int index) | |
| override string | GetDeclaration () |
| override string | GetParameter () |
| Returns the parameter marked used while setting up the CALL statement to the database For an IN parameter, this is just a question mark For an OUT parameter, this must be a unique name we query for later. | |
| override string | GetPostExecuteCode () |
| override string | GetPreExecuteCode () |
Private Member Functions | |
| string | GetStdStringName () |
Static Private Member Functions | |
| static string | GetCppWrapperType (ParameterTypes type) |
| Returns the C++ type associated with the given parameter type which UScript will use. | |
Definition at line 8 of file CppWrapperSetRoutineParam.cs.
| RoutineAnalyzer::CppWrapperSetRoutineParam::CppWrapperSetRoutineParam | ( | string | sql, |
| int | index | ||
| ) | [inline] |
Definition at line 35 of file CppWrapperSetRoutineParam.cs.
: base(sql, index)
{
}
| static string RoutineAnalyzer::CppWrapperSetRoutineParam::GetCppWrapperType | ( | ParameterTypes | type | ) | [inline, static, private] |
| type |
Definition at line 17 of file CppWrapperSetRoutineParam.cs.
Referenced by GetDeclaration().
{
switch (type)
{
case ParameterTypes.IntByReference: return "int*";
case ParameterTypes.IntByValue: return "int";
case ParameterTypes.StringByReference: return "wchar_t*";
case ParameterTypes.StringByValue: return "wchar_t*";
default:
throw new Exception("Error: Cpp type not implemented!");
}
}
| override string RoutineAnalyzer::CppWrapperSetRoutineParam::GetDeclaration | ( | ) | [inline, virtual] |
Implements RoutineAnalyzer::RoutineParamBase.
Definition at line 50 of file CppWrapperSetRoutineParam.cs.
References RoutineAnalyzer::RoutineParamBase::_type, RoutineAnalyzer::ParseHelper::ConvertUnderscoreToCamelCase(), GetCppWrapperType(), and RoutineAnalyzer::RoutineParamBase::Name.
{
string typeName = GetCppWrapperType(_type);
string name = ParseHelper.ConvertUnderscoreToCamelCase(Name);
return string.Format("{0} {1}", typeName, name);
}
| override string RoutineAnalyzer::CppWrapperSetRoutineParam::GetParameter | ( | ) | [inline, virtual] |
| paramIndex |
Reimplemented from RoutineAnalyzer::RoutineParamBase.
Definition at line 40 of file CppWrapperSetRoutineParam.cs.
References RoutineAnalyzer::RoutineParamBase::_type, RoutineAnalyzer::ParseHelper::ConvertUnderscoreToCamelCase(), GetStdStringName(), and RoutineAnalyzer::RoutineParamBase::Name.
{
if (_type == ParameterTypes.StringByValue)
return String.Format("convertString({0})", ParseHelper.ConvertUnderscoreToCamelCase(Name));
else if (_type == ParameterTypes.StringByReference)
return GetStdStringName();
else
return ParseHelper.ConvertUnderscoreToCamelCase(Name);
}
| override string RoutineAnalyzer::CppWrapperSetRoutineParam::GetPostExecuteCode | ( | ) | [inline, virtual] |
Implements RoutineAnalyzer::RoutineParamBase.
Definition at line 65 of file CppWrapperSetRoutineParam.cs.
References RoutineAnalyzer::RoutineParamBase::_type, RoutineAnalyzer::ParseHelper::ConvertUnderscoreToCamelCase(), GetStdStringName(), and RoutineAnalyzer::RoutineParamBase::Name.
{
if (_type == ParameterTypes.StringByReference)
return String.Format("{0} = convertString({1});", ParseHelper.ConvertUnderscoreToCamelCase(Name), GetStdStringName());
else
return "";
}
| override string RoutineAnalyzer::CppWrapperSetRoutineParam::GetPreExecuteCode | ( | ) | [inline, virtual] |
Implements RoutineAnalyzer::RoutineParamBase.
Definition at line 57 of file CppWrapperSetRoutineParam.cs.
References RoutineAnalyzer::RoutineParamBase::_type, and GetStdStringName().
{
if (_type == ParameterTypes.StringByReference)
return String.Format("std::string {0};", GetStdStringName());
else
return "";
}
| string RoutineAnalyzer::CppWrapperSetRoutineParam::GetStdStringName | ( | ) | [inline, private] |
Definition at line 73 of file CppWrapperSetRoutineParam.cs.
References RoutineAnalyzer::ParseHelper::ConvertUnderscoreToCamelCase(), and RoutineAnalyzer::RoutineParamBase::Name.
Referenced by GetParameter(), GetPostExecuteCode(), and GetPreExecuteCode().
{
return String.Format("str{0}", ParseHelper.ConvertUnderscoreToCamelCase(Name));
}
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.