s/operator_os/output_stream_operator/ (more readable)

This commit is contained in:
Gustavo J. A. M. Carneiro committed 2008-07-02 10:52:29 +01:00
1 parent afbc756be3
commit a2068d0789
2 files changed
+9 -9

No files matched your search

+4 -4
View File
@@ -409,7 +409,7 @@ class CppClass(object):
self.helper_class_disabled = False
self.cannot_be_constructed = '' # reason
self.has_trivial_constructor = False
self.has_operator_os = False
self.has_output_stream_operator = False
self._have_pure_virtual_methods = None
## list of CppClasses from which a value of this class can be
## implicitly generated; corresponds to a
@@ -1084,8 +1084,8 @@ public:
if not wrapper.parameters:
self.has_trivial_constructor = True
def add_operator_os(self):
self.has_operator_os = True
def add_output_stream_operator(self):
self.has_output_stream_operator = True
def add_constructor(self, *args, **kwargs):
"""
@@ -1322,7 +1322,7 @@ typedef struct {
self._generate_gc_methods(code_sink)
self._generate_destructor(code_sink, have_constructor)
if self.has_operator_os:
if self.has_output_stream_operator:
self._generate_str(code_sink)
self._generate_type_structure(code_sink, docstring)
+5 -5
View File
@@ -1211,7 +1211,7 @@ pybindgen.settings.error_handler = ErrorHandler()
def _scan_class_methods(self, cls, class_wrapper, pygen_sink):
have_trivial_constructor = False
have_copy_constructor = False
has_operator_os = False
has_output_stream_operator = False
for op in self.module_namespace.free_operators(function=self.location_filter,
@@ -1221,7 +1221,7 @@ pybindgen.settings.error_handler = ErrorHandler()
and len (op.arguments) >= 2 \
and self._is_ostream (op.arguments[0].type) \
and type_traits.is_convertible (cls, op.arguments[1].type):
has_operator_os = True
has_output_stream_operator = True
for op in cls.member_operators(function=self.location_filter,
allow_empty=True,
@@ -1230,7 +1230,7 @@ pybindgen.settings.error_handler = ErrorHandler()
and len (op.arguments) >= 2 \
and self._is_ostream (op.arguments[0].type) \
and type_traits.is_convertible (cls, op.arguments[1].type):
has_operator_os = True
has_output_stream_operator = True
if pygen_sink is None:
pygen_sink = NullCodeSink()
@@ -1506,8 +1506,8 @@ pybindgen.settings.error_handler = ErrorHandler()
class_wrapper.add_constructor([
class_wrapper.ThisClassRefParameter("%s const &" % class_wrapper.full_name,
'ctor_arg', is_const=True)])
if has_operator_os:
pygen_sink.writeln("cls.add_operator_os()")
if has_output_stream_operator:
pygen_sink.writeln("cls.add_output_stream_operator()")
def scan_functions(self):