pythoncom.gif
Previous Next blank.gif Home Page

Class ArgFormatterInterface


SYNOPSIS

import win32com.makegw.makegwparse
class ArgFormatterInterface(ArgFormatterPythonCOM)
  def GetBuildForGatewayPreCode(self)
  def GetBuildForInterfacePreCode(self)
  def GetParsePostCode(self, resultIndirectionLevel = None)
  def __init__(self, arg, builtinIndirection, declaredIndirection=0)

  # Methods inherited by ArgFormatterInterface from ArgFormatterPythonCOM
  def DeclareParseArgTupleInputConverter(self)
  def GetBuildForInterfacePostCode(self)
  def GetBuildValueArg(self)
  def GetFormatChar(self)
  def GetParseTupleArg(self)
  def _GetPythonTypeDesc(self)

  # Methods inherited by ArgFormatterInterface from ArgFormatter
  def GetAutoduckString(self)
  def GetBuildForGatewayPostCode(self)
  def GetIndirectedArgName(self, indirectFrom = None, indirectionTo = None)
  def GetInterfaceCppObjectInfo(self)
  def GetUnconstType(self)
  def NeedUSES_CONVERSION(self)
  def SetGatewayMode(self)
  def _GetDeclaredIndirection(self)
  def _IndirectPrefix(self, indirectionFrom, indirectionTo = None)

DESCRIPTION

def GetBuildForGatewayPostCode(self)

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

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 NeedUSES_CONVERSION(self)

Determines if this arg forces a USES_CONVERSION macro

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

win32com.makegw.makegwparse


Previous 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