pythoncom.gif
blank.gif Next blank.gif Home Page

Class ArgFormatter - An instance for a specific type of argument. Knows how to convert itself


SYNOPSIS

import win32com.makegw.makegwparse
class ArgFormatter
  def DeclareParseArgTupleInputConverter(self)
  def GetAutoduckString(self)
  def GetBuildForGatewayPostCode(self)
  def GetBuildForGatewayPreCode(self)
  def GetBuildForInterfacePostCode(self)
  def GetBuildForInterfacePreCode(self)
  def GetBuildValueArg(self)
  def GetIndirectedArgName(self, indirectFrom = None, indirectionTo = None)
  def GetInterfaceCppObjectInfo(self)
  def GetParsePostCode(self, resultIndirectionLevel = None)
  def GetParseTupleArg(self)
  def GetUnconstType(self)
  def NeedUSES_CONVERSION(self)
  def SetGatewayMode(self)
  def _GetDeclaredIndirection(self)
  def _GetPythonTypeDesc(self)
  def _IndirectPrefix(self, indirectionFrom, indirectionTo = None)
  def __init__(self, arg, builtinIndirection, declaredIndirection = 0)

DESCRIPTION

def DeclareParseArgTupleInputConverter(self)

Declare the variable used as the PyArg_ParseTuple param for a gateway

def GetBuildForGatewayPostCode(self)

Get a string of C++ code to be executed after (ie, to finalise) the Py_BuildValue conversion for Gateways

def GetBuildForGatewayPreCode(self)

Get a string of C++ code to be executed before (ie, to initialise) the Py_BuildValue conversion for Gateways

def GetBuildForInterfacePostCode(self)

Get a string of C++ code to be executed after (ie, to finalise) the Py_BuildValue conversion for Interfaces

def GetBuildForInterfacePreCode(self)

Get a string of C++ code to be executed before (ie, to initialise) the Py_BuildValue conversion for Interfaces

def GetBuildValueArg(self)

Get the argument to be passes to Py_BuildValue

def GetInterfaceCppObjectInfo(self)

Provide information about the C++ object used.

Simple variables (such as integers) can declare their type (eg an integer) and use it as the target of both PyArg_ParseTuple and the COM function itself.

More complex types require a PyObject * declared as the target of PyArg_ParseTuple, then some conversion routine to the C++ object which is actually passed to COM.

This method provides the name, and optionally the type of that C++ variable. If the type if provided, the caller will likely generate a variable declaration. The name must always be returned.

Result is a tuple of (variableName, [DeclareType|None|""])

def GetParsePostCode(self, resultIndirectionLevel = None)

Get a string of C++ code to be executed after (ie, to finalise) the PyArg_ParseTuple conversion

def GetParseTupleArg(self)

Get the argument to be passed to PyArg_ParseTuple

def NeedUSES_CONVERSION(self)

Determines if this arg forces a USES_CONVERSION macro

def _GetPythonTypeDesc(self)

Returns a string with the description of the type. Used for doco purposes

def _IndirectPrefix(self, indirectionFrom, indirectionTo = None)

Given the indirection level I was declared at (0=Normal, 1=*, 2=**) return a string prefix so I can pass to a function with the required indirection (where the default is the indirection of the method's param.

eg, assuming my arg has indirection level of 2, if this function was passed 1 it would return "&", so that a variable declared with indirection of 1 can be prefixed with this to turn it into the indirection level required of 2

SEE ALSO

win32com.makegw.makegwparse


blank.gif Next blank.gif Home Page
www_icon.gif

Copyright © Greg Stein, Mark Hammond, Curt Hagenlocher and a few other contributors
All Rights Reserved
Comments to author:
Generated: Sun Apr 20 1997