![]() |
Shadowrun: Awakened 29 September 2011 - Build 871
|
Implements the core functionality of logically representing a SQL procedure Child classes of this base implement specific logic to each code type. More...
Inheritance diagram for RoutineAnalyzer::RoutineBase:Public Member Functions | |
| abstract string | GetCode () |
| Should implement creation of the defintion. | |
| abstract string | GetDeclaration () |
| Should implement creation of the declaration. | |
| RoutineBase (string sql) | |
| Constructor Parses the SQL, creating the parameter objects for this Routine. | |
Protected Member Functions | |
| abstract RoutineParamBase | CreateRoutineParam (string sql, int index) |
| Implements generating of objects for parameters, these will be children of RoutineParamBase. | |
Protected Attributes | |
| string | _name |
| List< RoutineParamBase > | _params = new List<RoutineParamBase>() |
| string | _sql |
Private Member Functions | |
| void | FindAndCreateRoutineParams (string declaration, int startOfParams) |
| looks within the declaration and instantiates one RoutineParamDesc per parameter | |
| int | FindName (string declaration) |
| Looks within the declaration and pulls out the name. | |
| void | ParseDeclaration (string declaration) |
| Handles the two part step of finding the name and creating the parameters descriptions. | |
1) Saves the SQL for the routine declaration 2) Pulls out the SPROC name 3) Iterates over each SPROC parameter, passing them in as parameters
Definition at line 14 of file RoutineBase.cs.
| RoutineAnalyzer::RoutineBase::RoutineBase | ( | string | sql | ) | [inline] |
| sql |
Definition at line 31 of file RoutineBase.cs.
References _sql, and ParseDeclaration().
{
_sql = sql;
ParseDeclaration(_sql);
}
| abstract RoutineParamBase RoutineAnalyzer::RoutineBase::CreateRoutineParam | ( | string | sql, |
| int | index | ||
| ) | [protected, pure virtual] |
| sql | |
| index |
Implemented in RoutineAnalyzer::CppGetRoutine, RoutineAnalyzer::CppSetRoutine, RoutineAnalyzer::CppWrapperGetRoutine, RoutineAnalyzer::CppWrapperSetRoutine, RoutineAnalyzer::UScriptGetRoutine, and RoutineAnalyzer::UScriptSetRoutine.
Referenced by FindAndCreateRoutineParams(), and RoutineAnalyzer::GetRoutineBase::SetupExtendedArguments().
| void RoutineAnalyzer::RoutineBase::FindAndCreateRoutineParams | ( | string | declaration, |
| int | startOfParams | ||
| ) | [inline, private] |
| declaration | |
| startOfParams |
Definition at line 65 of file RoutineBase.cs.
References _params, and CreateRoutineParam().
Referenced by ParseDeclaration().
{
//pull out the arguents and pass them off to create our param list
int endOfParams = declaration.LastIndexOf(")");
string args = declaration.Substring(startOfParams + 1, endOfParams - startOfParams - 1);
string[] allArgs = args.Split(',');
for(int i=0; i<allArgs.Length; ++ i)
{
RoutineParamBase param = CreateRoutineParam(allArgs[i], i);
_params.Add(param);
}
}
| int RoutineAnalyzer::RoutineBase::FindName | ( | string | declaration | ) | [inline, private] |
| declaration |
Definition at line 53 of file RoutineBase.cs.
References _name.
Referenced by ParseDeclaration().
{
int startOfParams = declaration.IndexOf("(");
_name = declaration.Substring(0, startOfParams);
return startOfParams;
}
| abstract string RoutineAnalyzer::RoutineBase::GetCode | ( | ) | [pure virtual] |
Implemented in RoutineAnalyzer::CppGetRoutine, RoutineAnalyzer::CppSetRoutine, RoutineAnalyzer::CppWrapperGetRoutine, RoutineAnalyzer::CppWrapperSetRoutine, RoutineAnalyzer::UScriptGetRoutine, and RoutineAnalyzer::UScriptSetRoutine.
Referenced by RoutineAnalyzer::AnalyzerForm::GenerateCode().
| abstract string RoutineAnalyzer::RoutineBase::GetDeclaration | ( | ) | [pure virtual] |
Implemented in RoutineAnalyzer::CppGetRoutine, RoutineAnalyzer::CppSetRoutine, RoutineAnalyzer::CppWrapperGetRoutine, RoutineAnalyzer::CppWrapperSetRoutine, RoutineAnalyzer::UScriptGetRoutine, and RoutineAnalyzer::UScriptSetRoutine.
Referenced by RoutineAnalyzer::AnalyzerForm::GenerateCode().
| void RoutineAnalyzer::RoutineBase::ParseDeclaration | ( | string | declaration | ) | [inline, private] |
| declaration |
Definition at line 41 of file RoutineBase.cs.
References FindAndCreateRoutineParams(), and FindName().
Referenced by RoutineBase().
{
//pull out the name
int startOfParams = FindName(declaration);
FindAndCreateRoutineParams(declaration, startOfParams);
}
string RoutineAnalyzer::RoutineBase::_name [protected] |
Definition at line 19 of file RoutineBase.cs.
Referenced by RoutineAnalyzer::GetRoutineBase::ExecuteTestCall(), FindName(), RoutineAnalyzer::CppWrapperSetRoutine::GetCode(), RoutineAnalyzer::CppWrapperGetRoutine::GetCode(), RoutineAnalyzer::CppSetRoutine::GetCode(), RoutineAnalyzer::CppGetRoutine::GetCode(), RoutineAnalyzer::UScriptSetRoutine::GetDeclaration(), RoutineAnalyzer::UScriptGetRoutine::GetDeclaration(), RoutineAnalyzer::CppWrapperSetRoutine::GetDeclaration(), RoutineAnalyzer::CppWrapperGetRoutine::GetDeclaration(), RoutineAnalyzer::CppSetRoutine::GetDeclaration(), and RoutineAnalyzer::CppGetRoutine::GetDeclaration().
List<RoutineParamBase> RoutineAnalyzer::RoutineBase::_params = new List<RoutineParamBase>() [protected] |
Definition at line 20 of file RoutineBase.cs.
Referenced by RoutineAnalyzer::GetRoutineBase::ExecuteTestCall(), FindAndCreateRoutineParams(), RoutineAnalyzer::CppWrapperSetRoutine::GetCode(), RoutineAnalyzer::CppWrapperGetRoutine::GetCode(), RoutineAnalyzer::CppSetRoutine::GetCode(), RoutineAnalyzer::CppGetRoutine::GetCode(), RoutineAnalyzer::UScriptSetRoutine::GetDeclaration(), RoutineAnalyzer::UScriptGetRoutine::GetDeclaration(), RoutineAnalyzer::CppWrapperSetRoutine::GetDeclaration(), RoutineAnalyzer::CppWrapperGetRoutine::GetDeclaration(), RoutineAnalyzer::CppSetRoutine::GetDeclaration(), RoutineAnalyzer::CppGetRoutine::GetDeclaration(), and RoutineAnalyzer::GetRoutineBase::SetupExtendedArguments().
string RoutineAnalyzer::RoutineBase::_sql [protected] |
Definition at line 18 of file RoutineBase.cs.
Referenced by RoutineBase().
Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.