SHAPE_FILE_IO: default constructor outputs to stdout
This commit is contained in:
parent
316ddadec1
commit
dbdf085555
|
@ -28,6 +28,13 @@
|
||||||
#include <geometry/shape.h>
|
#include <geometry/shape.h>
|
||||||
#include <geometry/shape_file_io.h>
|
#include <geometry/shape_file_io.h>
|
||||||
|
|
||||||
|
SHAPE_FILE_IO::SHAPE_FILE_IO()
|
||||||
|
{
|
||||||
|
m_groupActive = false;
|
||||||
|
m_mode = IOM_WRITE;
|
||||||
|
m_file = stdout;
|
||||||
|
}
|
||||||
|
|
||||||
SHAPE_FILE_IO::SHAPE_FILE_IO( const std::string& aFilename, SHAPE_FILE_IO::IO_MODE aMode )
|
SHAPE_FILE_IO::SHAPE_FILE_IO( const std::string& aFilename, SHAPE_FILE_IO::IO_MODE aMode )
|
||||||
{
|
{
|
||||||
m_groupActive = false;
|
m_groupActive = false;
|
||||||
|
@ -61,8 +68,11 @@ SHAPE_FILE_IO::~SHAPE_FILE_IO()
|
||||||
if( m_groupActive && m_mode != IOM_READ )
|
if( m_groupActive && m_mode != IOM_READ )
|
||||||
fprintf( m_file, "endgroup\n" );
|
fprintf( m_file, "endgroup\n" );
|
||||||
|
|
||||||
|
if ( m_file != stdout )
|
||||||
|
{
|
||||||
fclose( m_file );
|
fclose( m_file );
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
SHAPE* SHAPE_FILE_IO::Read()
|
SHAPE* SHAPE_FILE_IO::Read()
|
||||||
|
|
|
@ -45,6 +45,7 @@ class SHAPE_FILE_IO
|
||||||
IOM_WRITE
|
IOM_WRITE
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SHAPE_FILE_IO();
|
||||||
SHAPE_FILE_IO( const std::string& aFilename, IO_MODE aMode = IOM_READ );
|
SHAPE_FILE_IO( const std::string& aFilename, IO_MODE aMode = IOM_READ );
|
||||||
~SHAPE_FILE_IO();
|
~SHAPE_FILE_IO();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue