Shadowrun: Awakened 29 September 2011 - Build 871
Public Member Functions | Private Member Functions | Static Private Member Functions
RoutineAnalyzer::CppWrapperSetRoutineParam Class Reference
Inheritance diagram for RoutineAnalyzer::CppWrapperSetRoutineParam:

List of all members.

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.

Detailed Description

Definition at line 8 of file CppWrapperSetRoutineParam.cs.


Constructor & Destructor Documentation

RoutineAnalyzer::CppWrapperSetRoutineParam::CppWrapperSetRoutineParam ( string  sql,
int  index 
) [inline]

Definition at line 35 of file CppWrapperSetRoutineParam.cs.

            : base(sql, index)
        {
        }

Member Function Documentation

static string RoutineAnalyzer::CppWrapperSetRoutineParam::GetCppWrapperType ( ParameterTypes  type) [inline, static, private]
Parameters:
type
Returns:

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]
Parameters:
paramIndex
Returns:

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));
        }

The documentation for this class was generated from the following file:

Copyright © 2007-2010 by The Shadowrun: Awakened Team. This work is licensed under the GNU Lesser General Public License 3.

GNU Lesser General Public License 3 Sourceforge.net