Skip to content

Commit

Permalink
Added a convenience method to check if a converter belongs to a wrapp…
Browse files Browse the repository at this point in the history
…er type.
  • Loading branch information
Marcelo Lira committed Dec 9, 2011
1 parent d25db29 commit 59b142c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
5 changes: 5 additions & 0 deletions libshiboken/sbkconverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@ bool pythonTypeIsObjectType(SbkConverter* converter)
return converter->pointerToPython && !converter->copyToPython;
}

bool pythonTypeIsWrapperType(SbkConverter* converter)
{
return converter->pointerToPython;
}

SpecificConverter::SpecificConverter(const char* typeName)
: m_type(InvalidConversion)
{
Expand Down
3 changes: 3 additions & 0 deletions libshiboken/sbkconverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,9 @@ LIBSHIBOKEN_API bool pythonTypeIsValueType(SbkConverter* converter);
/// Returns true if the Python type associated with the converter is an object type.
LIBSHIBOKEN_API bool pythonTypeIsObjectType(SbkConverter* converter);

/// Returns true if the Python type associated with the converter is a wrapper type.
LIBSHIBOKEN_API bool pythonTypeIsWrapperType(SbkConverter* converter);

#define SBK_PY_LONG_LONG_IDX 0
#define SBK_BOOL_IDX 1
#define SBK_CHAR_IDX 2
Expand Down

0 comments on commit 59b142c

Please sign in to comment.