Add softspace flag to StreamWriter - fixes print spaces in runtime env

This commit is contained in:
rdb 2015-07-27 20:23:47 +02:00
parent f33e450823
commit 1f0b4332e3
3 changed files with 22 additions and 6 deletions

View File

@ -1434,8 +1434,9 @@ scan_element(CPPInstance *element, CPPStructType *struct_type,
return 0;
}
if (element->_file._source != CPPFile::S_local ||
in_ignorefile(element->_file._filename_as_referenced)) {
if (struct_type == NULL &&
(element->_file._source != CPPFile::S_local ||
in_ignorefile(element->_file._filename_as_referenced))) {
// The element is defined in some other package or in an
// ignorable file.
return 0;

View File

@ -20,6 +20,9 @@
////////////////////////////////////////////////////////////////////
INLINE StreamWriter::
StreamWriter(ostream &out) :
#ifdef HAVE_PYTHON
softspace(0),
#endif
_out(&out),
_owns_stream(false)
{
@ -32,6 +35,9 @@ StreamWriter(ostream &out) :
////////////////////////////////////////////////////////////////////
INLINE StreamWriter::
StreamWriter(ostream *out, bool owns_stream) :
#ifdef HAVE_PYTHON
softspace(0),
#endif
_out(out),
_owns_stream(owns_stream)
{
@ -45,6 +51,9 @@ StreamWriter(ostream *out, bool owns_stream) :
////////////////////////////////////////////////////////////////////
INLINE StreamWriter::
StreamWriter(const StreamWriter &copy) :
#ifdef HAVE_PYTHON
softspace(0),
#endif
_out(copy._out),
_owns_stream(false)
{

View File

@ -81,6 +81,12 @@ PUBLISHED:
private:
ostream *_out;
bool _owns_stream;
#ifdef HAVE_PYTHON
PUBLISHED:
// Python 2 needs this for printing to work correctly.
int softspace;
#endif
};
#include "streamWriter.I"